# lecture23 - Introduction to Algorithms...

This preview shows pages 1–10. Sign up to view the full content.

Introduction to Algorithms 6.046J/18.401J/SMA5503 Lecture 23 Prof. Charles E. Leiserson

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Introduction to Algorithms Day 40 L23.2 © 2001 by Charles E. Leiserson Recall from Lecture 22 Flow value: | f | = f ( s , V ) . Cut: Any partition ( S , T ) of V such that s S and t T . Lemma. | f | = f ( S , T ) for any cut ( S , T ) . Corollary. | f | c ( S , T ) for any cut ( S , T ) . Residual graph: The graph G f = ( V , E f ) with strictly positive residual capacities c f ( u , v ) = c ( u , v ) – f ( u , v ) > 0 . Augmenting path: Any path from s to t in G f . Residual capacity of an augmenting path: )} , ( { min ) ( ) , ( v u c p c f p v u f = .
Introduction to Algorithms Day 40 L23.3 © 2001 by Charles E. Leiserson Max-flow, min-cut theorem Theorem. The following are equivalent: 1. | f | = c ( S , T ) for some cut ( S , T ) . 2. f is a maximum flow. 3. f admits no augmenting paths. Proof. ( 1 ) ( 2 ): Since | f | c ( S , T ) for any cut ( S , T ) (by the corollary from Lecture 22), the assumption that | f | = c ( S , T ) implies that f is a maximum flow. ( 2 ) ( 3 ): If there were an augmenting path, the flow value could be increased, contradicting the maximality of f .

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Introduction to Algorithms Day 40 L23.4 © 2001 by Charles E. Leiserson Proof (continued) ( 3 ) ( 1 ): Suppose that f admits no augmenting paths. Define S = { v V : there exists a path in G f from s to v } , and let T = V S . Observe that s S and t T , and thus ( S , T ) is a cut. Consider any vertices u S and v T . We must have c f ( u , v ) = 0 , since if c f ( u , v ) > 0 , then v S , not v T as assumed. Thus, f ( u , v ) = c ( u , v ) , since c f ( u , v ) = c ( u , v ) – f ( u , v ) . Summing over all u S and v T yields f ( S , T ) = c ( S , T ) , and since | f | = f ( S , T ) , the theorem follows. s s u u v v S T path in G f
Introduction to Algorithms Day 40 L23.5 © 2001 by Charles E. Leiserson Ford-Fulkerson max-flow algorithm Algorithm: f [ u , v ] 0 for all u , v V while an augmenting path p in G wrt f exists do augment f by c f ( p ) Can be slow: s s t t 10 9 10 9 10 9 1 10 9 G :

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Introduction to Algorithms Day 40 L23.6 © 2001 by Charles E. Leiserson Ford-Fulkerson max-flow algorithm Can be slow: s s t t 0:10 9 0:10 9 0:10 9 0:1 0:10 9 G : Algorithm: f [ u , v ] 0 for all u , v V while an augmenting path p in G wrt f exists do augment f by c f ( p )
Introduction to Algorithms Day 40 L23.7 © 2001 by Charles E. Leiserson Ford-Fulkerson max-flow algorithm Can be slow: s s t t 0:10 9 0:10 9 0:10 9 0:1 0:10 9 G : Algorithm: f [ u , v ] 0 for all u , v V while an augmenting path p in G wrt f exists do augment f by c f ( p )

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Introduction to Algorithms Day 40 L23.8 © 2001 by Charles E. Leiserson Ford-Fulkerson max-flow algorithm Can be slow: s s t t 1:10 9 0:10 9 1:10 9 1:1 0:10 9 G : Algorithm: f [ u , v ] 0 for all u , v V while an augmenting path p in G wrt f exists do augment f by c f ( p )
Introduction to Algorithms Day 40 L23.9 © 2001 by Charles E. Leiserson Ford-Fulkerson max-flow algorithm Can be slow: s s t t 1:10 9 0:10 9 1:10 9 1:1 0:10 9 G : Algorithm: f [ u , v ] 0 for all u , v V while an augmenting path p in

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern