Review. Ford-Fulkerson algorithm for max-flow: repeatedly augment - - PowerPoint PPT Presentation

review
SMART_READER_LITE
LIVE PREVIEW

Review. Ford-Fulkerson algorithm for max-flow: repeatedly augment - - PowerPoint PPT Presentation

Review. Ford-Fulkerson algorithm for max-flow: repeatedly augment flow along paths in the residual graph If capacities are integers, F-F finds an integer valued flow Running time: O((m+n)OPT), where OPT is the value of the max flow


slide-1
SLIDE 1

Review….

Ford-Fulkerson algorithm for max-flow: repeatedly augment flow along paths in the residual graph If capacities are integers, F-F finds an integer valued flow Running time: O((m+n)OPT), where OPT is the value of the max flow Correctness?

slide-2
SLIDE 2

Today

1) Prove that Ford-Fulkerson algorithm finds a maximum flow by proving the Max-Flow Min-Cut Theorem Fundamental result in combinatorial optimization (best know example of duality) Independently proven in 1956 by Ford and Fulkerson AND by Elias, Feinstein and Claude Shannon 2) Bipartite matching

slide-3
SLIDE 3

Flows and Cuts are Intimately Related!

Reference: On the history of the transportation and maximum flow problems. Alexander Schrijver in Math Programming, 91: 3, 2002.

slide-4
SLIDE 4

Outline

Definitions: s-t cuts and their capacities Flow value lemma: how to measure a flow using different s-t cuts in the network The main event: Max-flow Min-Cut Theorem

slide-5
SLIDE 5

An s-t cut is a partition (A, B) of V with s ∈ A and t ∈ B. The capacity of a cut (A, B) is: Σ c(e)

Cuts

e out of A

B A

s 2 3 4 5 6 7 t 15 5 30 15 10 8 15 9 6 10 10 10 15 4 4 source sink

capacity of A-B cut = 9 + 15 + 8 + 30 = 62

slide-6
SLIDE 6

B A

Cuts

s 2 3 4 5 6 7 t 15 5 30 15 10 8 15 9 6 10 10 10 15 4 4 source sink

capacity of cut = 9 + 15 + 8 + 30 = 62 (Capacity is sum of weights on edges leaving A.)

slide-7
SLIDE 7

B A

Flow value lemma. Let f be any flow, and let (A, B) be any s-t cut. Then, the net flow sent across the cut is equal to the amount leaving s.

Flows and Cuts

s 2 3 4 5 6 7 t 15 5 30 15 10 8 15 9 6 10 10 10 15 4 4 source sink 10 9 4 10 9 1 6 1 10 9 6

value = 24 ∑ f(e) - ∑ f(e) = v(f)

e out of A e into A

slide-8
SLIDE 8

B A

Flow value lemma. Let f be any flow, and let (A, B) be any s-t cut. Then, the net flow sent across the cut is equal to the amount leaving s.

Flows and Cuts

s 2 3 4 5 6 7 t 15 5 30 15 10 8 15 9 6 10 10 10 15 4 4 source sink 10 9 4 10 9 1 6 1 10 9 6

value = 24 ∑ f(e) - ∑ f(e) = v(f)

e out of A e into A

slide-9
SLIDE 9

B A

Flow value lemma. Let f be any flow, and let (A, B) be any s-t cut. Then, the net flow sent across the cut is equal to the amount leaving s.

Flows and Cuts

s 2 3 4 5 6 7 t 15 5 30 15 10 8 15 9 6 10 10 10 15 4 4 source sink 10 9 4 10 9 1 6 1 10 9 6

value = 24 ∑ f(e) - ∑ f(e) = v(f)

e out of A e into A

slide-10
SLIDE 10

Flows and Cuts

Another interpretation: we can measure the value

  • f a flow by selecting any s-t cut, and looking at

the net flow crossing the cut.

slide-11
SLIDE 11

Proof

Flow value lemma. Let f be any flow, and let (A, B) be any s-t cut. Then ∑ f(e) - ∑ f(e) = v(f).

e out of A e into A

Proof on board.

slide-12
SLIDE 12

Important Corollary!

Flow value lemma. Let f be any flow, and let (A, B) be any s-t cut. Then ∑ f(e) - ∑ f(e) = v(f).

  • Corollary. Let f be any flow, and let (A, B) be any s-t
  • cut. Then v(f) ≤ c(A, B).

(See examples on previous slides)

Proof as exercise

e out of A e into A

slide-13
SLIDE 13

Important Corollary!

  • Corollary. Let f be any flow, and let (A, B) be any

