This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License. CS 312: Algorithm Design & Analysis Lecture #29: Network Flow and Cuts Slides by: Eric Ringger, with contributions from Mike Jones Announcements HW #20: Due now. HW #20.5 Due Monday Project #6: Linear Programming In preparation: HW #21 Formulate problem for Proj. #6 NO 2-hour time limit Due Wednesday Objectives Better understand the idea of “changing the problem” in the max flow algorithm Understand the relationship between flows and cuts Solve Bipartite Matching See example of Padded matrix-vector representation Max Flow Example 6 4 b 4 s 2 2 e 2 d f t 4 4 Summarize the max flow algorithm. Max Flow Example 6 4 b 4 s 2 2 e 2 d f t 4 4 1. Pick a simple path st and increase the flow along that path as much as possible 2. Create the residual graph GR including reverse edges 3. Repeat until there is no path with remaining capacity. Solve 6 4 b 4 s 2 2 e 2 d f 4 t 4 Max Flow Example 6 One solution 4 b 4 s 2 2 e 2 d f 4 t 4 Residual Graph, incl. reverse edges b e s t d f Max Flow Example b e s t d f Residual Graph, incl. reverse edges b e s t d No paths from s to t, so we are done. f Key Points about our Max Flow Algorithm 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. (s,t)-Cut 6 L: Source Side 4 b 4 s 2 2 e 2 d f t 4 R: Sink Side 4 An (s,t)-cut partitions the vertices into two disjoint sets: • L contains s • R contains t To compute the capacity of a cut, add up the capacities of edges that flow across the cut from L to R. Cut Property What does a min cut represent? 6 4 b 4 s 2 2 e 2 d f t 4 4 Max flow is less than or equal to the flow across any cut. Max-Flow Min-Cut Theorem: The maximum flow through a network is equal to the minimum flow across all cuts. Cut Property 6 4 b 4 s 2 2 e 2 d f 4 t 4 We can call a minimum cut a “matching cut”, since its capacity matches the maximum flow. Max flow is less than or equal to the flow across any cut. Max-Flow Min-Cut Theorem: The maximum flow through a network is equal to the minimum flow across all cuts. Algorithms Our focus has been on gaining intuition toward understanding the Simplex algorithm. The general algorithm for solving max. flow: Ford-Fulkerson An implementation thereof: Edmonds-Karp: 𝑂(𝑉 ⋅ 𝐸 2 ) Match-making Match-making Is there a perfect matching? Bipartite Matching Great example of problem reduction. Is there a perfect matching? LP: Padded Matrices & Vectors End Assignment HW #20.5 Due Monday HW #21: Part 1 of Project #6 Just the problem formulation and representations No time limit Due Wednesday
© Copyright 2026 Paperzz