Skip to content

Commit

Permalink
Bug in Kruskal.
Browse files Browse the repository at this point in the history
  • Loading branch information
clementfarabet committed Oct 25, 2011
1 parent 016cd97 commit 31c3e02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pink/kruskal.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ list * MSF_Kruskal(MergeTree * MT) // max_weight /* maximum weight value */
for (i = 0; i < CT->nbnodes; i++)
{
// nodes having a different value than their father are in the cut
if( Map[CT->tabnodes[i].father] != Map[i])
if ((CT->tabnodes[i].father != -1) && (Map[CT->tabnodes[i].father] != Map[i]))
Insert(&cut, i);
// leafs having the same label as the root are in the cut
if ((CT->tabnodes[i].nbsons == 0) && (Map[i]==0))
Expand Down

0 comments on commit 31c3e02

Please sign in to comment.