mascoptDev.algos.digraph
Class LongestPathDAGCost

java.lang.Object
  |
  +--mascoptDev.algos.digraph.LongestPathDAG
        |
        +--mascoptDev.algos.digraph.LongestPathDAGCost

public class LongestPathDAGCost
extends LongestPathDAG

Provides algorithm of Bellman to find distance from a node and the paths corresponding to this node. After constructing the Bellman object with a graph and the source, two steps are necessary to obtain shortest paths or distances. launch run and choose a destination where you want shortest chain, then launch getChain(destination). The distance on vertex are read with getValue with the parameter COST_LONGEST_PATH. You can change this string to another string to read another value. Note that all values on edges must be stored as string.


Field Summary
 
Fields inherited from class mascoptDev.algos.digraph.LongestPathDAG
CAPACITY_STRING_VALUE, COST_LONGEST_PATH, FATHER, FATHER_LEVEL, LEVEL_VERTEX
 
Constructor Summary
LongestPathDAGCost(DiGraph g, VertexSet w, Arc r, Vector c)
          Constructor.
LongestPathDAGCost(DiGraph g, VertexSet w, Vector c)
          Constructor.
 
Method Summary
 Double getCost(Arc a)
           
 void setAllCost(Vector c)
           
 
Methods inherited from class mascoptDev.algos.digraph.LongestPathDAG
getChain, run
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LongestPathDAGCost

public LongestPathDAGCost(DiGraph g,
                          VertexSet w,
                          Arc r,
                          Vector c)
Constructor.

Parameters:
w - VertexSet representing the vertex which belong to the DAG.
r - Arc representing the source and the destination of the longest path.
c - Vector representing thes cost on each cable, the index correspond to the String value INDEX on arc.

LongestPathDAGCost

public LongestPathDAGCost(DiGraph g,
                          VertexSet w,
                          Vector c)
Constructor.

Parameters:
w - VertexSet representing the vertex which belong to the DAG.
c - Vector representing thes cost on each cable, the index correspond to the String value INDEX on arc.
Method Detail

getCost

public Double getCost(Arc a)
Overrides:
getCost in class LongestPathDAG

setAllCost

public void setAllCost(Vector c)