Walktrap: graphs with isolated vertices are not accepted

Bug #1066081 reported by Christopher Lu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
igraph
Fix Released
Medium
Tamás Nepusz

Bug Description

Walktrap does not operate on graphs with isolated vertices; why is this not allowed? It can handle graphs with multiple connected components, so it makes sense for isolated vertices to be handled the same way.

The algorithm itself appears to be able to handle this, but the conversion from an igraph graph will divide by zero when calculating the average edge weight for the loop edge. For isolated vertices, the weight of the loop edge doesn't matter.

A patch against top of trunk implementing the necessary change is attached.

Tags: walktrap
Revision history for this message
Christopher Lu (9e9o1ko8b2f5xpiibgscjzlhu-chris-0zxvj9hhx1hzo5xiyhxz186cr) wrote :
Revision history for this message
Tamás Nepusz (ntamas) wrote :

The original implementation of the walktrap method from Pascal Pons did not allow isolated vertices either and we just replaced the error message in his code with an appropriate igraph error code. I'll read the paper once again to see that it really doesn't matter and if so, I'll merge your patch. Thanks!

Changed in igraph:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Tamás Nepusz (ntamas)
milestone: none → 0.6.1
Revision history for this message
Tamás Nepusz (ntamas) wrote :

Merged in #2971 in 0.6-main and #3009 in trunk. Needed some extra legwork to ensure that it does not blow up for empty graphs. Thanks a lot!

Changed in igraph:
status: In Progress → Fix Committed
Changed in igraph:
status: Fix Committed → 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/242

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.