org.apache.commons.graph.algorithm.path
Class AllPairsShortestPath

java.lang.Object
  extended byorg.apache.commons.graph.algorithm.path.AllPairsShortestPath

public class AllPairsShortestPath
extends java.lang.Object

Description of the Class


Nested Class Summary
 class AllPairsShortestPath.EdgeList
          Description of the Class
 class AllPairsShortestPath.WPath
          Description of the Class
 
Field Summary
private  double[][] cost
           
private  DirectedGraph graph
           
private  int[][] pred
           
private  Vertex[] vArray
           
private  java.util.Map vertexIndex
           
 
Constructor Summary
AllPairsShortestPath(DirectedGraph graph)
          Constructor for the AllPairsShortestPath object
 
Method Summary
private  void compute(DirectedGraph graph, Vertex[] vArray)
          Description of the Method
 WeightedPath getShortestPath(Vertex start, Vertex end)
          Gets the shortestPath attribute of the AllPairsShortestPath object
 boolean hasPath(Vertex start, Vertex end)
          Determines if a path exists or not.
private  int index(Vertex v)
          Description of the Method
private  void initIndex(Vertex[] vArray)
          Description of the Method
 void update(DirectedGraph graph)
          Description of the Method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pred

private int[][] pred

cost

private double[][] cost

vArray

private Vertex[] vArray

graph

private DirectedGraph graph

vertexIndex

private java.util.Map vertexIndex
Constructor Detail

AllPairsShortestPath

public AllPairsShortestPath(DirectedGraph graph)
                     throws NegativeCycleException
Constructor for the AllPairsShortestPath object

Parameters:
graph -
Throws:
NegativeCycleException
Method Detail

initIndex

private void initIndex(Vertex[] vArray)
Description of the Method


update

public void update(DirectedGraph graph)
Description of the Method


index

private int index(Vertex v)
Description of the Method


compute

private void compute(DirectedGraph graph,
                     Vertex[] vArray)
              throws NegativeCycleException
Description of the Method

Throws:
NegativeCycleException

getShortestPath

public WeightedPath getShortestPath(Vertex start,
                                    Vertex end)
                             throws GraphException
Gets the shortestPath attribute of the AllPairsShortestPath object

Throws:
GraphException

hasPath

public boolean hasPath(Vertex start,
                       Vertex end)
Determines if a path exists or not.