public class Dijkstra<V,E>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.Object |
DIST
Decoration key for vertex distances
|
protected java.lang.Object |
ENTRY
Decoration key for entries in the priority queue
|
protected Graph<V,E> |
graph
Input graph.
|
protected static java.lang.Integer |
INFINITE
Infinity value.
|
protected AdaptablePriorityQueue<java.lang.Integer,Vertex<V>> |
Q
Auxiliary priority queue.
|
protected java.lang.Object |
WEIGHT
Decoration key for edge weights
|
Constructor and Description |
---|
Dijkstra() |
Modifier and Type | Method and Description |
---|---|
protected void |
dijkstraVisit(Vertex<V> v)
The actual execution of Dijkstra's algorithm.
|
void |
execute(Graph<V,E> g,
Vertex<V> s,
java.lang.Object w)
Executes Dijkstra's algorithm.
|
int |
getDist(Vertex<V> u)
Get the distance of a vertex from the source vertex.
|
protected static final java.lang.Integer INFINITE
protected java.lang.Object WEIGHT
protected java.lang.Object DIST
protected java.lang.Object ENTRY
protected AdaptablePriorityQueue<java.lang.Integer,Vertex<V>> Q
public void execute(Graph<V,E> g, Vertex<V> s, java.lang.Object w)
g
- Input graphs
- Source vertexw
- Weight decoration objectpublic int getDist(Vertex<V> u)
execute
has been called.
//begin#fragment executeu
- Start vertex for the shortest path tree