The Bipartite Matching Problem II Math 482, Lecture 22 Misha Lavrov - - PowerPoint PPT Presentation

the bipartite matching problem ii
SMART_READER_LITE
LIVE PREVIEW

The Bipartite Matching Problem II Math 482, Lecture 22 Misha Lavrov - - PowerPoint PPT Presentation

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that arent bipartite The Bipartite Matching Problem II Math 482, Lecture 22 Misha Lavrov March 27, 2020 Bipartite incidence matrices are TU The dual problem:


slide-1
SLIDE 1

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

The Bipartite Matching Problem II

Math 482, Lecture 22 Misha Lavrov March 27, 2020

slide-2
SLIDE 2

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Last time: bipartite matching LP

1 2 3 4 5

maximize x13 + x14 + x15 + x24 + x25 subject to x13 + x14 + x15 ≤ 1 x24 + x25 ≤ 1 x13 ≤ 1 x14 + x24 ≤ 1 x15 + x25 ≤ 1 x13, x14, x15, x24, x25 ≥ 0

slide-3
SLIDE 3

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Last time: bipartite matching LP

1 2 3 4 5

maximize x13 + x14 + x15 + x24 + x25 subject to x13 + x14 + x15 ≤ 1 x24 + x25 ≤ 1 x13 ≤ 1 x14 + x24 ≤ 1 x15 + x25 ≤ 1 x13, x14, x15, x24, x25 ≥ 0

Variables: xij for every edge (i, j) ∈ E.

slide-4
SLIDE 4

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Last time: bipartite matching LP

1 2 3 4 5

maximize x13 + x14 + x15 + x24 + x25 subject to x13 + x14 + x15 ≤ 1 x24 + x25 ≤ 1 x13 ≤ 1 x14 + x24 ≤ 1 x15 + x25 ≤ 1 x13, x14, x15, x24, x25 ≥ 0

Variables: xij for every edge (i, j) ∈ E. Maximize sum of all variables.

slide-5
SLIDE 5

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Last time: bipartite matching LP

1 2 3 4 5

maximize x13 + x14 + x15 + x24 + x25 subject to x13 + x14 + x15 ≤ 1 x24 + x25 ≤ 1 x13 ≤ 1 x14 + x24 ≤ 1 x15 + x25 ≤ 1 x13, x14, x15, x24, x25 ≥ 0

Variables: xij for every edge (i, j) ∈ E. Maximize sum of all variables. For every vertex i ∈ X ∪ Y , sum of variables involving i is ≤ 1.

slide-6
SLIDE 6

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Incidence matrix

maximize x13 + x14 + x15 + x24 + x25 subject to       1 1 1 1 1 1 1 1 1 1             x13 x14 x15 x24 x25       ≤       1 1 1 1 1       x13, x14, x15, x24, x25 ≥ 0

In general, constraints are Ax ≤ 1.

slide-7
SLIDE 7

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Incidence matrix

maximize x13 + x14 + x15 + x24 + x25 subject to       1 1 1 1 1 1 1 1 1 1             x13 x14 x15 x24 x25       ≤       1 1 1 1 1       x13, x14, x15, x24, x25 ≥ 0

In general, constraints are Ax ≤ 1. A has |X| + |Y | rows and |E| columns.

slide-8
SLIDE 8

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Incidence matrix

maximize x13 + x14 + x15 + x24 + x25 subject to       1 1 1 1 1 1 1 1 1 1             x13 x14 x15 x24 x25       ≤       1 1 1 1 1       x13, x14, x15, x24, x25 ≥ 0

In general, constraints are Ax ≤ 1. A has |X| + |Y | rows and |E| columns. A is the incidence matrix of the bipartite graph: Av,e = 1 if vertex v is an endpoint of edge e, and 0

  • therwise.
slide-9
SLIDE 9

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Totally unimodular matrices

Previous lecture: Definition A matrix A is totally unimodular (TU for short) if every square submatrix (any k rows and any k columns, not necessarily consecutive, for all values of k) has determinant −1, 0, or 1. Theorem If the m × n matrix A is TU and b ∈ Rm is an integer vector, then all corner points of {x ∈ Rn : Ax ≤ b, x ≥ 0} have integer coordinates.

