advanced algorithms
play

ADVANCED ALGORITHMS Lecture 12: Flows/cuts 1 ANNOUNCEMENTS HW 1 - PowerPoint PPT Presentation

ADVANCED ALGORITHMS Lecture 12: Flows/cuts 1 ANNOUNCEMENTS HW 1 grades out, see solutions/hints HW 2 due TOMORROW , 11:59 PM 2 TODAYS PLAN Flows and cuts in graphs Some applications 3 MIN S-T CUT Problem:


  1. ADVANCED ALGORITHMS Lecture 12: Flows/cuts � 1

  2. ANNOUNCEMENTS ➤ HW 1 grades out, see solutions/hints ➤ HW 2 due TOMORROW , 11:59 PM � 2

  3. TODAY’S PLAN ➤ Flows and cuts in graphs ➤ Some applications � 3

  4. MIN S-T CUT ➤ Problem: given a directed graph with edge weights, find a small set of (weighted) edges to “cut” so that there is no longer a directed path from s to t . ➤ Note: cut allowed to leave paths from t to s � 4

  5. MAXIMUM FLOW ➤ Problem: given a directed graph with capacities c e on the edges, and a source s , sink t , send as much flow as possible without violating capacities. ➤ Flow defined intuitively — using a collection of paths ➤ Motivation: max throughput in network routing ➤ (Many others — will see today) � 5

  6. EXAMPLE 20 10 20 10 20 � 6

  7. MAXIMUM FLOW IS ALWAYS <= MIN CUT ➤ Saw last class: ➤ Take any flow — collection of paths P , flow on path p defined as f p ➤ Take any cut — set of edges whose removal leaves no s —> t path ➤ Obs: every path in our flow f uses some edge of cut ➤ Imagine we go through edges in cut, for each e , remove all paths that goes through e ➤ Flow removed each time <= weight of edge � 7

  8. MAXIMUM FLOW VS MIN CUT � 8

  9. ALGORITHMS FOR FLOW — ADDING PATHS ITERATIVELY Algorithm: 20 10 Find some s-t path, assign flow - = min edge capacity 20 Decrease capacities - 10 20 Repeat - � 9

  10. ITERATIVE ADDITION — BAD ORDER 20 10 20 10 20 � 10

  11. FORD-FULKERSON ALGORITHM ➤ Main idea: can we repair bad choices? (a la backtracking ) � 11

  12. RESIDUAL GRAPH 20 10 20 20 20 10 20 20 � 12

  13. RESIDUAL GRAPH ➤ Idea: build network that allows “cancelling” some of current flow ➤ Formally, given flow f , add reverse edges of weight = total flow on edge ‘ e ’, reduce capacity of forward edge Key insight: A flow f’ in the residual graph leads to a valid flow f + f’ in G - � 13

  14. FORD-FULKERSON ALGORITHM ➤ Main idea: can we repair bad choices? (a la backtracking ) ➤ Algorithm: (initialize f = 0) ➤ Build residual G f ➤ Find “ augmenting path” f’ in G f ; set f = f + f’ ➤ Repeat � 14

  15. CORRECTNESS ➤ High level idea: if flow is not optimal, there is always a path of min capacity >0 in the residual. ➤ T wo ways of proof. First via looking at optimal flow. (Tends to get messy) � 15

  16. CORRECTNESS ➤ High level idea: if flow is not optimal, there is always a path of min capacity >0 in the residual. ➤ Another proof: if there is no augmenting path, then there exists cut in G of same value as current flow � 16

  17. CORRECTNESS � 17

  18. MAX FLOW - MIN CUT THEOREM � 18

  19. RECAP � 19

  20. APPLICATIONS — CONNECTIVITY IN NETWORKS � 20

  21. APPLICATIONS — IMAGE SEGMENTATION � 21

  22. APPLICATIONS — MAX MATCHING � 22

  23. APPLICATIONS — BASEBALL ELIMINATION � 23

Recommend


More recommend