Lecture 10,11: General Matching Polytope, Maximum Flow. 1 Perfect Matching and Matching Polytope on General Graphs

Similar documents
LECTURES 3 and 4: Flows and Matchings

Lecture 4: Primal Dual Matching Algorithm and Non-Bipartite Matching. 1 Primal/Dual Algorithm for weighted matchings in Bipartite Graphs

12.1 Formulation of General Perfect Matching

1 Linear programming relaxation

Mathematical and Algorithmic Foundations Linear Programming and Matchings

1 Matching in Non-Bipartite Graphs

Network flows and Menger s theorem

Lecture 3: Graphs and flows

Solution for Homework set 3

In this lecture, we ll look at applications of duality to three problems:

1 Bipartite maximum matching

6. Lecture notes on matroid intersection

Approximation slides 1. An optimal polynomial algorithm for the Vertex Cover and matching in Bipartite graphs

CS599: Convex and Combinatorial Optimization Fall 2013 Lecture 14: Combinatorial Problems as Linear Programs I. Instructor: Shaddin Dughmi

Jessica Su (some parts copied from CLRS / last quarter s notes)

Topics in Combinatorial Optimization February 5, Lecture 2

COT 6936: Topics in Algorithms! Giri Narasimhan. ECS 254A / EC 2443; Phone: x3748

Lecture 14: Linear Programming II

Discrete Optimization 2010 Lecture 5 Min-Cost Flows & Total Unimodularity

Matching Algorithms. Proof. If a bipartite graph has a perfect matching, then it is easy to see that the right hand side is a necessary condition.

Today. Maximum flow. Maximum flow. Problem

Matching Theory. Figure 1: Is this graph bipartite?

CPSC 536N: Randomized Algorithms Term 2. Lecture 10

Number Theory and Graph Theory

Dual-fitting analysis of Greedy for Set Cover

Assignment 1 Introduction to Graph Theory CO342

Chapter 5 Graph Algorithms Algorithm Theory WS 2012/13 Fabian Kuhn

CS473-Algorithms I. Lecture 13-A. Graphs. Cevdet Aykanat - Bilkent University Computer Engineering Department

CS 473: Algorithms. Ruta Mehta. Spring University of Illinois, Urbana-Champaign. Ruta (UIUC) CS473 1 Spring / 36

1. Lecture notes on bipartite matching February 4th,

Linear Programming Duality and Algorithms

K 4 C 5. Figure 4.5: Some well known family of graphs

MTL 776: Graph Algorithms Lecture : Matching in Graphs

Lecture 11: Maximum flow and minimum cut

CS261: Problem Set #1

CPS 102: Discrete Mathematics. Quiz 3 Date: Wednesday November 30, Instructor: Bruce Maggs NAME: Prob # Score. Total 60

Lecture 3: Totally Unimodularity and Network Flows

NOTES ON COMBINATORIAL OPTIMIZATION

4 Integer Linear Programming (ILP)

Graphs and Network Flows IE411. Lecture 13. Dr. Ted Ralphs

and 6.855J March 6, Maximum Flows 2

Copyright 2007 Pearson Addison-Wesley. All rights reserved. A. Levitin Introduction to the Design & Analysis of Algorithms, 2 nd ed., Ch.

Submodularity Reading Group. Matroid Polytopes, Polymatroid. M. Pawan Kumar

Integer Programming Theory

Network Design and Optimization course

1. Lecture notes on bipartite matching

Advanced Combinatorial Optimization September 15, Lecture 2

Definition For vertices u, v V (G), the distance from u to v, denoted d(u, v), in G is the length of a shortest u, v-path. 1

Graph Algorithms Matching

Graph Theory S 1 I 2 I 1 S 2 I 1 I 2

Solutions for the Exam 6 January 2014

Lecture notes on the simplex method September We will present an algorithm to solve linear programs of the form. maximize.

Notes for Lecture 20

College of Computer & Information Science Fall 2007 Northeastern University 14 September 2007

Math 776 Graph Theory Lecture Note 1 Basic concepts

Advanced Combinatorial Optimization September 17, Lecture 3. Sketch some results regarding ear-decompositions and factor-critical graphs.

Steiner Trees and Forests

by conservation of flow, hence the cancelation. Similarly, we have

