• No results found

Graph theory

N/A
N/A
Protected

Academic year: 2022

Share "Graph theory"

Copied!
53
0
0

Loading.... (view fulltext now)

Full text

(1)

CS 207m: Discrete Structures (Minor)

Graph theory

Matchings, maximum matchings, augmenting paths

Lecture 18 Mar 21 2018

(2)

Topic 3: Graph theory

Recap:

1. Basics: graphs, paths, cycles, walks, trails; connected graphs.

2. Eulerian graphs: characterization using degrees of vertices.

3. Bipartite graphs: characterization using odd length cycles.

4. Graph isomorphismsand automorphisms. 5. Subgraphsof a graph.

I Cliques and independent sets.

I A proof and algo for large bipartite subgraphs of a graph. 6. Connected components of a graph and a characterization of

cut-edges.

Reference: Most of Chapter 1 from Douglas West.

(3)

Topic 3: Graph theory

Recap:

1. Basics: graphs, paths, cycles, walks, trails; connected graphs.

2. Eulerian graphs: characterization using degrees of vertices.

3. Bipartite graphs: characterization using odd length cycles.

4. Graph isomorphismsand automorphisms.

5. Subgraphsof a graph.

I Cliques and independent sets.

I A proof and algo for large bipartite subgraphs of a graph. 6. Connected components of a graph and a characterization of

cut-edges.

Reference: Most of Chapter 1 from Douglas West.

(4)

Topic 3: Graph theory

Recap:

1. Basics: graphs, paths, cycles, walks, trails; connected graphs.

2. Eulerian graphs: characterization using degrees of vertices.

3. Bipartite graphs: characterization using odd length cycles.

4. Graph isomorphismsand automorphisms.

5. Subgraphsof a graph.

I Cliques and independent sets.

I A proof and algo for large bipartite subgraphs of a graph.

6. Connected components of a graph and a characterization of cut-edges.

Reference: Most of Chapter 1 from Douglas West.

(5)

Topic 3: Graph theory

Recap:

1. Basics: graphs, paths, cycles, walks, trails; connected graphs.

2. Eulerian graphs: characterization using degrees of vertices.

3. Bipartite graphs: characterization using odd length cycles.

4. Graph isomorphismsand automorphisms.

5. Subgraphsof a graph.

I Cliques and independent sets.

I A proof and algo for large bipartite subgraphs of a graph.

6. Connected components of a graph and a characterization of cut-edges.

Reference: Most of Chapter 1 from Douglas West.

(6)

This lecture, we will start a new topic:

Matchings

(7)

Matchings

I Supposem people are applying for ndifferent jobs. But not all applicants are qualified for all jobs, and each can hold at most one job.

I Then can you find a unique way to match jobs to applicants?

I What are the properties of such an assignment?

I Another practical example: the dating scene!

(8)

Matchings

I Supposem people are applying for ndifferent jobs. But not all applicants are qualified for all jobs, and each can hold at most one job.

I Then can you find a unique way to match jobs to applicants?

I What are the properties of such an assignment?

I Another practical example: the dating scene!

(9)

Matchings

I Supposem people are applying for ndifferent jobs. But not all applicants are qualified for all jobs, and each can hold at most one job.

I Then can you find a unique way to match jobs to applicants?

I What are the properties of such an assignment?

(10)

Matchings

Definitions

I A matchingin a graphG is a set of (non-loop) edges with no shared end-points.

I The vertices incident to edges in a matching are called matched orsaturated. Others are unsaturated.

I A perfect matchingin a graph is a matching that saturates every vertex.

I Is there a perfect matching if everyone is fully qualified/likes everyone?

I How many perfect matchings are possibly in Kn,n?

(11)

Matchings

Definitions

I A matchingin a graphG is a set of (non-loop) edges with no shared end-points.

I The vertices incident to edges in a matching are called matched orsaturated. Others are unsaturated.

I A perfect matchingin a graph is a matching that saturates every vertex.

