functional error in igraph_diameter_dijkstra

Bug #680538 reported by qqchou
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
igraph
Fix Released
High
Unassigned

Bug Description

I use igraph-0.5.5-msvc.zip,and find a small bug in function igraph_diameter_dijkstra, which causes function returns wrong result.

In file "spectral_properties.c" ,line 5180,
"for (source=0; source < no_of_nodes; source++)"
where is the loop of "source", variable "nodes_reached" should be initialized to 0 first during each loop, then it can count the number of reached nodes correctly.

In line 5222,
"if (nodes_reached != no_of_nodes && !unconn)"
when unconn is false, the function works improperly.

Revision history for this message
qqchou (cece7252) wrote :

sorry,it's file "structural_properties.c"

Revision history for this message
Gábor Csárdi (gabor.csardi) wrote :

Yep, it seems that this is a bug, if the graph is directed, but not strongly connected and all vertices are reachable from the first vertex.

Changed in igraph:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Gábor Csárdi (gabor.csardi) wrote :

I mean, there is a bug if the graph is strongly connected. Anyway, I fixed it in revision 2225, in the 0.6-main tree.

Changed in igraph:
status: Confirmed → Fix Released
Revision history for this message
Gábor Csárdi (gabor.csardi) wrote : Continue on github

The development of igraph has moved to github, so please do not comment on this bug here. You are of course welcome to comment on github, here:
https://github.com/igraph/igraph/issues/80

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.