Package graph
Class ShortestPaths<Vertex,Edge> 
java.lang.Object
graph.ShortestPaths<Vertex,Edge> 
This object computes and remembers shortest paths through a
  weighted, directed graph. Once shortest paths are computed from
  a specified source vertex, it allows querying the distance to
  arbitrary vertices and the best paths to arbitrary destination
  vertices.
Types Vertex and Edge are parameters, so their operations are supplied by a model object supplied to the constructor.
- 
Constructor SummaryConstructorsConstructorDescriptionShortestPaths(WeightedDigraph<Vertex, Edge> graph) Creates: a single-source shortest-path finder for a weighted graph.
- 
Method SummaryModifier and TypeMethodDescriptionReturns: the best path from the source vertex to a given target vertex.doubleReturns: the distance from the source vertex to the given vertex.voidsingleSourceDistances(Vertex source) Effect: Computes the best paths from a given source vertex, which can then be queried using bestPath().
- 
Constructor Details- 
ShortestPathsCreates: a single-source shortest-path finder for a weighted graph.- Parameters:
- graph- The model that supplies all graph operations.
 
 
- 
- 
Method Details- 
singleSourceDistancesEffect: Computes the best paths from a given source vertex, which can then be queried using bestPath().
- 
getDistanceReturns: the distance from the source vertex to the given vertex. Checks: distances have been computed from a source vertex, and vertex v is reachable from that vertex.
- 
bestPathReturns: the best path from the source vertex to a given target vertex. The path is represented as a list of edges. Requires: singleSourceDistances() has already been used to compute best paths.
 
-