Re: [jgrapht-users] EdgeReversedGraph does not modify edgeSet.
Brought to you by:
barak_naveh,
perfecthash
From: John V. S. <js...@gm...> - 2010-07-25 06:23:20
|
Luis Pureza wrote: > Hi, > > I have been using JGraphT for some graph related activities and I love > it. Nonetheless, I seem to have found an inconsistency. > > When I create an EdgeReversedGraph, the edgeSet() is not reversed. Is > this a bug? Would you like me to cook up a patch? Do you mean you are expecting that when you iterate edgeSet, the edges will be E3 E2 E1 if they were E1 E2 E3 in the original graph? That's not a bug; this class only reverses the direction of the edges (not their order in the set). > Also, while I'm at it... I need to be able to tell if two graphs are > equal. Is it enough to compare the vertexSet()s and the edgeSet()s of > both graphs? If you'd like, I can submit a patch that implements > equals() and hashCode() for graphs. By equal, do you mean isomorphic? That is the main comparison of interest for graphs, but there is no known polynomial-time algorithm for it. We have a brute-force implementation in the experimental package. JVS |