I Is there a perfect matching if everyone is fully qualified/likes everyone?

I How many perfect matchings are possibly in Kn,n?

(12)

Matchings

Definitions

I A matchingin a graphG is a set of (non-loop) edges with no shared end-points.

I The vertices incident to edges in a matching are called matched orsaturated. Others are unsaturated.

I A perfect matchingin a graph is a matching that saturates every vertex.

I Is there a perfect matching if everyone is fully qualified/likes everyone?

I How many perfect matchings are possibly in Kn,n?

(13)

Matchings in general graphs

I A matchingin a graphG is a set of (non-loop) edges with no shared end-points.

I The vertices incident to edges in a matching are called matched orsaturated. Others are unsaturated.

I A perfect matchingin a graph is a matching that saturates every vertex.

I Example: Consider the problem of choosing roommates from a bunch ofnpeople who may like or not like everyone.

I Or study-pairs...

How many perfect matchings are possible inKn?

I If even, i.e., forK2n, no. of perfect matchings f(n) = (2n−1)f(n−1) = (2n)!2nn!.

(14)

Matchings in general graphs

I A matchingin a graphG is a set of (non-loop) edges with no shared end-points.

I The vertices incident to edges in a matching are called matched orsaturated. Others are unsaturated.

I A perfect matchingin a graph is a matching that saturates every vertex.

I Example: Consider the problem of choosing roommates from a bunch ofnpeople who may like or not like everyone.

I Or study-pairs...

How many perfect matchings are possible inKn?

I If even, i.e., forK2n, no. of perfect matchings f(n) = (2n−1)f(n−1) = (2n)!2nn!.

(15)

Matchings in general graphs

I A matchingin a graphG is a set of (non-loop) edges with no shared end-points.

I The vertices incident to edges in a matching are called matched orsaturated. Others are unsaturated.

I A perfect matchingin a graph is a matching that saturates every vertex.

I Example: Consider the problem of choosing roommates from a bunch ofnpeople who may like or not like everyone.

I Or study-pairs...

How many perfect matchings are possible inKn?

I If even, i.e., forK2n,

no. of perfect matchings f(n) = (2n−1)f(n−1) = (2n)!2nn!.

(16)

Matchings in general graphs

I A matchingin a graphG is a set of (non-loop) edges with no shared end-points.

I The vertices incident to edges in a matching are called matched orsaturated. Others are unsaturated.

I A perfect matchingin a graph is a matching that saturates every vertex.

I Example: Consider the problem of choosing roommates from a bunch ofnpeople who may like or not like everyone.

I Or study-pairs...

How many perfect matchings are possible inKn?

I If even, i.e., forK2n, no. of perfect matchings f(n) = (2n−1)f(n−1)

= (2n)!2nn!.

(17)

Matchings in general graphs

I A matchingin a graphG is a set of (non-loop) edges with no shared end-points.

I The vertices incident to edges in a matching are called matched orsaturated. Others are unsaturated.

I A perfect matchingin a graph is a matching that saturates every vertex.

I Example: Consider the problem of choosing roommates from a bunch ofnpeople who may like or not like everyone.

I Or study-pairs...

How many perfect matchings are possible inKn?

I If even, i.e., forK2n, no. of perfect matchings f(n) = (2n−1)f(n−1) = (2n)!2nn!.

(18)

Matchings in general graphs

I A matchingin a graphG is a set of (non-loop) edges with no shared end-points.

I The vertices incident to edges in a matching are called matched orsaturated. Others are unsaturated.

I A perfect matchingin a graph is a matching that saturates every vertex.

I Consider the problem of choosing roommates from a bunch of npeople who may like or not like everyone.

I Or study-pairs...

How many perfect matchings are possible inKn?

I If even, then f(n) = (2n−1)f(n−1) = (2n)!2nn!.

(19)

Matchings in general graphs

I A matchingin a graphG is a set of (non-loop) edges with no shared end-points.

