Class EdmondKarpMaxFlow<T, W>
An Edmond Karp max flow implementation on weighted directed graph using
adjacency list representation of graph and residual graph.
Inheritance
EdmondKarpMaxFlow<T, W>
Assembly: Advanced.Algorithms.dll
Syntax
public class EdmondKarpMaxFlow<T, W> : object where W : IComparable
Type Parameters
Constructors
EdmondKarpMaxFlow(IFlowOperators<W>)
Declaration
public EdmondKarpMaxFlow(IFlowOperators<W> operator)
Parameters
Methods
ComputeMaxFlow(IDiGraph<T>, T, T)
Compute max flow by searching a path
and then augmenting the residual graph until
no more path exists in residual graph with possible flow.
Declaration
public W ComputeMaxFlow(IDiGraph<T> graph, T source, T sink)
Parameters
Type |
Name |
Description |
IDiGraph<T> |
graph |
|
T |
source |
|
T |
sink |
|
Returns
computeMaxFlowAndReturnResidualGraph(IDiGraph<T>, T, T)
Compute max flow by searching a path
and then augmenting the residual graph until
no more path exists in residual graph with possible flow.
Declaration
public WeightedDiGraph<T, W> computeMaxFlowAndReturnResidualGraph(IDiGraph<T> graph, T source, T sink)
Parameters
Type |
Name |
Description |
IDiGraph<T> |
graph |
|
T |
source |
|
T |
sink |
|
Returns