Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit bd41d9e

Browse files
knizhnikkelvich
authored andcommitted
Fix bug in BK algorithm implementation
1 parent acb0ab6 commit bd41d9e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

bkb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ static void findMaximumIndependentSet(NodeList* cur, NodeList* result, nodemask_
9393
cur->size -= 1;
9494
ne += 1;
9595
if (k > 1) {
96-
for (s = ++ne; !BIT_CHECK(graph[fixp], oldSet[s]); s++);
96+
for (s = ne; !BIT_CHECK(graph[fixp], oldSet[s]); s++);
9797
}
9898
}
9999
}

bkbtest.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
int main() {
66
nodemask_t matrix[64] = {0};
77
nodemask_t clique;
8+
int clique_size;
89
matrix[0] = 6;
910
matrix[1] = 4;
1011
matrix[2] = 1;
1112
matrix[4] = 3;
12-
clique = MtmFindMaxClique(matrix, 64);
13+
clique = MtmFindMaxClique(matrix, 64, &clique_size);
1314
printf("Clique=%lx\n", clique);
1415
return 0;
1516
}

0 commit comments

Comments
 (0)