I The vertices incident to edges in a matching are called matched orsaturated. Others are unsaturated.

I A perfect matchingin a graph is a matching that saturates every vertex.

I Consider the problem of choosing roommates from a bunch of npeople who may like or not like everyone.

I Or study-pairs...

How many perfect matchings are possible inKn?

I If even, then f(n) = (2n−1)f(n−1) = (2n)!2nn!.

(20)

Matchings in general graphs

I A matchingin a graphG is a set of (non-loop) edges with no shared end-points.

I The vertices incident to edges in a matching are called matched orsaturated. Others are unsaturated.

I A perfect matchingin a graph is a matching that saturates every vertex.

I Consider the problem of choosing roommates from a bunch of npeople who may like or not like everyone.

I Or study-pairs...

How many perfect matchings are possible inKn?

I If even, then

f(n) = (2n−1)f(n−1) = (2n)!2nn!.

(21)

Matchings in general graphs

I A matchingin a graphG is a set of (non-loop) edges with no shared end-points.

I The vertices incident to edges in a matching are called matched orsaturated. Others are unsaturated.

I A perfect matchingin a graph is a matching that saturates every vertex.

I Consider the problem of choosing roommates from a bunch of npeople who may like or not like everyone.

I Or study-pairs...

How many perfect matchings are possible inKn?

I If even, then f(n) = (2n−1)f(n−1)

= (2n)!2nn!.

(22)

Matchings in general graphs

I A matchingin a graphG is a set of (non-loop) edges with no shared end-points.

I The vertices incident to edges in a matching are called matched orsaturated. Others are unsaturated.

I A perfect matchingin a graph is a matching that saturates every vertex.

I Consider the problem of choosing roommates from a bunch of npeople who may like or not like everyone.

I Or study-pairs...

How many perfect matchings are possible inKn?

I If even, then f(n) = (2n−1)f(n−1) = (2n)!2nn!.

(23)

Maximum matchings

Since we have seen that perfect matchings are not always possible, we can ask what is the best we can do.

Definition

Amaximal matching in a graph is a matching that cannot be enlarged by adding an edge. Amaximummatching is a matching of maximum size among all matchings in a graph.

I A matching is maximal if every edge not in it is incident to some edge in it.

I Does maximum matching imply maximal? Does maximal imply maximum?

I Find the smallest graph that has a maximal matching that is not maximum. P4.

(24)

Maximum matchings

Since we have seen that perfect matchings are not always possible, we can ask what is the best we can do.

Definition

Amaximal matching in a graph is a matching that cannot be enlarged by adding an edge.

A maximummatching is a matching of maximum size among all matchings in a graph.

I A matching is maximal if every edge not in it is incident to some edge in it.

I Does maximum matching imply maximal? Does maximal imply maximum?

I Find the smallest graph that has a maximal matching that is not maximum. P4.

(25)

Maximum matchings

Since we have seen that perfect matchings are not always possible, we can ask what is the best we can do.

Definition

Amaximal matching in a graph is a matching that cannot be enlarged by adding an edge. Amaximum matching is

a matching of maximum size among all matchings in a graph.

I A matching is maximal if every edge not in it is incident to some edge in it.

I Does maximum matching imply maximal? Does maximal imply maximum?

I Find the smallest graph that has a maximal matching that is not maximum. P4.

(26)

Maximum matchings

Since we have seen that perfect matchings are not always possible, we can ask what is the best we can do.

Definition

Amaximal matching in a graph is a matching that cannot be enlarged by adding an edge. Amaximum matching is a matching of maximum size among all matchings in a graph.

I A matching is maximal if every edge not in it is incident to some edge in it.

I Does maximum matching imply maximal? Does maximal imply maximum?

I Find the smallest graph that has a maximal matching that is not maximum. P4.

(27)

Maximum matchings

Since we have seen that perfect matchings are not always possible, we can ask what is the best we can do.

