de.upb.swtpra05.group03.shuttle
Class Dijkstra

java.lang.Object
  extended byde.upb.swtpra05.group03.shuttle.Dijkstra

public class Dijkstra
extends java.lang.Object

Class which implements the dijkstra algorithm

Version:
$Revision: 1.3 $

Field Summary
(package private) static java.util.logging.Logger log
          No comment provided by developer, please add a comment to improve documentation.
private  java.util.Collection nodes
          The nodes to process the dijkstra algorithm on as DijkstraNodes
private  java.util.Vector orderedNodes
          Collection which holds the nodes in order of their stretch value
 
Constructor Summary
protected Dijkstra(java.util.Collection nds)
          Constructor for class Dijkstra
 
Method Summary
protected  java.util.HashMap getAllShortestPaths()
          Returns a collection which contains a spanning tree for any and routed by any node of nodes which represent the shorest paths in the graph
protected  java.util.Vector getShortestPaths(DijkstraNode start, DijkstraEdge dontUse)
          Gets a spanning tree for the start node which represent the shortest paths from start to any other node
private  void relax(DijkstraNode u, DijkstraNode v, long w, int indexOfPredecessor)
          The relax method of the dijkstra algorithm
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

static final java.util.logging.Logger log
No comment provided by developer, please add a comment to improve documentation.


nodes

private final java.util.Collection nodes
The nodes to process the dijkstra algorithm on as DijkstraNodes


orderedNodes

private final java.util.Vector orderedNodes
Collection which holds the nodes in order of their stretch value

Constructor Detail

Dijkstra

protected Dijkstra(java.util.Collection nds)
Constructor for class Dijkstra

Parameters:
nds - The nodes to process as DijkstraNodes
Method Detail

getAllShortestPaths

protected java.util.HashMap getAllShortestPaths()
Returns a collection which contains a spanning tree for any and routed by any node of nodes which represent the shorest paths in the graph

Returns:
a HashMap with Mappings from all Nodes to Vectors with all targetNodes

getShortestPaths

protected java.util.Vector getShortestPaths(DijkstraNode start,
                                            DijkstraEdge dontUse)
Gets a spanning tree for the start node which represent the shortest paths from start to any other node

Parameters:
start - The start node
dontUse - Edges the algorithm shouldn't use
Returns:
a Vector with all targetNodes

relax

private void relax(DijkstraNode u,
                   DijkstraNode v,
                   long w,
                   int indexOfPredecessor)
The relax method of the dijkstra algorithm

Parameters:
u - The source node from which to relax
v - The destination node to relax
w - The edge weight from u to v
indexOfPredecessor - Description of the Parameter