slide-10
SLIDE 10

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Totally unimodular matrices

Previous lecture: Definition A matrix A is totally unimodular (TU for short) if every square submatrix (any k rows and any k columns, not necessarily consecutive, for all values of k) has determinant −1, 0, or 1. Theorem If the m × n matrix A is TU and b ∈ Rm is an integer vector, then all corner points of {x ∈ Rn : Ax ≤ b, x ≥ 0} have integer coordinates. Today: Theorem The incidence matrix of a bipartite graph is totally unimodular.

slide-11
SLIDE 11

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Theorem The incidence matrix of a bipartite graph is totally unimodular: for each k, every square k × k submatrix has determinant 0 or ±1. Proof outline:

1 Check k = 1: all entries of A are 0 or 1.

slide-12
SLIDE 12

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Theorem The incidence matrix of a bipartite graph is totally unimodular: for each k, every square k × k submatrix has determinant 0 or ±1. Proof outline:

1 Check k = 1: all entries of A are 0 or 1. 2 For k > 1, consider three cases of k × k submatrix B.

B has a column of all zeroes:

slide-13
SLIDE 13

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Theorem The incidence matrix of a bipartite graph is totally unimodular: for each k, every square k × k submatrix has determinant 0 or ±1. Proof outline:

1 Check k = 1: all entries of A are 0 or 1. 2 For k > 1, consider three cases of k × k submatrix B.

B has a column of all zeroes: det(B) = 0.

slide-14
SLIDE 14

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Theorem The incidence matrix of a bipartite graph is totally unimodular: for each k, every square k × k submatrix has determinant 0 or ±1. Proof outline:

1 Check k = 1: all entries of A are 0 or 1. 2 For k > 1, consider three cases of k × k submatrix B.

B has a column of all zeroes: det(B) = 0. B has a column with only one 1:

slide-15
SLIDE 15

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Theorem The incidence matrix of a bipartite graph is totally unimodular: for each k, every square k × k submatrix has determinant 0 or ±1. Proof outline:

1 Check k = 1: all entries of A are 0 or 1. 2 For k > 1, consider three cases of k × k submatrix B.

B has a column of all zeroes: det(B) = 0. B has a column with only one 1: simplify to (k − 1) × (k − 1).

slide-16
SLIDE 16

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Theorem The incidence matrix of a bipartite graph is totally unimodular: for each k, every square k × k submatrix has determinant 0 or ±1. Proof outline:

1 Check k = 1: all entries of A are 0 or 1. 2 For k > 1, consider three cases of k × k submatrix B.

B has a column of all zeroes: det(B) = 0. B has a column with only one 1: simplify to (k − 1) × (k − 1). All columns of B have two 1s:

slide-17
SLIDE 17

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Theorem The incidence matrix of a bipartite graph is totally unimodular: for each k, every square k × k submatrix has determinant 0 or ±1. Proof outline:

1 Check k = 1: all entries of A are 0 or 1. 2 For k > 1, consider three cases of k × k submatrix B.

B has a column of all zeroes: det(B) = 0. B has a column with only one 1: simplify to (k − 1) × (k − 1). All columns of B have two 1s: det(B) = 0.

slide-18
SLIDE 18

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Theorem The incidence matrix of a bipartite graph is totally unimodular: for each k, every square k × k submatrix has determinant 0 or ±1. Proof outline:

1 Check k = 1: all entries of A are 0 or 1. 2 For k > 1, consider three cases of k × k submatrix B.

B has a column of all zeroes: det(B) = 0. B has a column with only one 1: simplify to (k − 1) × (k − 1). All columns of B have two 1s: det(B) = 0.

3 By induction on k, all submatrices have determinant 0 or ±1.

slide-19
SLIDE 19

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Case 1: B has a column of all zeroes

Example:       1 1 1 1 1 1 1 1 1 1      

 1 1 1  

slide-20
SLIDE 20

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Case 1: B has a column of all zeroes

