|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--mascoptDev.algos.digraph.LongestPath
Provides an algorithm which finds the longest distance from a node toward all nodes, and the paths corresponding to this node. This algorithm is implemented like Bellman algorithm. After constructing the object with a graph and the source, two steps are necessary to obtain longest paths or distances. launch run and choose a destination where you want longest 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 | |
String |
CAPACITY_STRING_VALUE
String which is read on edges for the capacity. |
String |
COST_LONGEST_PATH
String which identify the value to consider as the distance on arc. |
String |
FATHER
String which identify the value to consider the father of the destination on arc . |
String |
FATHER_LEVEL
String which identify the value to consider the level of father on vertex. |
Constructor Summary | |
LongestPath(DiGraph g,
Vertex s)
Constructor. |
|
LongestPath(DiGraph g,
Vertex s,
String cost)
Constructor. |
Method Summary | |
DiPath |
getChain(Vertex dest)
Returns the chain from source to the vertex dest. |
void |
run()
Computes the longest distances from vertex source to all other vertex of graph. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public String COST_LONGEST_PATH
public String FATHER
public String FATHER_LEVEL
public String CAPACITY_STRING_VALUE
Constructor Detail |
public LongestPath(DiGraph g, Vertex s)
s
- Vertex
representing the source of chains.public LongestPath(DiGraph g, Vertex s, String cost)
s
- Vertex
representing the source of chains.cost
- String
representing the string value of the cost.Method Detail |
public void run()
public DiPath getChain(Vertex dest)
dest
- Vertex
representing the destination of chain.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |