|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbcds.phison.ra.RoutingAlgBase<V,E>
bcds.phison.alg.MaxFlowEK<V,E>
public class MaxFlowEK<V,E>
Implements the Edmonds-Karp algorithm to find the max-flow
between a source-destination pair.
This is loosely based on the Perl code for Graph::MaxFlow.
The running time of Edmonds-Karp algorithm is in O(V E^2).
Upon calling run(V, V)
, the following information can be
retrieved:
RoutingAlg
interface.
The paths are found taking into account the residual capacity of each link, as reported by the TED object. Thus, links with zero residual capacity are (logically) removed from the topology.
Constructor Summary | |
---|---|
MaxFlowEK(TED<V,E> ted)
Creates a new instance and saves the ted parameter for
future use. |
Method Summary | |
---|---|
void |
dumpState()
Prints to stdout some internal information. |
Path<V,E> |
getPath(int n)
Returns the n -th path (or subflow) that supports the
previously computed max-flow, or null if n is out
of range (there are
not that many paths). |
int |
getPathCap(int n)
Returns the capacity with which the n -th path contributes
to the total max-flow, or 0 (zero) if n is out of range
(there are not that many paths). |
int |
run(V src,
V dest)
Returns the (total) max-flow between src and dest . |
Methods inherited from class bcds.phison.ra.RoutingAlgBase |
---|
buildPathFromParentNodes, commitBackupPath, commitWorkingPath, getBackupPath, getCost, getEnviron, getEnvParams, getName, getTED, getWorkingPath, offersProtection, setBackupPath, setRequest, setup, setWorkingPath, topologyHasChanged, uncommitBackupPath, uncommitWorkingPath |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MaxFlowEK(TED<V,E> ted)
ted
parameter for
future use.
Method Detail |
---|
public Path<V,E> getPath(int n)
n
-th path (or subflow) that supports the
previously computed max-flow, or null if n is out
of range (there are
not that many paths).
Since a breadth-first search is used by run,
the length of the path returned by
getPath(k) is always <= getPath(k+1), where
the length is measured in number of hops.
public int getPathCap(int n)
n
-th path contributes
to the total max-flow, or 0 (zero) if n is out of range
(there are not that many paths).
public int run(V src, V dest)
src
and dest
.
The result is zero if src and dest are the same
or if they are disconnected.
public void dumpState()
dumpState
in class RoutingAlgBase<V,E>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |