Given a directed network with n vertices (1..n), m directed edges given as an m-by-4 matrix edges = [u, v, cap, cost], a source s, and a sink t (s ~= t):
Find:
1. max_flow: the maximum possible flow from s to t.
2. min_cost: the minimum total cost among all maximum flows from s to t.
3. edge_flows: an m-by-1 vector where edge_flows(i) is the flow sent along edges(i, :) achieving (max_flow, min_cost).
Constraints:
- Capacities cap >= 0 are non-negative integers; costs are integers (possibly negative, with no negative-cost cycles reachable from s).
- Parallel and anti-parallel edges may exist.
- n <= 250, m <= 1500.
Solution Stats
Solution Comments
Show comments
Loading...
Problem Recent Solvers1
Suggested Problems
More from this Author31
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!