Definition

Amaximal matching in a graph is a matching that cannot be enlarged by adding an edge. Amaximum matching is a matching of maximum size among all matchings in a graph.

I A matching is maximal if every edge not in it is incident to some edge in it.

I Does maximum matching imply maximal? Does maximal imply maximum?

I Find the smallest graph that has a maximal matching that is not maximum. P4.

(28)

Maximum matchings

Since we have seen that perfect matchings are not always possible, we can ask what is the best we can do.

Definition

Amaximal matching in a graph is a matching that cannot be enlarged by adding an edge. Amaximum matching is a matching of maximum size among all matchings in a graph.

I A matching is maximal if every edge not in it is incident to some edge in it.

I Does maximum matching imply maximal?

Does maximal imply maximum?

I Find the smallest graph that has a maximal matching that is not maximum. P4.

(29)

Maximum matchings

Since we have seen that perfect matchings are not always possible, we can ask what is the best we can do.

Definition

Amaximal matching in a graph is a matching that cannot be enlarged by adding an edge. Amaximum matching is a matching of maximum size among all matchings in a graph.

I A matching is maximal if every edge not in it is incident to some edge in it.

I Does maximum matching imply maximal? Does maximal imply maximum?

I Find the smallest graph that has a maximal matching that is not maximum. P4.

(30)

Maximum matchings

Since we have seen that perfect matchings are not always possible, we can ask what is the best we can do.

Definition

Amaximal matching in a graph is a matching that cannot be enlarged by adding an edge. Amaximum matching is a matching of maximum size among all matchings in a graph.

I A matching is maximal if every edge not in it is incident to some edge in it.

I Does maximum matching imply maximal? Does maximal imply maximum?

I Find the smallest graph that has a maximal matching that is not maximum.

P4.

(31)

Maximum matchings

Since we have seen that perfect matchings are not always possible, we can ask what is the best we can do.

Definition

Amaximal matching in a graph is a matching that cannot be enlarged by adding an edge. Amaximum matching is a matching of maximum size among all matchings in a graph.

I A matching is maximal if every edge not in it is incident to some edge in it.

I Does maximum matching imply maximal? Does maximal imply maximum?

I Find the smallest graph that has a maximal matching that is not maximum. P4.

(32)

Matchings: Pop Quiz

Give an example of the following, if possible:

1. A maximal matching inGwhich is not a maximum matching.

2. A maximum matching inG. How do you know it is maximum?

3. Can there be more than one maximum matching in a graph?

4. A graph which has no perfect matching but has a maximum matching. Is Gsuch a graph?

(33)

Matchings: Pop Quiz

I Perfect matching =⇒ maximum matching =⇒ maximal matching

I The reverse directions in the above implications do not hold.

(34)

Alternating and Augmenting paths

Definition

I Given a matching M, an M-alternating pathis a path that alternates between edges in M and edges not in M.

I An M-alternating path whose endpoints are unmatched by M is an M-augmenting path.

(35)

Alternating and Augmenting paths

Definition

I Given a matching M, an M-alternating pathis a path that alternates between edges in M and edges not in M.

I An M-alternating path whose endpoints are unmatched by M is an M-augmenting path.

I Give an example of a matching M inG and

1. aM-alternating path which is anM-augmenting path and

(36)

Alternating and Augmenting paths

Definition

I Given a matching M, an M-alternating pathis a path that alternates between edges in M and edges not in M.

I An M-alternating path whose endpoints are unmatched by M is an M-augmenting path.

(37)

Characterization of Maximum matchings

I Clearly, a maximum matching cannot have an M-augmenting path.

I In fact, this is the characterization! Theorem

A matchingM inGis a maximum matching iff Ghas no M-augmenting path.

(38)

Characterization of Maximum matchings

I Clearly, a maximum matching cannot have an M-augmenting path.

I In fact, this is the characterization!

Theorem

A matchingM inGis a maximum matching iff Ghas no M-augmenting path.

