Skip to content

Commit b6489a1

Browse files
Fix bug in digraph homom. finder
1 parent 95e8478 commit b6489a1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/homos-graphs.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static void init_bliss_graph_from_digraph(Digraph const* const digraph,
135135
uint16_t out_color = 0;
136136
uint16_t const n = digraph->nr_vertices;
137137
for (uint16_t i = 0; i < n; i++) {
138-
out_color = (colors[i] > out_color ? colors[i] + 1 : out_color);
138+
out_color = (colors[i] >= out_color ? colors[i] + 1 : out_color);
139139
bliss_digraphs_change_color(bg, i, colors[i]);
140140
}
141141
uint16_t const in_color = out_color + 1;
@@ -163,7 +163,7 @@ static BlissGraph* new_bliss_graph_from_digraph(Digraph const* const digraph,
163163
uint16_t const n = digraph->nr_vertices;
164164
bg = bliss_digraphs_new(0);
165165
for (uint16_t i = 0; i < n; i++) {
166-
out_color = (colors[i] > out_color ? colors[i] + 1 : out_color);
166+
out_color = (colors[i] >= out_color ? colors[i] + 1 : out_color);
167167
bliss_digraphs_add_vertex(bg, colors[i]);
168168
}
169169
uint16_t const in_color = out_color + 1;
@@ -233,6 +233,7 @@ static void bliss_hook(void* user_param_arg, // perm_coll!
233233
Perm p = new_perm(PERM_DEGREE);
234234
unsigned int const min = (N < PERM_DEGREE ? N : PERM_DEGREE);
235235
for (uint16_t i = 0; i < min; i++) {
236+
DIGRAPHS_ASSERT(aut[i] < min);
236237
p[i] = aut[i];
237238
}
238239
for (uint16_t i = min; i < PERM_DEGREE; i++) {

0 commit comments

Comments
 (0)