|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--mascoptLib.algos.digraph.MinCut
Provides an algorithm to compute the maximum st-flow and so minimum st-cut of a simple directed graph The algorithm used to compute the s-t flow max is Edmonds-Karp algorithm. The name of the capacities is "capacity" but can be change (CAPACITY="name_given") It is necessary to define the value of the variable INFINITY (which equals 999999) if some capacity is greater than the default value. The void "run" compute the max flow and must always be done to obtain the results. Entries : a digraph, two vertices s and t. Results : vertexSetCutMin() returns the set of vertices which give the minimal cut arcSetCutMin() returns the set of arcs which belong to the minimal cut minCutValue() returns the value of the minimal cut
Field Summary | |
String |
CAPACITY
The constant to read the capacity on edges. |
double |
INFINITY
The constant for infinity. |
Constructor Summary | |
MinCut(mascoptLib.graphs.DiGraph g,
mascoptLib.graphs.Vertex s,
mascoptLib.graphs.Vertex t)
Constructor for the min cut. |
Method Summary | |
mascoptLib.graphs.ArcSet |
arcSetCutMin()
Returns the set of arcs of the min cut. |
HashMap |
maxFlow()
Returns the hashmap of the max flow. |
double |
minCutValue()
Returns the value of the min cut. |
void |
run()
Run the algorithm. |
mascoptLib.graphs.VertexSet |
vertexSetCutMin()
Returns the set of vertices of the min cut. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public double INFINITY
public String CAPACITY
Constructor Detail |
public MinCut(mascoptLib.graphs.DiGraph g, mascoptLib.graphs.Vertex s, mascoptLib.graphs.Vertex t)
g
- the graph to considers
- the first vertext
- the second vertexMethod Detail |
public void run()
public mascoptLib.graphs.VertexSet vertexSetCutMin()
public mascoptLib.graphs.ArcSet arcSetCutMin()
public double minCutValue()
public HashMap maxFlow()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |