LightGraphs.jl
LightGraphs.jl copied to clipboard
[BUG]
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)
loss four edges
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?
Because I want to gain biconnected_components with edges to remove some unwanted edges. So , How can we solve this problem(error)?
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.
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.