GRAPH DECOMPOSITION BASED ON DEGREE CONSTRAINTS. March 3, 2016

NETWORK SURVIVABILITY AND POLYHEDRAL ANALYSIS

Outline. 1 The matching problem. 2 The Chinese Postman Problem

CS612 Algorithms for Electronic Design Automation

An O(log n/ log log n)-approximation Algorithm for the Asymmetric Traveling Salesman Problem

Important separators and parameterized algorithms

Improved Approximations for Graph-TSP in Regular Graphs

2. Lecture notes on non-bipartite matching

11 Linear Programming

CS522: Advanced Algorithms

Source. Sink. Chapter 10: Iterative Programming Maximum Flow Problem. CmSc250 Intro to Algorithms

Lecture Overview. 2 Shortest s t path. 2.1 The LP. 2.2 The Algorithm. COMPSCI 530: Design and Analysis of Algorithms 11/14/2013

Problem set 2. Problem 1. Problem 2. Problem 3. CS261, Winter Instructor: Ashish Goel.

Material handling and Transportation in Logistics. Paolo Detti Dipartimento di Ingegneria dell Informazione e Scienze Matematiche Università di Siena

1. Suppose you are given a magic black box that somehow answers the following decision problem in polynomial time:

Theory of Computing. Lecture 4/5 MAS 714 Hartmut Klauck

CS 341: Algorithms. Douglas R. Stinson. David R. Cheriton School of Computer Science University of Waterloo. February 26, 2019

CSE 417 Network Flows (pt 4) Min Cost Flows

Recognizing Interval Bigraphs by Forbidden Patterns

/ Approximation Algorithms Lecturer: Michael Dinitz Topic: Linear Programming Date: 2/24/15 Scribe: Runze Tang

Lecture Notes 2: The Simplex Algorithm

Lecture 3. Corner Polyhedron, Intersection Cuts, Maximal Lattice-Free Convex Sets. Tepper School of Business Carnegie Mellon University, Pittsburgh

Lecture 22 Tuesday, April 10

The Encoding Complexity of Network Coding

Theory of Computing. Lecture 10 MAS 714 Hartmut Klauck

CSE 417 Network Flows (pt 3) Modeling with Min Cuts

Dual-Based Approximation Algorithms for Cut-Based Network Connectivity Problems

Combinatorial Optimization

12 Introduction to LP-Duality

Outline. Combinatorial Optimization 2. Finite Systems of Linear Inequalities. Finite Systems of Linear Inequalities. Theorem (Weyl s theorem :)

Matchings in Graphs. Definition 1 Let G = (V, E) be a graph. M E is called as a matching of G if v V we have {e M : v is incident on e E} 1.

ACO Comprehensive Exam March 19 and 20, Computability, Complexity and Algorithms

Module 11. Directed Graphs. Contents

6.854 Advanced Algorithms. Scribes: Jay Kumar Sundararajan. Duality

5.1 Min-Max Theorem for General Matching

In this chapter we introduce some of the basic concepts that will be useful for the study of integer programming problems.

Maximum flow problem CE 377K. March 3, 2015

Cuts, Connectivity, and Flow

CS 473: Algorithms. Ruta Mehta. Spring University of Illinois, Urbana-Champaign. Ruta (UIUC) CS473 1 Spring / 29

Introduction to Mathematical Programming IE406. Lecture 20. Dr. Ted Ralphs

CS 217 Algorithms and Complexity Homework Assignment 2

2 The Fractional Chromatic Gap

Transcription:

