| java.lang.Object org.geotools.graph.path.DijkstraShortestPathFinder
DijkstraShortestPathFinder | public class DijkstraShortestPathFinder implements GraphWalker(Code) | | Calculates node paths in a graph using Dijkstra's Shortest Path Algorithm.
Dijsktras algorithm calculates a shortest path from a specefied node (the
source node of the underlying dijkstra iteration) to every other node in the
graph.
See Also: DijsktraIterator See Also: author: Justin Deoliveira, Refractions Research Inc, jdeolive@refractions.net |
DijkstraShortestPathFinder | public DijkstraShortestPathFinder(Graph graph, DijkstraIterator iterator)(Code) | | Constructs a new path finder.
Parameters: graph - The graph to calculate paths for. Parameters: iterator - The dijsktra iterator to used to calculate shortest paths. |
DijkstraShortestPathFinder | public DijkstraShortestPathFinder(Graph graph, Graphable source, EdgeWeighter weighter)(Code) | | Constructs a new path finder.
Parameters: graph - Graph to calculate paths for. Parameters: source - Node to calculate paths from. Parameters: weighter - Associates weights with edges in the graph. |
calculate | public void calculate()(Code) | | Performs the graph traversal and calculates the shortest path from
the source node to every other node in the graph.
|
getCost | public double getCost(Graphable g)(Code) | | Returns the cost associated with a node calculated during the graph
traversal.
Parameters: g - The node whose cost is desired. The cost associated with the node. |
getPath | public Path getPath(Graphable g)(Code) | | Returns a path from g to the source. If the desired path is
the opposite (from the source to g) can be used.
Parameters: g - The start node of the path to be calculated. See Also: Path.riterator A path from g to the source. |
|
|