gishur.graph.algorithms
Class DijkstraAlgo
java.lang.Object
|
+--gishur.core.algorithms.Algorithm
|
+--gishur.graph.algorithms.DijkstraAlgo
- public class DijkstraAlgo
- extends Algorithm
An gishur.core.algorithm.Algorithm class to perform the
Single Source Shortest Path algorithm on an arbitrary Graph.
The purpose of Single Source Shortest Path is ...
The Dijkstra algorithm works both on directed and on undirected Graphs.
Preconditions:
1. The cost af each edge must be >= 0!!
2. There may not be any negative cost cycles in the Graph
(folgt direkt aus 1.!)
- Version:
- 1.0
- Author:
- Simon Weidmann
|
Constructor Summary |
DijkstraAlgo(Graph g,
java.lang.String cost)
|
DijkstraAlgo(Node n,
Graph g,
java.lang.String cost,
boolean pred)
Constructor creating a Dijkstra-object which can perform
the single sourse shortest path algorithm on the given Graph G with the Node
s as source. |
|
Method Summary |
void |
execute()
|
void |
execute(Node s)
Calls #execute(SimpleNode,Tracer) without tracing algorithm
execution. |
void |
execute(Node s,
Tracer tracer)
Method performing the Dijkstra Algorithm on the Graph
... algo beschreiben |
| Methods inherited from class gishur.core.algorithms.Algorithm |
execute,
execute,
execute,
execute,
execute,
execute,
execute,
getMethod,
getParameter,
getParameters,
getReturnValue,
setMethod,
setParameter,
setParameters |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
DijkstraAlgo
public DijkstraAlgo(Node n,
Graph g,
java.lang.String cost,
boolean pred)
- Constructor creating a
Dijkstra-object which can perform
the single sourse shortest path algorithm on the given Graph G with the Node
s as source.
DijkstraAlgo
public DijkstraAlgo(Graph g,
java.lang.String cost)
execute
public void execute(Node s,
Tracer tracer)
- Method performing the Dijkstra Algorithm on the
Graph
... algo beschreiben
- Parameters:
s - source Node for which Dijkstra calculates the
shortest paths to all other nodestracer - a Tracer to record the steps of Dijkstra
execute
public void execute(Node s)
- Calls
#execute(SimpleNode,Tracer) without tracing algorithm
execution.
- Parameters:
s - the source Node from which the shortest path algorithm should start- See Also:
#execute(SimpleNode, Tracer)
execute
public void execute()
- Overrides:
- execute in class Algorithm