(39)

Characterization of Maximum matchings

I Clearly, a maximum matching cannot have an M-augmenting path.

I In fact, this is the characterization!

Theorem

A matchingM inGis a maximum matching iffG has no M-augmenting path.

(40)

Characterizing maximum matchings

We need a definition and a lemma.

Definition

IfM, M0 are matchings in a graphH, the symmetric difference M4M0 is the set of edges which are either inM or inM0 but not both, i.e.,M4M0= (M\M0)∪(M0\M).

(41)

Characterizing maximum matchings

We need a definition and a lemma.

Definition

IfM, M0 are matchings in a graphH, the symmetric difference M4M0 is the set of edges which are either inM or inM0 but not both, i.e.,M4M0= (M\M0)∪(M0\M).

(42)

Characterizing maximum matchings

We need a definition and a lemma.

Definition

IfM, M0 are matchings in a graphH, the symmetric difference M4M0 is the set of edges which are either inM or inM0 but not both, i.e.,M4M0= (M\M0)∪(M0\M).

What is the symmetric difference ofM (red) andM0 (green) in the above graph?

(43)

Characterizing maximum matchings

Lemma

Every component of the symmetric difference of two matchings is either a path or an even cycle.

I Let F =M4M0. F has at most 2 edges at each vertex, hence every component is a path or a cycle.

I Further every path/cycle alternates between edges of M \M0 and M0\M.

I Thus, each cycle has even length with equal edges from M and M0.

(44)

Characterizing maximum matchings

Lemma

Every component of the symmetric difference of two matchings is either a path or an even cycle.

I Let F =M4M0. F has at most 2 edges at each vertex, hence every component is a path or a cycle.

I Further every path/cycle alternates between edges of M \M0 and M0\M.

I Thus, each cycle has even length with equal edges from M and M0.

(45)

Characterizing maximum matchings

Lemma

Every component of the symmetric difference of two matchings is either a path or an even cycle.

I Let F =M4M0. F has at most 2 edges at each vertex, hence every component is a path or a cycle.

I Further every path/cycle alternates between edges of M \M0 andM0\M.

I Thus, each cycle has even length with equal edges from M and M0.

(46)

Characterizing maximum matchings

Lemma

Every component of the symmetric difference of two matchings is either a path or an even cycle.

I Let F =M4M0. F has at most 2 edges at each vertex, hence every component is a path or a cycle.

I Further every path/cycle alternates between edges of M \M0 andM0\M.

I Thus, each cycle has even length with equal edges from M

(47)

Characterizing maximum matchings

Theorem (Berge’57)

A matchingM inGis a maximum matching iffG has no M-augmenting path.

Proof:

I One direction is trivial (which one?!).

I (⇐=) For the other, we will show the contrapositive.

I i.e., if ∃ matchingM0 larger than M, we will construct an M-augmenting path.

I Let F =M4M0. By Lemma, F has only paths and even cycles with equal no. of edges from M and M0.

I But then since |M0|>|M|it must have a component with more edges in M0 than M.

I This component can only be a path that starts and ends with an edge of M0; i.e., it is an M-augmenting path in G.

(48)

Characterizing maximum matchings

Theorem (Berge’57)

A matchingM inGis a maximum matching iffG has no M-augmenting path.

Proof:

I One direction is trivial (which one?!).

I (⇐=) For the other, we will show the contrapositive.

I i.e., if ∃ matchingM0 larger than M, we will construct an M-augmenting path.

I Let F =M4M0. By Lemma, F has only paths and even cycles with equal no. of edges from M and M0.

I But then since |M0|>|M|it must have a component with more edges in M0 than M.

I This component can only be a path that starts and ends with an edge of M0; i.e., it is an M-augmenting path in G.

(49)

Characterizing maximum matchings

Theorem (Berge’57)

A matchingM inGis a maximum matching iffG has no M-augmenting path.

Proof:

