Skip to content

Commit

Permalink
added invariant for nwgraph
Browse files Browse the repository at this point in the history
this was originally implemented for nwgraph akin to graph, but some
tests were failing so I removed it. I have now added it back because the
tests all pass.
  • Loading branch information
ahgamut committed Jan 31, 2022
1 parent 4d98703 commit 6503521
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/cliquematch/detail/nwgraph/nwgraph.cpp
Expand Up @@ -85,7 +85,16 @@ namespace detail
{
mcs = 0;
depth = 0;
for (j = 0; j < this->vertices[cur].N; j++)
for (j = 0; j < this->vertices[cur].spos; j++)
{
vert = edge_list[vertices[cur].elo + j];
// degree of vert has to be > degree of cur
// to be considered while searching from cur
if (vertices[vert].degree > vertices[cur].degree)
mcs += vertices[vert].weight;
if (vertices[vert].N > vertices[cur].N) depth += 1;
}
for (; j < this->vertices[cur].N; j++)
{
vert = edge_list[vertices[cur].elo + j];
// degree of vert has to be >= degree of cur
Expand Down

0 comments on commit 6503521

Please sign in to comment.