11.4 Bipartite Multigraphsbtravers.weebly.com/.../bipartite_multigraphs_slides.pdf · 2019. 1....

Preview:

Citation preview

11.4 Bipartite Multigraphs

Introduction

DefinitionA graph G is bipartite if we can partition the vertices into two disjointsubsets U and V such that every edge of G has one incident vertex inU and the other in V .

Examples

Notice the colors - the property of being bipartite is equivalent tobeing 2-colorable. We will come back to this next chapter.

Example

Suppose we had 5 workers and seven different tasks that could beperformed. If each worker can only perform one task at a time, howcan the tasks be assigned so that the most possible jobs can becompleted?

Worker Tasks1 1,2,3,4,72 4,53 4,54 1,5,65 1,6,7

Example (cont.)

The situation can be modeled as a bipartite graph.

W1• •T1

W2• •T2

W3• •T3

W4• •T4

W5• •T5

•T6

•T7

One Solution

W1• •T1

W2• •T2

W3• •T3

W4• •T4

W5• •T5

•T6

•T7

This solution is known as a matching.

Matchings

DefinitionA nonempty set M of edges in G is called a matching of G if no twoedges of M are incident with a common vertex.

Definition

A perfect matching has |V|2 edges.

Matchings

DefinitionA nonempty set M of edges in G is called a matching of G if no twoedges of M are incident with a common vertex.

Definition

A perfect matching has |V|2 edges.

Example

Three ladies x1, x2 and x3 are courted by 5 men y1 . . . y5. The bipartitegraph with bipartition (X,Y) shows the situation such that twovertices are adjacent if and only if the two persons would consent tomarry each other.

X •x1 •x2 •x3

Y •y1 •y2 •y3 •y4 •y5

1 Is {x1y1} a matching?2 Is {x1y1, x2y1} a matching?3 Is {x1y5, x2y1, x3y2} a matching?4 Find the number of matchings with three edges.

When is a graph bipartite?

TheoremA graph G is bipartite iff every circuit of G has even length.

Proof: Note that it is sufficient to prove the theorem for connectedbipartite graphs. We claim that if the theorem is true for eachconnected component of a disconnected bipartite graph G, then it istrue for G.This claim follows from G being bipartite iff each of its componentsis bipartite, and any circuit in G having even length iff any circuit ineach of its components has even length.

When is a graph bipartite?

TheoremA graph G is bipartite iff every circuit of G has even length.

Proof: Note that it is sufficient to prove the theorem for connectedbipartite graphs. We claim that if the theorem is true for eachconnected component of a disconnected bipartite graph G, then it istrue for G.

This claim follows from G being bipartite iff each of its componentsis bipartite, and any circuit in G having even length iff any circuit ineach of its components has even length.

When is a graph bipartite?

TheoremA graph G is bipartite iff every circuit of G has even length.

Proof: Note that it is sufficient to prove the theorem for connectedbipartite graphs. We claim that if the theorem is true for eachconnected component of a disconnected bipartite graph G, then it istrue for G.This claim follows from G being bipartite iff each of its componentsis bipartite, and any circuit in G having even length iff any circuit ineach of its components has even length.

Proof (cont.)

First we will show that if G is bipartite, then any circuit has evenlength. If G is bipartite so it can be drawn connecting a left vertexwith a right vertex, then any circuit x1 − x2 − x3 − . . .− xn − x1 hasalternately a left vertex, a right vertex, then a left vertex, and so on,assuming the first vertex x1 is on the left. Odd subscripted numbers onthe left and even subscripted numbers on the right. That is, there is aneven number of vertices in any circuit. Any circuit has the samenumber of edges as vertices, and thus this circuit has even length.

x1• •x2

x3• •x4

x5• •x6

......

xn−1• •xn

Proof (cont.)

Suppose next that any circuit in G (there may be no circuits) has evenlength. We show how to construct a bipartite arrangement of G byassuming a bipartition exists and using the properties of a bipartitionto construct one.

