public final class DijkstraShortestPath<V,E>
extends java.lang.Object
ClosestFirstIterator
.Constructor and Description |
---|
DijkstraShortestPath(Graph<V,E> graph,
V startVertex,
V endVertex)
Creates and executes a new DijkstraShortestPath algorithm instance.
|
DijkstraShortestPath(Graph<V,E> graph,
V startVertex,
V endVertex,
double radius)
Creates and executes a new DijkstraShortestPath algorithm instance.
|
Modifier and Type | Method and Description |
---|---|
static <V,E> java.util.List<E> |
findPathBetween(Graph<V,E> graph,
V startVertex,
V endVertex)
Convenience method to find the shortest path via a single static method
call.
|
java.util.List<E> |
getPathEdgeList()
Return the edges making up the path found.
|
double |
getPathLength()
Return the length of the path found.
|
public DijkstraShortestPath(Graph<V,E> graph, V startVertex, V endVertex)
graph
- the graph to be searchedstartVertex
- the vertex at which the path should startendVertex
- the vertex at which the path should endpublic DijkstraShortestPath(Graph<V,E> graph, V startVertex, V endVertex, double radius)
graph
- the graph to be searchedstartVertex
- the vertex at which the path should startendVertex
- the vertex at which the path should endradius
- limit on path length, or Double.POSITIVE_INFINITY for
unbounded searchpublic java.util.List<E> getPathEdgeList()
public double getPathLength()
public static <V,E> java.util.List<E> findPathBetween(Graph<V,E> graph, V startVertex, V endVertex)
graph
- the graph to be searchedstartVertex
- the vertex at which the path should startendVertex
- the vertex at which the path should end