ses_edge_t* edge;
- intptr_t N = 4;
+ intptr_t N = 2;
intptr_t i;
+ intptr_t j;
scf_loge("\n");
__ses_get_crosses(f, d, graph);
- for (i = 1; i <= N; i++)
- scf_vector_add(colors, (void*)i);
+ if (0 < graph->size) {
+ edge = graph->data[0];
- int ret = ses_cross_graph_kcolor(graph, N, colors);
- if (ret < 0) {
- scf_loge("**********\n");
+ N = edge->crosses->size;
+ }
+
+ for (j = N; j >= 0; j--) {
+
+ for (i = 1; i <= j; i++)
+ scf_vector_add(colors, (void*)i);
+
+ int ret = ses_cross_graph_kcolor(graph, j, colors);
+ if (ret < 0) {
+ scf_loge("**********\n");
+ }
+
+ for (i = 0; i < graph->size; i++) {
+ edge = graph->data[i];
+
+ if (edge->color < 0)
+ break;
+ }
+
+ if (i < graph->size)
+ break;
+
+ for (i = 0; i < graph->size; i++) {
+ edge = graph->data[i];
+
+ edge->c->color = edge->color;
+ edge->color = 0;
+ }
+
+ scf_vector_clear(colors, NULL);
+ printf("\n");
}
for (i = 0; i < graph->size; i++) {
edge = graph->data[i];
- scf_logi("i: %ld, c%ld->color: %ld\n", i, edge->c->id, edge->color);
+
+ scf_logi("j: %ld, i: %ld, c%ld->color: %ld\n", j, i, edge->c->id, edge->c->color);
}
scf_vector_clear(graph, ( void (*)(void*) )ses_edge_free);