1 / 26

Ford-Fulkerson method

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. Edmonds-Karp.

farhani
Télécharger la présentation

Ford-Fulkerson method

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

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

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

  8. The Min Cost Flow Problem

  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. Flow Networks with Costs • Flow networkswith 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) capacitiesc: E!R. 3) balances b: V!R. 4) costsk: V£V !R. k(u,v) = -k(u,v). • Convention: c(u,v)=0 for (u,v) not in E.

  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: 8u2V: v2Vf(u,v) =b(u)

  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. Max Flow Problem vs. Min Cost Flow Problem Max Flow Problem Problem Instance: c: E!R+. Special vertices s,t. Feasible solution: 8u2V–{s,t}: v2Vf(u,v) = 0 Objective: Maximize |f(s,V)| Min Cost Flow Problem Problem Instance: c: E!R. Maps b,k. Feasible solution: 8u2V: v2Vf(u,v) = b(u) Objective: Minimize cost(f)

  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. 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. . Unknown Balance!! Unknown Balance!! Can we solve the max-flow problem using software for the min-cost flow problem?

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

  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. Unknown Balances!! Unknown Balances!!

  20. 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”)

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

  22. Tanker Scheduling Problem

  23. All balances 0 Capacity 4, Cost 1 Capacity 1, Cost 0 Capacity 1, Cost 0 Capacity 1, Lower Bound 1, Cost 0

  24. 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. • bijpassengers want to go from city i to city j and will pay fij for the trip. • How many passengers should be picked up at each city in order to maximize profits?

More Related