Class MaxFlow
java.lang.Object
org.episteme.core.mathematics.discrete.graph.flow.MaxFlow
Ford-Fulkerson algorithm for maximum flow.
Finds maximum flow from source to sink in flow network. Uses DFS to find augmenting paths. O(E * max_flow) complexity.
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <V> RealedmondsKarp(WeightedGraph<V, Real> graph, V source, V sink) Edmonds-Karp algorithm (Ford-Fulkerson with BFS).static <V> RealfordFulkerson(WeightedGraph<V, Real> graph, V source, V sink) Computes maximum flow using Ford-Fulkerson with DFS.
-
Constructor Details
-
MaxFlow
public MaxFlow()
-
-
Method Details
-
fordFulkerson
Computes maximum flow using Ford-Fulkerson with DFS.- Type Parameters:
V- the type of vertices- Parameters:
graph- flow network (must be a WeightedGraph with Real weights)source- source vertexsink- sink vertex- Returns:
- maximum flow value
-
edmondsKarp
Edmonds-Karp algorithm (Ford-Fulkerson with BFS).O(VE²) complexity - polynomial time. Guaranteed to terminate for irrational capacities.
-