Re: [jgrapht-users] DijkstraShortestPath inefficient for (start, *) ?
Brought to you by:
barak_naveh,
perfecthash
From: John V. S. <js...@gm...> - 2009-10-23 02:36:45
|
The Dijkstra API class is just a thin wrapper around ClosestFirstIterator, which already provides what you need (as well as the MST), though not perfectly wrapped. JVS kevin brintnall wrote: > Hello, > > JGraphT's existing Dijkstra API is able to search for a single (start,end) > vertex pair. However, it doesn't appear there is a good way to calculate > all paths from a single source vertex: i.e. (source,*). > > Whereas the ideal run-time of Dijkstra's algorithm is O(E + V log(V)), it > appears the best run-time with JGraphT's current API is O(V * ideal) for > this use case. > > Maybe it's better to allow endVertex==null, and calculate the weight and > predecessor maps for every vertex in that case? > > Any suggestions? Am I missing a good alternative? > |