graphlab.library.algorithms.shortestpath
Class Dijkstra<VertexType extends BaseVertex,EdgeType extends BaseEdge<VertexType>>
java.lang.Object
graphlab.library.algorithms.Algorithm
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
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Dijkstra
public Dijkstra()
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