s-t cut. Then v(f) ≤ c(A, B). Interpretation: every cut gives an upper bound on the value of every flow, and hence the value of the maximum flow What is the best (i.e. smallest) upper bound?

slide-14
SLIDE 14

B A

Find an s-t cut of minimum capacity. capacity = 10 + 8 + 10 = 28

Minimum Cut Problem

s 2 3 4 5 6 7 t 15 5 30 15 10 8 15 9 6 10 10 10 15 4 4 source sink

slide-15
SLIDE 15

Max-Flow Min-Cut Theorem

Theorem: Let f be a flow such that there are no s-t paths in the residual graph Gf. Let (A, B) be the s-t cut where A contains the nodes reachable from s in Gf, and B = V-A. Then v(f) = C(A, B), and f is a maximum flow and (A,B) is a minimum cut. Corollary: Ford-Fulkerson returns a maximum flow. Corollary: In any flow network, the value of the max flow is equal to the capacity of the min cut.

slide-16
SLIDE 16

Proof

Proof on board

slide-17
SLIDE 17

Min-Cut

Another corollary: given a maximum flow, we can find a minimum cut in O(m+n) time. How?

slide-18
SLIDE 18

Finding Min Cut

s 2 3 4 5 t

10 10 9 8 4 10 10 6 2 G:

Flow value = 0

slide-19
SLIDE 19

maximum flow = 19

Finding Min Cut

s 2 3 4 5 t

10 10 9 8 4 10 10 6 2

10 10

G

s 2 3 4 5 t

Gf

10 10 9 6

6

9 9 2 3 7 1 1 1

9 9 7 3 9

1

slide-20
SLIDE 20

Ford-Fulkerson Wrap-Up

We’ve now shown that F-F: (1) runs in O((m+n)OPT) time → pseudo-polynomial (2) finds an integer-valued flow (if capacities are integers) (3) finds a maximum flow By choosing good augmenting paths, F-F can be improved to run O(m2 log C) time, where C is the capacity of any cut, and hence an upper bound on OPT → polynomial Other max-flow algorithms run in O(n2m) or O(n3) time → strongly polynomial

slide-21
SLIDE 21

OK! But what are they good for???

slide-22
SLIDE 22

Matching. Input: undirected graph G = (V , E). M ⊆ E is a matching if each node appears in at most 1 edge in M. Max matching: find a max cardinality matching.

Matching

slide-23
SLIDE 23

Bipartite Matching

Bipartite matching. Input: undirected, bipartite graph G = (L ∪ R, E). M ⊆ E is a matching if each node appears in at most 1 edge in M. Max matching: find a max cardinality matching.

1 3 5 1' 3' 5' 2 4 2' 4'

matching 1-2', 3-1', 4-5'

R L

Is this the max matching?

slide-24
SLIDE 24

Bipartite Matching

Bipartite matching. Input: undirected, bipartite graph G = (L ∪ R, E). M ⊆ E is a matching if each node appears in at most 1 edge in M. Max matching: find a max cardinality matching.

1 3 5 1' 3' 5' 2 4 2' 4'

R L

max matching 1-1', 2-2', 3-3' 4-5'

slide-25
SLIDE 25

Max flow formulation. Direct all edges from L to R and assign capacity

  • f 1.

Bipartite Matching

1 3 5 1' 3' 5' 2 4 2' 4'

R L

1 1 1 1 1 1 1 1 1 1

slide-26
SLIDE 26

Max flow formulation. Add source s, and unit capacity edges from s to each node in L.

Bipartite Matching

1 3 5 1' 3' 5' 2 4 2' 4'

R L

1 1 1 1 1 1 1 1 1 1

s

1 1 1 1 1

slide-27
SLIDE 27

Max flow formulation. Add sink t, and unit capacity edges from each node in R to t.

Bipartite Matching

1 3 5 1' 3' 5' 2 4 2' 4'

R L

1 1 1 1 1 1 1 1 1 1

s

1 1 1 1 1

t

1 1 1 1 1

slide-28
SLIDE 28

Max flow formulation. Solve max flow problem. Claim: edges between L and R with flow = 1 identify max matching.

Bipartite Matching

1 3 5 1' 3' 5' 2 4 2' 4'

R L

1 1 1 1 1 1 1 1 1 1

s

1 1 1 1 1

t

1 1 1 1 1

slide-29
SLIDE 29

Proof

Show there is a bijection between a matching M in the original graph, and a flow f in the new graph, and that v(f) = |M|. Thus, a maximum flow is a maximum matching. Details: exercise

slide-30
SLIDE 30

Next Time

More flow applications!