Click or drag to resize
FordFulkerson Class

The FordFulkerson class represents a data type for computing a Maximum st-flow and Minimum st-cut in a flow network.

This implementation uses the Ford-Fulkerson algorithm with the Shortest augmenting path heuristic. The constructor takes time proportional to E V (E + V) in the worst case and extra space (not including the network) proportional to V, where V is the number of vertices and E is the number of edges. In practice, the algorithm will run much faster. Afterwards, the inCut() and value() methods take constant time.

If the capacities and initial flow values are all integers, then this implementation guarantees to compute an integer-valued maximum flow. If the capacities and floating-point numbers, then floating-point roundoff error can accumulate.

Inheritance Hierarchy
SystemObject
  Algs4NetFordFulkerson

Namespace: Algs4Net
Assembly: Algs4Net (in Algs4Net.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public class FordFulkerson

The FordFulkerson type exposes the following members.

Constructors
  NameDescription
Public methodFordFulkerson
Compute a maximum flow and minimum cut in the network G from vertex s to vertex t.
Top
Properties
  NameDescription
Public propertyValue
Returns the value of the maximum flow.
Top
Methods
  NameDescription
Public methodInCut
Returns true if the specified vertex is on the s side of the mincut.
Public methodStatic memberMainTest
Demo test the FordFulkerson data type.
Top
Remarks

For additional documentation, see Section 6.4 of Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.

This class is a C# port from the original Java class FordFulkerson implementation by the respective authors.

See Also