SSF.OS.OSPFv2
Class Dijkstra

java.lang.Object
  |
  +--SSF.OS.OSPFv2.Dijkstra

public class Dijkstra
extends java.lang.Object

Dijkstra's shortest path algorithm. Most of the algorithm is taken from Introduction to Algorithms by Cormen, Leiserson and Rivest.


Constructor Summary
Dijkstra(java.util.Vector lsas, OSPF o, AreaData myArea)
          Construct a new instance of Dijkstra's algorithm.
 
Method Summary
 java.util.HashMap firstStage()
          Compute the intra-area routes by building the shortest path tree for the area this Dijkstra belongs to.
 java.util.HashMap getSPTree()
          Return the current shortest path tree.
 java.util.HashMap secondStage()
          Compute the intra-area routes to all networks within the area this Dijkstra belongs to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dijkstra

public Dijkstra(java.util.Vector lsas,
                OSPF o,
                AreaData myArea)
Construct a new instance of Dijkstra's algorithm. Build the vertices participating in calculation.

Parameters:
lsas - A Vector holding all LSAs stored in the LS Database.
o - A reference to the OSPF session this Dijkstra belogs to.
myArea - A reference to the area this Dijkstra belongs to.
Method Detail

firstStage

public java.util.HashMap firstStage()
Compute the intra-area routes by building the shortest path tree for the area this Dijkstra belongs to. All routing table entries whose destination type is "area border router" or "AS boundary router" are calculated here.

Returns:
A HashMap holding all new calculated area border and AS boundary router entries for the area this Dijkstra belongs to.

secondStage

public java.util.HashMap secondStage()
Compute the intra-area routes to all networks within the area this Dijkstra belongs to.

Returns:
A HashMap holding all network entries for the area this Dijkstra belongs to.

getSPTree

public java.util.HashMap getSPTree()
Return the current shortest path tree.

Returns:
HashMap representing the shortest path tree in form of String-Vertex mappings.