CMPUT 675: Topics in Algorithms and Combinatorial Optimization (Fall 2009) Lecture 10,11: General Matching Polytope, Maximum Flow Lecturer: Mohammad R Salavatipour Date: Oct 6 and 8, 2009 Scriber: Mohammad Reza Khani In this lecture we finish the discussion of matching (and perfect matching) polytopes We prove that the matching polytope is integral Then we start the topic of flows and circulations Recall that if A = V E is the incident vector of a graph G, then A is totally unimodular (TUM) if and only if G is bipartite We also proved that for every TUM matrix A, and integer vector b, the polytope Ax b is integral This includes the matching polytope of bipartite graphs 1 Perfect Matching and Matching Polytope on General Graphs Let G be a general graph and X be the set of all perfect matchings of G, ie, all incident vectors in R E where each corresponds to a perfect matching The perfect matching polytope of G, P(G), is defined as the convex hull of X Consider the following LP: x(δ(v)) = 1 v (1) x e 0 It is easy to see that every perfect matching satisfies these constraints However, these constraints are not sufficient to define correctly a perfect matching For example, if we consider any odd cycle, say C 3 and assign 1 2 to each edge, it satisfies these constraints but it does not belong to the perfect matching polytope (as it is empty) Figure 1: Triangle Counter Example Let U V be an odd size set and M be any perfect Matching of G Observation: M can have at most U 1 2 edges inside U Thus, at least one vertex of U is matched outside This can be used to strengthen the LP by adding odd set constraints: 1

x(δ(v)) = 1 v (2) x(e(u)) U 1 odd set U V 2 x e 0 Note that these constraints are violated by the example of Figure 1 Edmonds proved that the LP(2) corresponds to the polytope P(G), for perfect matchings in G Theorem 11 (Edmonds) LP(2) is integral, ie it is the polytope for perfect matchings of G Proof: Here we prove that all bfs s of this LP are integer, therefore the polytope is integral We prove this by showing (inductively) that every fractional solution is a non-vertex, ie can be written as convex combination of perfect matchings of G Let x be any basic feasible solution for this LP and suppose that it does not correspond to a perfect matching First, we can assume that x is totally fractional, ie 0 < x e < 1 for every edge since if there is an edge e with x e = 1 we remove both the edge and the end points to reduce the problem to a smaller graph, and if x e = 0 we can simply delete that edge and the corresponding variable So we arrive at reduced graph and reduced bfs solution x which is totally fractional Note that all values of x are rational For simplicity, assume that every fractional value is a multiple of 1/k (for sufficiently large k this is true) Thus, we can assume that instead of each edge, we have parallel edges each with fractional value 1/k and the number of parallel edges we have will be kx e So x corresponds to a set of tight constraints Tight odd-set constraints of single nodes are implied by degree constraints Therefore, we can assume every odd-set constraint that is tight is for a set U with 3 U V 3, and for that we have x(δ(u)) = 1 Consider any such tight set U We break the graph into two smaller ones G 1 and G 2 as shown in Figure 2 by: once contracting U to a single node (allowing parallel edges) and once contracting G U to a single node Both G 1 and G 2 will have smaller number of nodes because of the bound on the size of U Figure 2: Removing an Odd-set Tight Constraint Now consider projection of x to these two graphs, call it x and x Then x and x satisfy the constraints of the LP for G 1 and G 2 respectively, and hence belong to the perfect matching polytopes of G 1 and G 2 So G 1 has perfect matchings M 1,M 2,,M k and G 2 has perfect matchings M 1,M 2,,M k with x = 1 k k χ M i and x = 1 k i=1 k i=1 χ M i Now for each edge e δ(u), the number of i with e M i is equal to kx (e) = kx(e) = kx (e), which is equal to the number of i with e M i Hence, we can assume that for each i = 1,,k, M i and M i have an edge in δ(u) in common So M i = M i M i is a perfect matching of G Thus, 2

