1 / 17

CS 312: Algorithm Analysis

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.

tanner
Download Presentation

CS 312: Algorithm Analysis

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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

  2. 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

  3. Volunteer 6 4 b e 2 s 4 2 t d f 2 4 4

  4. 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.

  5. Cut L: Source Side R: Sink Side An (s,t)-cut partitions the vertices into two disjoint sets: L contains s R contains t 6 4 b e 2 s 4 2 t 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!). d f 2 4 4

  6. Max-flow min-cut Theorem 6 4 b e 2 s 4 2 t d f 2 4 4 Max flow is less than or equal to the capacity of any cut. Max flow is equal to the capacity of the min cut.

  7. Another Example

  8. 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.

  9. Bipartite Matching • We can use our solution to the max-flow problem to find maximal matchings.

  10. 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

  11. LP: Padded Matrices & Vectors Standard 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.

  12. 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!

More Related