Take any vertex a and put it on the left. Put all vertices adjacent to aon the right. Next put all vertices that are two edges away from a, thatis, at the end of some path of length 2 from a, on the left. In general,if there is a path of odd length between a and a vertex x, put it on theright. If there is a path of even length between a and x, put x on theleft.There cannot be distinct paths P and P′ between a and x of odd andeven lengths, respectively, since taking P from a to x and thenreturning to a on P′ yields an odd length circuit. This is impossiblesince all circuits have even length.

Proof (cont.)

Suppose next that any circuit in G (there may be no circuits) has evenlength. We show how to construct a bipartite arrangement of G byassuming a bipartition exists and using the properties of a bipartitionto construct one.Take any vertex a and put it on the left. Put all vertices adjacent to aon the right. Next put all vertices that are two edges away from a, thatis, at the end of some path of length 2 from a, on the left. In general,if there is a path of odd length between a and a vertex x, put it on theright. If there is a path of even length between a and x, put x on theleft.

There cannot be distinct paths P and P′ between a and x of odd andeven lengths, respectively, since taking P from a to x and thenreturning to a on P′ yields an odd length circuit. This is impossiblesince all circuits have even length.

Proof (cont.)

Suppose next that any circuit in G (there may be no circuits) has evenlength. We show how to construct a bipartite arrangement of G byassuming a bipartition exists and using the properties of a bipartitionto construct one.Take any vertex a and put it on the left. Put all vertices adjacent to aon the right. Next put all vertices that are two edges away from a, thatis, at the end of some path of length 2 from a, on the left. In general,if there is a path of odd length between a and a vertex x, put it on theright. If there is a path of even length between a and x, put x on theleft.There cannot be distinct paths P and P′ between a and x of odd andeven lengths, respectively, since taking P from a to x and thenreturning to a on P′ yields an odd length circuit. This is impossiblesince all circuits have even length.

Proof (cont.)

Similarly, we argue that there cannot be an edge between vertices, sayb and c, both on the left. There must exist even length paths Q and Q′

joining a with b and c, respectively, since b and c are on the left.

a• Q •

• •

b• •

c•Q′

Proof(cont.)

a• Q •

• •

b• •

c•Q′

Observe that Q′ followed by the edge {c, b} yields an odd length pathfrom a to b. This is impossible, since we just proved that there cannotbe both an even length path (Q) and an odd length path (Q′ plus{a, b}) from a to any other vertex in G. By similar reasoning, twovertices on the right cannot be adjacent. This, we have a bipartitearrangement if G.

Another Theorem

TheoremLet G be a bipartite graph with bipartition (X,Y).

1 If |X| 6= |Y|, then G does not have a Hamiltonian cycle.

2 If |X| = |Y|, then G does not have a Hamiltonian path thatbegins at a vertex in X and ends at a vertex in X.

3 If |X| and |Y| differ by at least 2, then G does not have aHamiltonian path.

4 If |X| = |Y|+ 1, then G does not have a Hamiltonian path thatbegins at a vertex in X and ends at a vertex of Y, and vice versa.

Another Theorem

TheoremLet G be a bipartite graph with bipartition (X,Y).

1 If |X| 6= |Y|, then G does not have a Hamiltonian cycle.2 If |X| = |Y|, then G does not have a Hamiltonian path that

begins at a vertex in X and ends at a vertex in X.

3 If |X| and |Y| differ by at least 2, then G does not have aHamiltonian path.

4 If |X| = |Y|+ 1, then G does not have a Hamiltonian path thatbegins at a vertex in X and ends at a vertex of Y, and vice versa.

Another Theorem

TheoremLet G be a bipartite graph with bipartition (X,Y).

1 If |X| 6= |Y|, then G does not have a Hamiltonian cycle.2 If |X| = |Y|, then G does not have a Hamiltonian path that

begins at a vertex in X and ends at a vertex in X.3 If |X| and |Y| differ by at least 2, then G does not have a

Hamiltonian path.

