public class Dijkstra extends Object
Constructor and Description |
---|
Dijkstra(Graph graph,
Node source)
Compute the shortest path from source node to every other node in the
graph.
|
Modifier and Type | Method and Description |
---|---|
int |
getLargestDistance()
Return the distance (measured as the number of hops) to the most distant
node
|
LinkedList<Node> |
getPath(Node target)
Return the path from the source to the selected target
|
public LinkedList<Node> getPath(Node target) throws Exception
target
- Exception
- if no path exists to this targetpublic int getLargestDistance()
Copyright © 2015. All rights reserved.