LightGraphs.jl icon indicating copy to clipboard operation
LightGraphs.jl copied to clipboard

[BUG]

Open lindapamg opened this issue 3 years ago • 4 comments

loss some edges when I use biconnected_components function

start=[1,1,2,2,2,3,4,4,5,5,7,7,8,8,9,9,10,10,12,12,1,2,3] destination=[2,4,4,5,3,5,7,8,7,8,9,10,9,10,11,12,12,13,13,11,11,12,13]

graph_s=SimpleWeightedGraph(start,destination,collect(1:23))

bi_components= biconnected_components(graph_s)

image

image

loss four edges

lindapamg avatar Sep 05 '21 12:09 lindapamg

The error is here : the edge is added only if state.low[v] > state.depth[w], whereas it should be always added to the stack. I can make a PR, but I have an interrogation: Why do we return the biconnected components by their edges? As the subgraphs are induced, this is more easily defined by the vertices. Is there a good reason to do that, or would it be too breaking to change this behavior?

etiennedeg avatar Sep 05 '21 15:09 etiennedeg

Because I want to gain biconnected_components with edges to remove some unwanted edges. So , How can we solve this problem(error)?

lindapamg avatar Sep 06 '21 00:09 lindapamg

The error is here : the edge is added only if state.low[v] > state.depth[w], whereas it should be always added to the stack. I can make a PR, but I have an interrogation: Why do we return the biconnected components by their edges? As the subgraphs are induced, this is more easily defined by the vertices. Is there a good reason to do that, or would it be too breaking to change this behavior?

Thank you for you reply this problem.

lindapamg avatar Sep 06 '21 00:09 lindapamg

My response is mainly intended to contributors of LightGraphs, and does not actually gives you an easy workaround for the problem. It seems that at the moment, the committers are not very active, but this is probably a consequence of summer vacations. So I can't exactly tell you when this will be fixed. If you need a workaround quickly, you can either modify directly the package (following the fix I described), or copy the biconnected_components in your code and override it with the fix.

etiennedeg avatar Sep 06 '21 16:09 etiennedeg