Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Ford-Fulkerson method Ford-Fulkerson(G) f = 0 while( 9 simple path p from s to t in G f ) f := f + f p output f Runs in time O(|f max | |E|) where f.

Similar presentations


Presentation on theme: "1 Ford-Fulkerson method Ford-Fulkerson(G) f = 0 while( 9 simple path p from s to t in G f ) f := f + f p output f Runs in time O(|f max | |E|) where f."— Presentation transcript:

1 1 Ford-Fulkerson method Ford-Fulkerson(G) f = 0 while( 9 simple path p from s to t in G f ) f := f + f p output f Runs in time O(|f max | |E|) where f max is the maximum flow found.

2 2 Edmonds-Karp Edmonds-Karp: Implement Ford-Fulkerson by always choosing the shortest possible augmenting path, i.e., the one with fewest possible edges. Edmonds-Karp can be implemented to run in time O(|V| |E| 2 ).

3 3 Maximum Matching Suppose we use the max flow formulation formulation of the maximum matching problem and solve the resulting flow instance using Edmonds-Karp. How fast an algorithm do we get?

4 4 Maximum Matching Answer 1: O(|V| |E| 2 ). Answer 2: O(|E| |f|) = O(|V| |E|). Morale: Exponential time/polynomial time distinction removes a lot of information.

5 5 How do I get my (very big) max flow instance solved? Edmonds-Karp is not the most efficient known algorithm. Preflow-Push algorithms are better, both theoretically and in practice. Should I implement such algorithms myself?

6 6 Maximum Cardinality Matching Max Flow Min Cost Flow Alternating Path Algorithm Linear Programs Reduction Ford-Fulkerson, Edmonds-Karp Augmenting cycle algorithm Simplex Algorithm, Interior point alg. Algorithm Increasing generality Decreasing efficiency Algorithm Reduction Algorithm Mixed Int. Lin. Prog. Branch and Bound, Branch and Cut

7 7 Standard state-of-the-art software ILOG CPLEX ( www.ilog.com ) www.ilog.com X-press MP ( www.dashoptimization.com ) www.dashoptimization.com

8 8 The Min Cost Flow Problem

9 9 The Min Cost Flow problem We want to impose lower bounds as well as capacities on a given arc. Also, arcs should have costs. Rather than maximize the value (i.e. amount) of the flow through the network we want to minimize the cost of the flow.

10 10 Flow Networks with Costs Flow networks with costs are the problem instances of the min cost flow problem. A flow network with costs is given by 1) a directed graph G = (V,E) 2) capacities c: E ! R. 3) balances b: V ! R. 4) costs k: V £ V ! R. k(u,v) = -k(u,v). Convention: c(u,v)=0 for (u,v) not in E.

11 11 Feasible Flows Given a flow network with costs, a feasible flow is a feasible solution to the min cost flow problem. A feasible flow is a map f: V £ V ! R satisfying capacity constraints: 8 (u,v): f(u,v) · c(u,v). Skew symmetry: 8 (u,v): f(u,v) = – f(v,u). Balance Constraints: 8 u 2 V:  v 2 V f(u,v) =b(u)

12 12 Cost of Feasible Flows The cost of a feasible flow f is cost(f)= ½  (u,v) 2 V £ V k(u,v) f(u,v) The Min Cost Flow Problem: Given a flow network with costs, find the feasible flow f that minimizes cost(f).

13 13 Max Flow Problem vs. Min Cost Flow Problem Max Flow Problem Problem Instance: c: E ! R +. Special vertices s,t. Feasible solution: 8 u 2 V–{s,t}:  v 2 V f(u,v) = 0 Objective: Maximize |f(s,V)| Min Cost Flow Problem Problem Instance: c: E ! R. Maps b,k. Feasible solution: 8 u 2 V:  v 2 V f(u,v) = b(u) Objective: Minimize cost(f)

14 14 Negative Capacities c(u,v) < 0. Let l(v,u) = – c(u,v). f(u,v) · c(u,v) iff f(v,u) ¸ – c(u,v) = l(v,u). l(v,u) is a lower bound on the net flow from v to u for any feasible flow.

15 15 Balance Constraints Vertices u with b(u)>0 are producing flow. Vertices u with b(u)<0 are consuming flow Vertices u with b(u)=0 are shipping flow.

16 16. Can we solve the max-flow problem using software for the min-cost flow problem? Unknown Balance!!

17 17 Capacity 29, Cost -1 All other costs 0, all balances 0. Capacity 29, Cost 0

18 18 Circulation networks Flow networks with b ´ 0 are called circulation networks. A feasible flow in a circulation network is called a feasible circulation.

19 19 Unknown Balances!!

20 20

21 21 Integrality theorem for min cost flow If a flow network with costs has capacities and balances integer valued and a feasible flow in the network exists, then there is a minimum cost feasible flow which is integer valued. (shown later by “type checking”)

22 22 Minimum Weight Perfect Matching Given integer weight matrix (w(i,j)), 1 · i,j · n. Find a permutation  on {1,..,n} minimizing  i w(i,  (i)).

23 23 Tanker Scheduling Problem

24 24 Capacity 1, Lower Bound 1, Cost 0 Capacity 1, Cost 0 Capacity 4, Cost 1 All balances 0 Capacity 1, Cost 0

25 25 Hopping Airplane Problem Airplane must travel from city 1, to city 2, to city 3,.., to city n. At most p passengers can be carried at any time. b ij passengers want to go from city i to city j and will pay f ij for the trip. How many passengers should be picked up at each city in order to maximize profits?

26 26


Download ppt "1 Ford-Fulkerson method Ford-Fulkerson(G) f = 0 while( 9 simple path p from s to t in G f ) f := f + f p output f Runs in time O(|f max | |E|) where f."

Similar presentations


Ads by Google