4 If |X| = |Y|+ 1, then G does not have a Hamiltonian path thatbegins at a vertex in X and ends at a vertex of Y, and vice versa.

Another Theorem

TheoremLet G be a bipartite graph with bipartition (X,Y).

1 If |X| 6= |Y|, then G does not have a Hamiltonian cycle.2 If |X| = |Y|, then G does not have a Hamiltonian path that

begins at a vertex in X and ends at a vertex in X.3 If |X| and |Y| differ by at least 2, then G does not have a

Hamiltonian path.4 If |X| = |Y|+ 1, then G does not have a Hamiltonian path that

begins at a vertex in X and ends at a vertex of Y, and vice versa.

Complete Bipartite Graphs

DefinitionA bipartite graph is complete if each vertex in X is adjacent to everyvertex in Y .

Example

K2,3 • •

• •

Complete Bipartite Graphs

DefinitionA bipartite graph is complete if each vertex in X is adjacent to everyvertex in Y .

Example

K2,3 • •

• •

Complete Bipartite Graph

Example

K1,4 • •

• •

Complete bipartite graphs of the form K1,n are called stars.

The Knight’s Tour Problem

The knight’s tour problem involves the knight graph, which is a graphon vertices in which each vertex represents a square in an chessboard,and each edge corresponds to a legal move by a knight. The process isthis: begin with a square on the grid and and travel around the boardusing only ‘L’ shaped moves.

KK

K

DefinitionA knight’s tour is a sequence of moves by a knight such that eachsquare of the board is visited exactly once. It is therefore aHamiltonian path on the corresponding knight graph.

The Knight’s Tour Problem

The knight’s tour problem involves the knight graph, which is a graphon vertices in which each vertex represents a square in an chessboard,and each edge corresponds to a legal move by a knight. The process isthis: begin with a square on the grid and and travel around the boardusing only ‘L’ shaped moves.

KK

K

DefinitionA knight’s tour is a sequence of moves by a knight such that eachsquare of the board is visited exactly once. It is therefore aHamiltonian path on the corresponding knight graph.

When do knight’s tours exist?

ExampleDoes a knight’s tour exist for a 3× 3 board?

Consider the following board:

K

Where do we go from here?What if we started here?

K

When do knight’s tours exist?

ExampleDoes a knight’s tour exist for a 3× 3 board?

Consider the following board:

K

Where do we go from here?

What if we started here?

K

When do knight’s tours exist?

ExampleDoes a knight’s tour exist for a 3× 3 board?

Consider the following board:

K

Where do we go from here?What if we started here?

K

Knight’s Tours and Hamiltonian Graphs

Knight’s Tour

5 8 32 67 4 1

This corresponds to the graph:

1• •2

3• •4

5• •6

7• •8

9•

We could invoke the last theorem ...

Knight’s Tours and Hamiltonian Graphs

Knight’s Tour

5 8 32 67 4 1

This corresponds to the graph:

1• •2

3• •4

5• •6

7• •8

9•

We could invoke the last theorem ...

Knight’s Tours and Hamiltonian Graphs

Knight’s Tour

5 8 32 67 4 1

This corresponds to the graph:

1• •2

3• •4

5• •6

7• •8

9•

We could invoke the last theorem ...

Justification for 3× 3 board

TheoremLet G be a bipartite graph with bipartition (X,Y).

1 If |X| 6= |Y|, then G does not have a Hamiltonian cycle.2 If |X| = |Y|, then G does not have a Hamiltonian path that

begins at a vertex in X and ends at a vertex in X.3 If |X| and |Y| differ by at least 2, then G does not have a

Hamiltonian path.4 If |X| = |Y|+ 1, then G does not have a Hamiltonian path that

begins at a vertex in X and ends at a vertex of Y, and vice versa.

Results

Conrad et al. (1994) shows that a knight’s path exists on an n× nboard iff n ≥ 5. And for homework, you will provide an example forn = 5, 6, 7.

Recommended