GraphLab Project

graphlab.library.algorithms.shortestpath
Class Dijkstra<VertexType extends BaseVertex,EdgeType extends BaseEdge<VertexType>>

java.lang.Object
  extended by graphlab.library.algorithms.Algorithm
      extended by graphlab.library.algorithms.shortestpath.Dijkstra<VertexType,EdgeType>
All Implemented Interfaces:
AlgorithmInterface, AutomatedAlgorithm
Direct Known Subclasses:
DijkstraAnim

public class Dijkstra<VertexType extends BaseVertex,EdgeType extends BaseEdge<VertexType>>
extends Algorithm
implements AutomatedAlgorithm

This method finds the shortest path from a vertex to all vertices of a graph. [Should be tested]

Author:
Omid Aladini

Constructor Summary
Dijkstra()
           
 
Method Summary
 void doAlgorithm()
           
 java.util.Vector<VertexType> getShortestPath(BaseGraph<VertexType,EdgeType> graph, VertexType vertex)
          This method finds a reference array using Dijkstra algorithm from which, one can find the shortest paths of all vertices of a graph from an arbitrary given vertex.
 
Methods inherited from class graphlab.library.algorithms.Algorithm
acceptEventDispatcher, dispatchEvent, getDispatcher
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface graphlab.library.algorithms.AlgorithmInterface
acceptEventDispatcher
 

Constructor Detail

Dijkstra

public Dijkstra()
Method Detail

getShortestPath

public java.util.Vector<VertexType> getShortestPath(BaseGraph<VertexType,EdgeType> graph,
                                                    VertexType vertex)
                                                                throws InvalidVertexException
This method finds a reference array using Dijkstra algorithm from which, one can find the shortest paths of all vertices of a graph from an arbitrary given vertex.

Parameters:
graph - Graph object to be searched.
vertex - The source of the paths.
Returns:
Vector of vertices that for each i, it has a reference to the vertex, before the vertex with ID number i in the shortest path from "vertex" to i, or null if there is no such vertex.
Throws:
InvalidVertexException - if the supplied vertices are invalid.

doAlgorithm

public void doAlgorithm()
Specified by:
doAlgorithm in interface AutomatedAlgorithm

GraphLab Project