[jgrapht-users] closeSimpleDirectedGraph() doesn't return
Brought to you by:
barak_naveh,
perfecthash
From: Yi L. <qi...@gm...> - 2013-04-22 08:19:06
|
Hi all, I am trying to use JGraphT in my project. I used SimpleDirectedGraph to store my graph (the graph is dynamically generated, and huge). All the vertices and edges are added to the graph, it seems fine - no warning to say there is a loop. Then I tried to get transitive closure on the graph. So I called TransitiveClosure.INSTANCE.closeSimpleDirectedGraph(myGraph); However, the execution got stuck in this method and it didn't return. I tried to call new CycleDetector<V, E>(myGraph).detectCycles() before computing transitive closure, and it returns true. It seems weird to me now, since SimpleDirectedGraph should prompt a warning if there is any loop when an edge is added. There wasn't any warning, but CycleDectector reported cycles. Thus I am not sure what the problem is now. Possible cycles in the graph, or I used those APIs in a wrong way, or any known implementation problem with JGraphT (with CycleDetector/TransitiveClosure/SimpleDirectedGraph)? I could dump the graph, and check through it. But the graph is huge, I would rather not to walk through it unless I have to. I think I would better ask the question here for some suggestions. Any help would be appreciated. Thank you very much. Regards, Yi |