Upload
tanner
View
18
Download
0
Tags:
Embed Size (px)
DESCRIPTION
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License . CS 312: Algorithm Analysis. Lecture #28: Network Flow and Cuts. Slides by: Eric Ringger, with contributions from Mike Jones. Objectives. - PowerPoint PPT Presentation
Citation preview
CS 312: Algorithm Analysis
Lecture #28: Network Flow and Cuts
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.
Slides by: Eric Ringger, with contributions from Mike Jones
Objectives
Understand the idea of “changing the problem” in the max flow algorithm
Solve min-cut (using max-flow) Solve Bipartite Matching (using max-flow) See example of Padded matrix-vector
representation
Volunteer
s
b
d
t
4 2
2 4
4
e
f
2
4
6
Max Flow
Key points When we transform the problem we create
“imaginary edges” However, in the end our selected paths
always produce a flow schedule that involves only the original edges.
Cut
An (s,t)-cut partitions the vertices into two disjoint sets:L contains sR contains t
s
b
d
t
4 2
2 4
4
e
f
2
4
6
To compute the capacity of a cut, add up the capacitiesof edges that flow across the cut from L to R (not R to L!).
L:SourceSide
R:SinkSide
Max-flow min-cut Theorem
s
b
d
t
4 2
2 4
4
e
f
2
4
6
Max flow is less than or equal to the capacity of any cut. Max flow is equal to the capacity of the min cut.
Another Example
We can now find the min cut in the original graph by finding all of the nodes that are reachable from the source in the final residual graph . The min cut value is equal to the max flow.
Bipartite Matching
• We can use our solution to the max-flow problem to find maximal matchings.
Big ideas Max-flow is a nice graphical version of the Simplex
algorithm Proceed greedily, but use slack variables so that you can
change your decisions later on. Find a quick & dirty solution (not necessarily optimal) in order to
remove some slack from the problem; then transform the problem and try again!
Max-flow can be used to solve other interesting problems Min-cut Matching
LP: Padded Matrices & VectorsStandard Form (Step #1)
Subject to:
Matrix/vector notation (Step #1)
Subject to:
Where is an optional constant in the objective function
Standard Form (Step #2)
Subject to:
Matrix/vector notation (Step #2)
Subject to:
Where are the indices of the nonbasic (original) variables and are the indices of the basic (slack) variables.
Project #6 Linear Programming Important: LP Notes available on the schedule
Works through the ideas up through the Simplex algorithm Sets you up to succeed on project #6 Includes the pseudo-code for Simplex (and Pivot)
HW #21: Formulate problem for Proj. #6 NO 2-hour time limit
Early day: next Thursday Due: next Friday How to Test: Use online solver to verify your result!