x = 1 k k χ M i i=1 Therefore, after removing edges with values 0/1 and contracting of odd-set constraints, we have only tight degree constraints If we have 2n nodes left 2n degree constraints have to be tight Each node has a degree greater than or equal to 2 We have only 2n tight constraints (degree constraints) so we can have only 2n edges, because this solution is a bfs After all, we have a graph with 2n nodes and 2n edges so it is the union of even cycles We know that in this case (when the graph is bipartite) any fractional solution can be written as convex combination of other perfect matchings, and this completes the proof Corollary 12 (Edmonds Matching Polytope) For any graph G the matching polytope can be defined by: x(δ(v)) = 1 v (3) x(δ(u)) x e 0 1 odd set U V Proof: Clearly every matching M satisfies 3 If we prove that every vertex of the polytope defined by LP(3) is a matching then we are done Suppose that x is a bfs of this LP Build a copy G from G and for each v V make an edge vv ; call this the new graph G = (Ṽ,Ẽ) for each e E we have x e = x e = x e and for each edge vv Ẽ we define x(vv ) = 1 x(δ(v)) It can be proved (as below) that x is feasible for the perfect matching LP of G: degree constraints are satisfied as every node v has x(δ(v)) = 1 now Also, for each odd set U Ṽ, say U = W X with W,X V we have x( δ(u)) x( δ(w \X)) + x( δ(x \W )) So we may assume that W X = and by symmetry, we may assume that W is odd, thus X = So it is enough to show that any odd set U V has x( δ(u)) 1 Now x( δ(u)) + 2 x(ẽ(u)) = v U x( δ(v)) = U and hence x( δ(u)) = U 2 x(ẽ(u)) U 2 1 2 U = 1 So x belongs to the perfect matching polytope of G and so can be expressed as convex combination of perfect matchings of G Consider the projection of these perfect matchings to G; then x is essentially the convex combination of these matchings (of G) 2 Maximum Flows and Minimum Cuts Suppose we are given a digraph D = (V,E) and two vertices s,t V Every edges has an upper bound capacity u e : E R 0 and a lower bound capacity l e : E R 0 A function f : E R 0 is called a flow if: 1 v V {s,t}, e δ + (v) f(e) = e δ (v) f(e), ie we have flow conservation at every node (except the source and sink), 2 e E, l e f e u e, ie capacity constraints are satisfied 3

Definition 21 Total value of a flow f, denoted by f, is the total flow going out of s, which by flow conservation should be the net flow going into t: f(e) f(e) = f = f(e) f(e) e δ + (s) e δ (s) e δ (t) e δ + (t) The maximum flow problem is: Given digraph G(V,E) and l,u : E R 0, find an s t-flow of largest possible value Clearly, one can write this problem as an LP: max f(δ + (s)) f(δ (s)) (4) st f(e) = f(e) v V {s,t} e δ + (v) l f u e δ (v) This can be solved using an LP solver In fact if we consider N to be the vertex-arc incident vector of the graph then N is an n m matrix such that for each edge e = ij: 1 u = i N(u,e) = 1 u = j 0 u {i,j} N e v 1 +1 v 2-1 then the constraints of the LP can be written as Ax b where (5) A = N I I Then the following lemma is fairly easy to prove: Lemma 22 A is totally unimodular Proof: We prove inductively that the determinant of any submatrix of A is in { 1,0,+1} Base case is trivial Consider any submatrix of A If there is a row with a single non-zero entry then clearly expanding the determinant around that entry and using induction hypothesis gives the desired result So we can assume that the submatrix is actually a submatrix of N Here again if there is a column with a sinle non-zero etnry (which will be a +1 or a 1) then we can expand the determinant around that column and use induction Therefore, the only case left is when every column of the submatrix of N has exactly two non-zero entries, one +1 and one 1 The rows of such a submatrix is linearly dependent since the sum of the rows is then zero, thus the determinant is zero Corollary 23 If b is integer ie if u,l are integers then the flow is always integer 4

