T - type of nodes in the graphpublic class Dijkstra<T> extends Object
| Constructor and Description |
|---|
Dijkstra(Graph graph,
T 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<T> |
getPath(T target)
Return the path from the source to the selected target.
|
public final LinkedList<T> getPath(T target) throws Exception
target - node to which we search the pathException - if no path exists to this targetpublic final int getLargestDistance()
Copyright © 2017. All rights reserved.