|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--mascoptDev.algos.digraph.LongestPathDAG
Provides an algorithm which finds the longest distance in a DAG, ie in a DiGraph without cycle and with one source and one well. After constructing the object with a graph, a vertexSet and Arc two steps are necessary to obtain longest path. launch run then launch getChain. 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. |
String |
LEVEL_VERTEX
String which identify the value to consider the level of vertex in the DAG on vertex. |
| Constructor Summary | |
LongestPathDAG(DiGraph g,
VertexSet w)
Constructor. |
|
LongestPathDAG(DiGraph g,
VertexSet w,
Arc r)
Constructor. |
|
LongestPathDAG(DiGraph g,
VertexSet w,
Arc r,
String cost)
Constructor. |
|
| Method Summary | |
DiPath |
getChain()
Returns the chain from the head of request to the tail of request. |
Double |
getCost(Arc a)
|
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 LEVEL_VERTEX
public String CAPACITY_STRING_VALUE
| Constructor Detail |
public LongestPathDAG(DiGraph g,
VertexSet w,
Arc r)
w - VertexSet
representing the vertex which belong to the DAG.r - Arc
representing the the source and the destination of the longest path.
public LongestPathDAG(DiGraph g,
VertexSet w,
Arc r,
String cost)
w - VertexSet
representing the vertex which belong to the DAG.cost - String
representing the string value of the cost.r - Arc
representing the the source and the destination of the longest path.
public LongestPathDAG(DiGraph g,
VertexSet w)
w - VertexSet
representing the vertex which belong to the DAG.| Method Detail |
public Double getCost(Arc a)
public void run()
public DiPath getChain()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||