I One direction is trivial (which one?!).

I (⇐=) For the other, we will show the contrapositive.

I i.e., if ∃ matchingM0 larger than M, we will construct an M-augmenting path.

I Let F =M4M0. By Lemma, F has only paths and even cycles with equal no. of edges from M and M0.

I But then since |M0|>|M|it must have a component with more edges in M0 than M.

I This component can only be a path that starts and ends with an edge of M0; i.e., it is an M-augmenting path in G.

(50)

Characterizing maximum matchings

Theorem (Berge’57)

A matchingM inGis a maximum matching iffG has no M-augmenting path.

Proof:

I One direction is trivial (which one?!).

I (⇐=) For the other, we will show the contrapositive.

I i.e., if ∃ matchingM0 larger than M, we will construct an M-augmenting path.

I Let F =M4M0. By Lemma, F has only paths and even cycles with equal no. of edges from M and M0.

I But then since |M0|>|M|it must have a component with more edges in M0 than M.

I This component can only be a path that starts and ends with an edge of M0; i.e., it is an M-augmenting path in G.

(51)

Characterizing maximum matchings

Theorem (Berge’57)

A matchingM inGis a maximum matching iffG has no M-augmenting path.

Proof:

I One direction is trivial (which one?!).

I (⇐=) For the other, we will show the contrapositive.

I i.e., if ∃ matchingM0 larger than M, we will construct an M-augmenting path.

I Let F =M4M0. By Lemma, F has only paths and even cycles with equal no. of edges from M and M0.

I But then since |M0|>|M|it must have a component with more edges in M0 than M.

I This component can only be a path that starts and ends with an edge of M0; i.e., it is an M-augmenting path in G.

(52)

Characterizing maximum matchings

Theorem (Berge’57)

A matchingM inGis a maximum matching iffG has no M-augmenting path.

Proof:

I One direction is trivial (which one?!).

I (⇐=) For the other, we will show the contrapositive.

I i.e., if ∃ matchingM0 larger than M, we will construct an M-augmenting path.

I Let F =M4M0. By Lemma, F has only paths and even cycles with equal no. of edges from M and M0.

I But then since |M0|>|M|it must have a component with more edges in M0 than M.

I This component can only be a path that starts and ends with an edge of M0; i.e., it is an M-augmenting path in G.

(53)

Characterizing maximum matchings

Theorem (Berge’57)

A matchingM inGis a maximum matching iffG has no M-augmenting path.

Proof:

I One direction is trivial (which one?!).

I (⇐=) For the other, we will show the contrapositive.

I i.e., if ∃ matchingM0 larger than M, we will construct an M-augmenting path.

I Let F =M4M0. By Lemma, F has only paths and even cycles with equal no. of edges from M and M0.

I But then since |M0|>|M|it must have a component with more edges in M0 than M.

I This component can only be a path that starts and ends

0

References

Related documents

The median graph of a connected cograph is the subgraph induced by the vertices of maximum degree in

A graph is called Eulerian if it has a closed walk that contains all edges, and each edge occurs exactly once.. Such a walk is called an

motivations, but must balance the multiple conflicting policies and regulations for both fossil fuels and renewables 87 ... In order to assess progress on just transition, we put

In Section 3 we prove that given an antimedian graph and a vertex x that is not antimedian of any triple of vertices, the multiplication with respect to x gives a larger

After extraction, matching of the test image with the template images stored in the database are matched using minutiae (point-to-point pattern).. An orientation detector which

The cliques of ∆(G) are induced by the vertices corresponding to the edges of G incident on a vertex of degree at least 3 whose other end vertices induce a complete graph and by

3, Chapter 3, the 6 bp sequence at the 5 ′ end of the vertices is the recognition site for the respective enzyme. 143 A.9 DNA sequences for the edges used to solve Problem 3,

This proximity data of all app users are used to build a temporal contact graph, where vertices are devices, and edges indicate proximity between devices for a certain time