network flow iv applications ii
play

Network Flow IV - Applications II Lecture 15 October 17, 2013 - PowerPoint PPT Presentation

CS 573: Algorithms, Fall 2013 Network Flow IV - Applications II Lecture 15 October 17, 2013 Sariel (UIUC) CS573 1 Fall 2013 1 / 50 Airline Scheduling . Problem . Given information about flights that an airline needs to provide,


  1. CS 573: Algorithms, Fall 2013 Network Flow IV - Applications II Lecture 15 October 17, 2013 Sariel (UIUC) CS573 1 Fall 2013 1 / 50

  2. Airline Scheduling . Problem . Given information about flights that an airline needs to provide, generate a profitable schedule. . . . Input: detailed information about “legs” of flight. 1 . . F : set of flights by 2 . . Purpose: find minimum # airplanes needed. 3 Sariel (UIUC) CS573 2 Fall 2013 2 / 50

  3. Airline Scheduling . Problem . Given information about flights that an airline needs to provide, generate a profitable schedule. . . . Input: detailed information about “legs” of flight. 1 . . F : set of flights by 2 . . Purpose: find minimum # airplanes needed. 3 Sariel (UIUC) CS573 2 Fall 2013 2 / 50

  4. Example (i) a set F of flights that have to be served, and (ii) the corresponding graph G representing these flights. 1: Boston (depart 6 A.M.) - Washing- ton DC (arrive 7 A.M,). 2: Urbana (depart 7 A.M.) - Cham- 2 paign (arrive 8 A.M.) 1 3: Washington (depart 8 A.M.) - Los 3 Angeles (arrive 11 A.M.) 4: Urbana (depart 11 A.M.) - San Francisco (arrive 2 P.M.) 6 4 5: San Francisco (depart 2:15 P.M.) - Seattle (arrive 3:15 P.M.) 5 6: Las Vegas (depart 5 P.M.) - Seattle (arrive 6 P.M.). (i) (ii) Sariel (UIUC) CS573 3 Fall 2013 3 / 50

  5. Flight scheduling... . . Use same airplane for two segments i and j : 1 (a) destination of i is the origin of the segment j , (b) there is enough time in between the two flights. . . Also, airplane can fly from dest( i ) to origin( j ) (assuming 2 time constraints are satisfied). . Example . As a concrete example, consider the flights: Boston (depart 6 A.M.) - Washington D.C. (arrive 7 A.M,). Washington (depart 8 A.M.) - Los Angeles (arrive 11 A.M.) Las Vegas (depart 5 P.M.) - Seattle (arrive 6 P.M.) This schedule can be served by a single airplane by adding the leg “Los Angeles (depart 12 noon)- Las Vegas (1 P,M.)” to this schedule. . Sariel (UIUC) CS573 4 Fall 2013 4 / 50

  6. Flight scheduling... . . Use same airplane for two segments i and j : 1 (a) destination of i is the origin of the segment j , (b) there is enough time in between the two flights. . . Also, airplane can fly from dest( i ) to origin( j ) (assuming 2 time constraints are satisfied). . Example . As a concrete example, consider the flights: Boston (depart 6 A.M.) - Washington D.C. (arrive 7 A.M,). Washington (depart 8 A.M.) - Los Angeles (arrive 11 A.M.) Las Vegas (depart 5 P.M.) - Seattle (arrive 6 P.M.) This schedule can be served by a single airplane by adding the leg “Los Angeles (depart 12 noon)- Las Vegas (1 P,M.)” to this schedule. . Sariel (UIUC) CS573 4 Fall 2013 4 / 50

  7. Modeling the problem . . model the feasibility constraints by a graph. 1 . . G : directed graph over flight legs. 2 . . For i and j (legs), ( i → j ) ∈ E ( G ) ⇐ ⇒ same airplane can 3 serve both i and j . . . G is acyclic. 4 . . Q: Can required legs can be served using only k airplanes? 5 Sariel (UIUC) CS573 5 Fall 2013 5 / 50

  8. Solution . . Reduction to computation of circulation. 1 . . Build graph H . 2 . . ∀ leg i , two new vertices u i , v i ∈ VH . 3 s : source vertex. t : sink vertex. . . Set demand at t to k , Demand at s to be − k . 4 . . Each flight must be served. New edge e i = ( u i → v i ) , for leg 5 i . Also ℓ ( e i ) = 1 and c ( e i ) = 1 . . . If same plane can so i and j (i.e., ( i → j ) ∈ E ( G ) ) then add 6 edge ( v i → u j ) with capacity 1 to H . . . Since any airplane can start the day with flight i : add an edge 7 ( s → u i ) with capacity 1 to H , ∀ i . . . Add edge ( v j → t ) with capacity 1 to G , ∀ j . 8 . . Overflow airplanes: “overflow” edge ( s → t ) with capacity k . 9 Let H denote the resulting graph. Sariel (UIUC) CS573 6 Fall 2013 6 / 50

  9. Example of resulting graph The resulting graph H for the instance of airline scheduling show before. k 1 , 1 u 1 v 1 1 , 1 u 2 v 2 1 , 1 u 3 v 3 − k k 1 , 1 s t u 4 v 4 2 1 , 1 u 5 v 5 1 3 1 , 1 u 6 v 6 6 4 5 Sariel (UIUC) CS573 7 Fall 2013 7 / 50

  10. Lemma . Lemma . ∃ way perform all flights of F ≤ k planes ⇐ ⇒ ∃ circulation in H . . . Proof. . . Given feasible solution → translate into valid circulation. 1 . . Given feasible circulation... 2 . . ... extract paths from flow. 3 . . ... every path is a plane. 4 . Sariel (UIUC) CS573 8 Fall 2013 8 / 50

  11. Lemma . Lemma . ∃ way perform all flights of F ≤ k planes ⇐ ⇒ ∃ circulation in H . . . Proof. . . Given feasible solution → translate into valid circulation. 1 . . Given feasible circulation... 2 . . ... extract paths from flow. 3 . . ... every path is a plane. 4 . Sariel (UIUC) CS573 8 Fall 2013 8 / 50

  12. Lemma . Lemma . ∃ way perform all flights of F ≤ k planes ⇐ ⇒ ∃ circulation in H . . . Proof. . . Given feasible solution → translate into valid circulation. 1 . . Given feasible circulation... 2 . . ... extract paths from flow. 3 . . ... every path is a plane. 4 . Sariel (UIUC) CS573 8 Fall 2013 8 / 50

  13. Lemma . Lemma . ∃ way perform all flights of F ≤ k planes ⇐ ⇒ ∃ circulation in H . . . Proof. . . Given feasible solution → translate into valid circulation. 1 . . Given feasible circulation... 2 . . ... extract paths from flow. 3 . . ... every path is a plane. 4 . Sariel (UIUC) CS573 8 Fall 2013 8 / 50

  14. Extensions and limitations . . a lot of other considerations: 1 (i) airplanes have to undergo long term maintenance treatments every once in awhile, (ii) one needs to allocate crew to these flights, (iii) schedule differ between days, and (iv) ultimately we interested in maximizing revenue. . . Network flow is used in practice, real world problems are 2 complicated, and network flow can capture only a few aspects. . . ... a good starting point. 3 Sariel (UIUC) CS573 9 Fall 2013 9 / 50

  15. Extensions and limitations . . a lot of other considerations: 1 (i) airplanes have to undergo long term maintenance treatments every once in awhile, (ii) one needs to allocate crew to these flights, (iii) schedule differ between days, and (iv) ultimately we interested in maximizing revenue. . . Network flow is used in practice, real world problems are 2 complicated, and network flow can capture only a few aspects. . . ... a good starting point. 3 Sariel (UIUC) CS573 9 Fall 2013 9 / 50

  16. Extensions and limitations . . a lot of other considerations: 1 (i) airplanes have to undergo long term maintenance treatments every once in awhile, (ii) one needs to allocate crew to these flights, (iii) schedule differ between days, and (iv) ultimately we interested in maximizing revenue. . . Network flow is used in practice, real world problems are 2 complicated, and network flow can capture only a few aspects. . . ... a good starting point. 3 Sariel (UIUC) CS573 9 Fall 2013 9 / 50

  17. Part I . Image Segmentation . Sariel (UIUC) CS573 10 Fall 2013 10 / 50

  18. Image Segmentation Input is an image. Partition image into background and foreground. (i) (ii) The (i) input image, and (ii) a possible segmentation of the image. Sariel (UIUC) CS573 11 Fall 2013 11 / 50

  19. What is the input... . . Input is a bitmap on a grid. 1 . . Every grid node represents a pixel 2 . . Convert grid into a directed graph G , 3 . . Input: 4 (i) N × N bitmap. G = ( V , E ) . (ii) ∀ pixel i : foreground value f i ≥ 0 . (iii) ∀ pixel i : background value b i . (iv) ∀ i , j adjacent: separation penalty p ij . (we assume that p ij = p ji ) Sariel (UIUC) CS573 12 Fall 2013 12 / 50

  20. What is the input... . . Input is a bitmap on a grid. 1 . . Every grid node represents a pixel 2 . . Convert grid into a directed graph G , 3 . . Input: 4 (i) N × N bitmap. G = ( V , E ) . (ii) ∀ pixel i : foreground value f i ≥ 0 . (iii) ∀ pixel i : background value b i . (iv) ∀ i , j adjacent: separation penalty p ij . (we assume that p ij = p ji ) Sariel (UIUC) CS573 12 Fall 2013 12 / 50

  21. What is the input... . . Input is a bitmap on a grid. 1 . . Every grid node represents a pixel 2 . . Convert grid into a directed graph G , 3 . . Input: 4 (i) N × N bitmap. G = ( V , E ) . (ii) ∀ pixel i : foreground value f i ≥ 0 . (iii) ∀ pixel i : background value b i . (iv) ∀ i , j adjacent: separation penalty p ij . (we assume that p ij = p ji ) Sariel (UIUC) CS573 12 Fall 2013 12 / 50

  22. Problem statement . Problem . Given input as above, partition V (the set of pixels) into two disjoint subsets F and B , such that ∑ ∑ ∑ q ( F , B ) = f i + b i − p ij . i ∈ F i ∈ B ( i , j ) ∈ E , | F ∩{ i , j }| =1 . is maximized. Rewrite q ( F , B ) as: ∑ ∑ ∑ q ( F , B ) = f i + b j − p ij i ∈ F j ∈ B ( i , j ) ∈ E , | F ∩{ i , j }| =1   ∑ ∑ ∑ ∑  . = ( f i + b i ) − f i + b j + p ij i ∈ v i ∈ B j ∈ F ( i , j ) ∈ E , | F ∩{ i , j }| =1 Sariel (UIUC) CS573 13 Fall 2013 13 / 50

Recommend


More recommend