This isn't really a bug so much as a design or math problem. The betweenness algorithm will start out in the first subgraph it encounters and never reach the nodes in the other subgraphs, because there are no connections between these graphs to follow. Therefore, nodes in the subgraphs (those that aren't visited) have a betweenness score of 0.
This makes sense if you consider the following little metaphor: all villagers are trapped on the main island as long as they don't build a bridge to the surrounding islands.
The most straightforward way would be to split the graph (see graph.split()) into its subgraphs and draw each one separately.
Another solution would be for the library to check if there are unconnected subgraphs when calculating betweenness - but I don't think this kind of check belongs inside the betweenness algorithm. I'm open to suggestions, but probably there is no good all-round solution that can be built in.
I see your point...- and it makes 100% sense. thanks for the tips!
bug in graph lib / betweenness
Posted by Giorgio O. on Jan 29, 2009hello again,
while working with the graph library I encountered a problem.
I'll try to describe it: let's say that have graph that is made by different disconnected subgraphs... if I draw it trying to highlight the nodes with high 'traffic' only one subgraph gets the highlight while all the others don't.
I kind of reproduced the behaviour in the following example, as you will see only in one subgraph the nodes will get the 'shadows'.