21 Cuts Definition 24 Given a set S V, the cut defined by S is: δ + (S) = {uv E u s,v V/S} The capacity of the cut is c(δ + (S)), which is the sum of the capacities of the edges going out of S Similarly, δ (S) is the set of edges going into S We say a cut δ + (S) is an s t cut if s S and t V S If we have a flow f and S is an s t-cut then f = f(δ + (S)) f(δ (S)) It is easy to prove that: Lemma 25 For any flow f and any s t-cut S, c(s) f(δ + (s)) f(δ (s) Proof: f = f(δ + (S)) f(δ (S)) = (f(δ + (v)) f(δ (v))) v V t = f(δ + (S)) f(δ (S)) f(δ + (S)) c(s) So we have weak duality: max f f min c(s) S We will show this the strong duality holds as well ie max f f = min S c(s) Flow decomposition: Suppose f is an s t-flow in G We can write f as linear combination of a polynomial number of s t-path each carrying ǫ > 0 amount of flow In particular if f is integer then each path carries a unit flow Because, whenever you enter a vertex by a unit flow because of flow conservation) you can exit from that node as well, unless you have arrived at t Therefore, any walk that starts from s ends at t Moreover, in the special case when all capacities are 1 all these flow-paths are edge disjoint So the size of a maximum flow is equal to the number of edge-disjoint paths from s to t Theorem 26 The value of a Max-flow is equal to the size of a min-cut in G Proof: Given graph a G(V,E) and flow f on G we construct residual multi-graph G f (V,E f ) as follows: Forward edge: if (i,j) E and f(i,j) < c(i,j) : (i,j) E f with capacity c(i,j) f(i,j) Backward edge: if (j,i) E and f(j,i) > 0 : (i,j) E f with capacity f(j,i) Let f be a max-flow in G Using weak duality, it is sufficient to find a cut S such that f = c(s) to prove the strong duality We first prove that if f is maximum then there is no s t-path in G f By way of contradiction, suppose we find an s t path P in G f So it may contains forward edges and backward edges Let ǫ be: { ce f ǫ = min e, if e is a forward edge e f e, if e is a backward edge Let p + be the set of forward edges and p be the set of backward edges then we can define f to be: 5

f e + ǫ e p + f = f e ǫ e p other wise f e Clearly f is a feasible flow and f = f + ǫ, so it contradicts our assumption that f is maximum Thus there is no path from s to t in G f Let S be the set of vertices reachable from s in G f ; clearly t / S As there is no s t-path we have following: therefore e δ + (S) : f(e) = c(e) e δ (S) : f(e) = 0 c(s) = e δ + (S) c(e) = e δ + (S) f(e) = f This proof suggests the following algorithm to find a maximum flow: as long as there is an augmenting path in G f find one and improve the flow and update G f Theorem 27 If all the capacities are rational the above algorithm terminates Proof: Multiply all capacities by sufficiently large integer k so that all c e s will be integer; the theorem follows since every path increases the flow by at least 1 For irrational values, there are examples which show that the algorithm may never terminate if the augmenting paths are not selected carefully Another algorithm introduced by Danits in 1970 and Edmond Karp in 1972 guarantee the polynomial time complexity It suggests that in each iteration, find the shortest augmenting path (path that has least number of edges) each time Let d(v) be the length of shortest s v-path in G f Suppose we augment f to f by a shortest s t-path in G f It can be proved: Lemma 28 d f (v) is monotonically increasing after each iteration A critical edge on any path p is an edge whose residual capacity is equal to ǫ ie the edge disappears from G f after apply the augmenting path Lemma 29 Every edge becomes critical at most V 2 1 time Proof: Consider edge uv When uv becomes critical for the first time we must have d f (v) = d f (u) + 1 Once the flow is augmented, this edge disappears from G f Figure 3: uv Critical Path and it appears only if vu appears on an augmenting path and therefore the flow on uv increases So we must have a situation (with a flow f ) such that d f (u) = d f (v) + 1 and we know that d f (v) d f (v) as it is 6

monotonically increasing So we will have: d f (u) = d f (v) + 1 d f (v) + 1 = d f (u) + 2 So d f (u) increases by two each time after the first time Since d f (u) is bounded by V 1, the lemma follows According to lemma 29 number of times we can find augmenting path is O(nm); using breadth first search we can find a shortest augmenting path in time O(m) So the total time complexity will be O(m 2 n) which can be improved to O(n 3 ) 22 Some Applications Many problems (including some of the ones we have looked at) can be reduced to max-flow problem We list a few below Maximum Bipartite Matching: Suppose we are given a bipartite graph G = (A B, E) and our goal is to compute a maximum matching in G We can create a source s and a destination t, connect s to all nodes in A with directed edges out of s with capacity 1 and connect all the nodes in B to t with edges directed to t and with capacity 1 Also direct all the edges from A to B and put capacity 1 It is easy to see that a maximum flow in this new graph corresponds to a maximum matching between A and B (ie those edges between A and B with non-zero flow form a matching) Min-Cut: A minimum cut between s and t is basically the minimum number of edges whose removal from G disconnects s from t By using max-flow we can find a minimum s t-cut Also, the (global) minimum cut in a connected graph G is the minimum number of edges whose removal disconnects G Clearly by computing minimum s t cut for all pairs of vertices as source and sink we can find minimum cut of G (although there are more efficient algorithms to find the min-cut) References S03 SCHRIJVER, ALEXANDER, Combinatorial optimization: polyhedra and efficiency, Volume 1, 2003, pp 438 440 7