Re: [jgrapht-users] KShortestPaths issues
Brought to you by:
barak_naveh,
perfecthash
From: John V. S. <js...@gm...> - 2009-05-11 19:21:47
|
There is no mistake; it's just that the KShortestPaths.PathWrapper does not have a toString() method, so List.toString prints the Java object ID's instead. JVS Achim Beutel wrote: > Hi, > > I am trying to use the getPath() method from the KShortestPaths class but without any luck (current version). > > I defined a new graph: > DirectedGraph<String, DefaultEdge> directedGraph = new DefaultDirectedGraph<String, DefaultEdge> (DefaultEdge.class); > > and added some vertices and edges. Then: > > KShortestPaths shortestPaths = new KShortestPaths(directedGraph, "vertex1", 2); > List path = shortestPaths.getPaths("vertex2"); > > Now, I get an output like this for 'path': > [org.jgrapht.alg.KShortestPaths$PathWrapper@24f420, org.jgrapht.alg.KShortestPaths$PathWrapper@24f410] > > Where is my mistake? > > Thanks! |