From 21850a2876301835f4c9dd99cee6ace9d3f019fd Mon Sep 17 00:00:00 2001 From: "yu.dongliang" <18588496441@163.com> Date: Wed, 8 Nov 2023 16:55:24 +0800 Subject: [PATCH] tmp --- ses_graph.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/ses_graph.c b/ses_graph.c index 89080a1..3c09d4a 100644 --- a/ses_graph.c +++ b/ses_graph.c @@ -1,4 +1,5 @@ #include"ses_graph.h" +#include"ses_core.h" ses_vertex_t* ses_vertex_alloc() { @@ -222,6 +223,9 @@ static int __find_not_neighbor(scf_vector_t* graph, int k, ses_vertex_t** pp0, s for (i = 0; i < graph->size; i++) { v0 = graph->data[i]; + ScfEcomponent* c0 = v0->data; + scf_loge("graph->size: %d, k: %d, c%ld->edges->size: %d\n", graph->size, k, c0->id, v0->edges->size); + if (v0->edges->size > k) continue; @@ -230,6 +234,9 @@ static int __find_not_neighbor(scf_vector_t* graph, int k, ses_vertex_t** pp0, s for (j = i + 1; j < graph->size; j++) { v1 = graph->data[j]; + ScfEcomponent* c1 = v1->data; + scf_logi("graph->size: %d, k: %d, c%ld->edges->size: %d\n", graph->size, k, c1->id, v1->edges->size); + if (!scf_vector_find(v0->edges, v1)) { assert(!scf_vector_find(v1->edges, v0)); break; @@ -237,6 +244,7 @@ static int __find_not_neighbor(scf_vector_t* graph, int k, ses_vertex_t** pp0, s v1 = NULL; } + printf("\n"); if (v1) { *pp0 = v0; @@ -265,6 +273,7 @@ static ses_vertex_t* __max_neighbors(scf_vector_t* graph) } } + scf_loge("\n"); return max; } @@ -279,7 +288,7 @@ static int __graph_kcolor(scf_vector_t* graph, int k, scf_vector_t* colors) if (!deleted) return -ENOMEM; - scf_logd("graph->size: %d, k: %d\n", graph->size, k); + scf_logw("graph->size: %d, k: %d\n", graph->size, k); int ret = __kcolor_delete(graph, k, deleted); if (ret < 0) @@ -293,6 +302,7 @@ static int __graph_kcolor(scf_vector_t* graph, int k, scf_vector_t* colors) scf_vector_free(deleted); deleted = NULL; + scf_logw("graph->size: %d, k: %d\n\n", graph->size, k); return 0; } @@ -312,6 +322,10 @@ static int __graph_kcolor(scf_vector_t* graph, int k, scf_vector_t* colors) goto overflow; v1->color = v0->color; + ScfEcomponent* c0 = v0->data; + ScfEcomponent* c1 = v1->data; + scf_logi("graph->size: %d, k: %d, c%ld, c%ld, color: %ld\n", graph->size, k, c0->id, c1->id, v0->color); + __color_del(__colors, v0->color); ret = __graph_del(graph, v0); @@ -363,6 +377,7 @@ overflow: scf_vector_free(deleted); deleted = NULL; + scf_logw("graph->size: %d, k: %d\n\n", graph->size, k); return 0; error: -- 2.25.1