Example:       1 1 1 1 1 1 1 1 1 1      

 1 1 1   If B has a column of all zeroes, then the columns of B are linearly

  • dependent. In that case, det(B) = 0.
slide-21
SLIDE 21

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Case 2: B has a column with only one 1

Example:       1 1 1 1 1 1 1 1 1 1      

 1 1 1 1 1  

slide-22
SLIDE 22

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Case 2: B has a column with only one 1

Example:       1 1 1 1 1 1 1 1 1 1      

 1 1 1 1 1   If B has a column with only one 1, expand det(B) along that column.

slide-23
SLIDE 23

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Case 2: B has a column with only one 1

Example:       1 1 1 1 1 1 1 1 1 1      

 1 1 1 1 1   If B has a column with only one 1, expand det(B) along that

  • column. Reduce to a smaller matrix:
  • 1

1 1 1 1

  • = 1 ·
  • 1

1

  • − 0 ·
  • 1

1 1

  • + 0 ·
  • 1

1 1

  • =
  • 1

1

slide-24
SLIDE 24

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Case 3: All columns of B have two 1s

Example:       1 1 1 1 1 1 1 1 1 1      

   1 1 1 1 1 1 1 1    

slide-25
SLIDE 25

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Case 3: All columns of B have two 1s

Example:       1 1 1 1 1 1 1 1 1 1      

   1 1 1 1 1 1 1 1     In the final case, rows of B are linearly dependent: The rows coming from X add up to

  • 1

1 · · · 1

  • .

The rows coming from Y also add up to

  • 1

1 · · · 1

  • .

Therefore det(B) = 0.

slide-26
SLIDE 26

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Taking the dual

What is the dual of the bipartite matching LP?

slide-27
SLIDE 27

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Taking the dual

What is the dual of the bipartite matching LP? The primal problem has a ≤ constraint for every vertex. So, the dual has a variable yi ≥ 0 for every i ∈ X ∪ Y .

slide-28
SLIDE 28

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Taking the dual

What is the dual of the bipartite matching LP? The primal problem has a ≤ constraint for every vertex. So, the dual has a variable yi ≥ 0 for every i ∈ X ∪ Y . The primal problem has a variable xij ≥ 0 for every edge. So, the dual has a ≥ constraint for every edge (i, j) ∈ E.

slide-29
SLIDE 29

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Taking the dual

What is the dual of the bipartite matching LP? The primal problem has a ≤ constraint for every vertex. So, the dual has a variable yi ≥ 0 for every i ∈ X ∪ Y . The primal problem has a variable xij ≥ 0 for every edge. So, the dual has a ≥ constraint for every edge (i, j) ∈ E. The primal LP is a maximization problem. So, the dual LP is a minimization problem: we minimize the sum of all the yi.

slide-30
SLIDE 30

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Taking the dual

What is the dual of the bipartite matching LP? The primal problem has a ≤ constraint for every vertex. So, the dual has a variable yi ≥ 0 for every i ∈ X ∪ Y . The primal problem has a variable xij ≥ 0 for every edge. So, the dual has a ≥ constraint for every edge (i, j) ∈ E. The primal LP is a maximization problem. So, the dual LP is a minimization problem: we minimize the sum of all the yi. The primal variable xij appears in constraints for vertices i and

  • j. So, the dual constraint for (i, j) contains variables yi and

yj: we get yi + yj ≥ 1 for each (i, j) ∈ E

slide-31
SLIDE 31

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

An example of the dual LP

1 2 3 4 5

minimize y1 + y2 + y3 + y4 + y5 subject to y1 + y3 ≥ 1 y1 + y4 ≥ 1 y1 + y5 ≥ 1 y2 + y4 ≥ 1 y2 + y5 ≥ 1 y1, y2, y3, y4, y5 ≥ 0

slide-32
SLIDE 32

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

An example of the dual LP

1 2 3 4 5

minimize y1 + y2 + y3 + y4 + y5 subject to y1 + y3 ≥ 1 y1 + y4 ≥ 1 y1 + y5 ≥ 1 y2 + y4 ≥ 1 y2 + y5 ≥ 1 y1, y2, y3, y4, y5 ≥ 0

