Re: [jgrapht-users] JGrapht: Compare two GraphPath
Brought to you by:
barak_naveh,
perfecthash
From: H.N. de R. <hnr...@gr...> - 2013-04-05 13:18:28
|
On Mon, Apr 01, 2013 at 11:13:23AM -0700, Pankaj2590 wrote: > I am writing a customize function to compare two GraphPaths of > SimpleWeightedGraph, where edges are DefaultWeightedEdge. For the same, when > the length of the both GraphPths are unequal then i am considering the > GraphPath which has less length as "smaller". But for the equal length > GraphPath, i am considering the GraphPath as "smaller" which contains edge, > that is greater than all the edges of other GraphPath. > Here, I am having the Start Vertex of the Graphpath and End Vertex of > the GraphPath but any how i am not able to get opposite vertex. What do you meant by "not able to"? Does org.jgrapht.Graphs.getOppositeVertex throw an error? > I have tried also by comparing the vertices by creating graph of > GraphPath, wheather they are exists in this new graph or not. after that, i > am not able to find the weight of the edge. Then how i compare those > weights?? > Conclusion is how i extract the weight of an edge..because getWeight > method is not applicable for the same. If I understand you correctly, you'd have to use getEdgeWeight of the original graph. Maybe you can give some small code example to demonstrate the problems you encounter? Regards, Ernst -- Information System on Graph Classes and their Inclusions (ISGCI) http://www.graphclasses.org |