public class DijkstraAlgorithm extends Object
| Modifier and Type | Field | Description |
|---|---|---|
static int |
INFINITE |
Infinity value for distances.
|
| Constructor | Description |
|---|---|
DijkstraAlgorithm(EdgeDirectory edgeDirectory) |
Main Constructor.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
execute(Vertex start,
Vertex destination) |
Run Dijkstra's shortest path algorithm.
|
protected Iterator |
getDestinations(Vertex origin) |
Returns an iterator over all valid destinations for a given vertex.
|
int |
getLowestPenalty(Vertex vertex) |
Returns the lowest penalty from the start point to a given vertex.
|
protected int |
getPenalty(Vertex start,
Vertex end) |
Returns the penalty between two vertices.
|
Vertex |
getPredecessor(Vertex vertex) |
Returns the vertex's predecessor on the shortest path.
|
public static final int INFINITE
public DijkstraAlgorithm(EdgeDirectory edgeDirectory)
edgeDirectory - the edge directory this instance should work onprotected int getPenalty(Vertex start, Vertex end)
start - the start vertexend - the end vertexprotected Iterator getDestinations(Vertex origin)
origin - the origin from which to search for destinationspublic void execute(Vertex start, Vertex destination)
getPredecessor(Vertex) to reconstruct the best/shortest path starting from the
destination backwards.start - the starting vertexdestination - the destination vertex.public int getLowestPenalty(Vertex vertex)
vertex - the vertexINFINITE if there is no route to
the destination.Copyright © 2018 Apache Software Foundation. All rights reserved.