Let’s interpret the dual LP! Let S be the set of all i such that yi = 1.

slide-33
SLIDE 33

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

An example of the dual LP

1 2 3 4 5

minimize y1 + y2 + y3 + y4 + y5 subject to y1 + y3 ≥ 1 y1 + y4 ≥ 1 y1 + y5 ≥ 1 y2 + y4 ≥ 1 y2 + y5 ≥ 1 y1, y2, y3, y4, y5 ≥ 0

Let’s interpret the dual LP! Let S be the set of all i such that yi = 1. Want to minimize the size of S.

slide-34
SLIDE 34

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

An example of the dual LP

1 2 3 4 5

minimize y1 + y2 + y3 + y4 + y5 subject to y1 + y3 ≥ 1 y1 + y4 ≥ 1 y1 + y5 ≥ 1 y2 + y4 ≥ 1 y2 + y5 ≥ 1 y1, y2, y3, y4, y5 ≥ 0

Let’s interpret the dual LP! Let S be the set of all i such that yi = 1. Want to minimize the size of S. For each (i, j) ∈ E, either i ∈ S or j ∈ S (or both).

slide-35
SLIDE 35

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Vertex covers

Definition A vertex cover in a graph is a set of vertices S that includes at least one endpoint of every edge.

slide-36
SLIDE 36

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Vertex covers

Definition A vertex cover in a graph is a set of vertices S that includes at least one endpoint of every edge. Theorem In any bipartite graph, the number of edges in a maximum matching is equal to the number of vertices in a minimum vertex cover. Proof. Linear programming duality.

slide-37
SLIDE 37

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

General graphs

We can look at both of these problems in graphs that are not

  • bipartite. Such a graph also has vertices and edges, but the

vertices don’t have two types X and Y .

slide-38
SLIDE 38

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

General graphs

We can look at both of these problems in graphs that are not

  • bipartite. Such a graph also has vertices and edges, but the

vertices don’t have two types X and Y . For example: a b c d e Vertices {a, b, c, d, e} and edges {ab, bc, cd, de, ae}.

slide-39
SLIDE 39

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

General graphs

We can look at both of these problems in graphs that are not

  • bipartite. Such a graph also has vertices and edges, but the

vertices don’t have two types X and Y . For example: a b c d e Vertices {a, b, c, d, e} and edges {ab, bc, cd, de, ae}. One largest matching: {ab, cd}.

slide-40
SLIDE 40

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

General graphs

We can look at both of these problems in graphs that are not

  • bipartite. Such a graph also has vertices and edges, but the

vertices don’t have two types X and Y . For example: a b c d e Vertices {a, b, c, d, e} and edges {ab, bc, cd, de, ae}. One largest matching: {ab, cd}. One smallest vertex cover: {a, c, d}.

slide-41
SLIDE 41

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Strong duality fails!

For this non-bipartite graph, the theorem doesn’t work: the largest matching is smaller than the smallest vertex cover! What went wrong?

slide-42
SLIDE 42

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Strong duality fails!

For this non-bipartite graph, the theorem doesn’t work: the largest matching is smaller than the smallest vertex cover! What went wrong? Can still write down LPs for the largest matching and the smallest vertex cover.

slide-43
SLIDE 43

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Strong duality fails!

For this non-bipartite graph, the theorem doesn’t work: the largest matching is smaller than the smallest vertex cover! What went wrong? Can still write down LPs for the largest matching and the smallest vertex cover. These LPs are still dual and still have the same objective value.

slide-44
SLIDE 44

Bipartite incidence matrices are TU The dual problem: vertex covers Graphs that aren’t bipartite

Strong duality fails!

For this non-bipartite graph, the theorem doesn’t work: the largest matching is smaller than the smallest vertex cover! What went wrong? Can still write down LPs for the largest matching and the smallest vertex cover. These LPs are still dual and still have the same objective value. The constraint matrix is not totally unimodular! So the

  • ptimal solutions of the two LPs might be fractional, and not

actually give a matching or a vertex cover! In the example on the last slide: both LPs have an objective value of 2.5.