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

advanced algorithms
SMART_READER_LITE
LIVE PREVIEW

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:


slide-1
SLIDE 1

ADVANCED ALGORITHMS

Lecture 12: Flows/cuts

1

slide-2
SLIDE 2

ANNOUNCEMENTS

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

2

slide-3
SLIDE 3

TODAY’S PLAN

➤ Flows and cuts in graphs ➤ Some applications

3

slide-4
SLIDE 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

slide-5
SLIDE 5

MAXIMUM FLOW

5

➤ Problem: given a directed graph with capacities ce 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)

slide-6
SLIDE 6

EXAMPLE

6

20 20 20 10 10

slide-7
SLIDE 7

MAXIMUM FLOW IS ALWAYS <= MIN CUT

7

➤ Saw last class: ➤ Take any flow — collection of paths P, flow on path p defined as fp ➤ 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

slide-8
SLIDE 8

MAXIMUM FLOW VS MIN CUT

8

slide-9
SLIDE 9

ALGORITHMS FOR FLOW — ADDING PATHS ITERATIVELY

9

20 20 20 10 10 Algorithm:

  • Find some s-t path, assign flow

= min edge capacity

  • Decrease capacities
  • Repeat
slide-10
SLIDE 10

ITERATIVE ADDITION — BAD ORDER

10

20 20 20 10 10

slide-11
SLIDE 11

FORD-FULKERSON ALGORITHM

11

➤ Main idea: can we repair bad choices? (a la backtracking)

slide-12
SLIDE 12

RESIDUAL GRAPH

12

20 20 20 10 10 20 20 20

slide-13
SLIDE 13

RESIDUAL GRAPH

13

➤ 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
slide-14
SLIDE 14

FORD-FULKERSON ALGORITHM

14

➤ Main idea: can we repair bad choices? (a la backtracking) ➤ Algorithm: (initialize f = 0) ➤ Build residual Gf ➤ Find “augmenting path” f’ in Gf ; set f = f + f’ ➤ Repeat

slide-15
SLIDE 15

CORRECTNESS

15

➤ 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)

slide-16
SLIDE 16

CORRECTNESS

16

➤ 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

slide-17
SLIDE 17

CORRECTNESS

17

slide-18
SLIDE 18

MAX FLOW - MIN CUT THEOREM

18

slide-19
SLIDE 19

RECAP

19

slide-20
SLIDE 20

APPLICATIONS — CONNECTIVITY IN NETWORKS

20

slide-21
SLIDE 21

APPLICATIONS — IMAGE SEGMENTATION

21

slide-22
SLIDE 22

APPLICATIONS — MAX MATCHING

22

slide-23
SLIDE 23

APPLICATIONS — BASEBALL ELIMINATION

23