0% found this document useful (0 votes)
9 views35 pages

Lecture 23 Filled

Uploaded by

Joy Song
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views35 pages

Lecture 23 Filled

Uploaded by

Joy Song
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

Discrete Mathematics

Lecture 23
2024 – 12 – 03

1/35
Some Information

Today:
¶ Objectives for §47:
… Basic notions of Graph Theory.
… There will probably be time to start §48.
To do:
¶ Read §48 by next class and do the pre-lecture quiz. Probably read §49 too.
¶ PS9 - the last one!

2/35
Introduction

1
Consider a neighborhood of three houses and three utilities (gas, water, sewer).

� � �

� � �
PlanaI
� Can each house be hooked up to each utility without crossing pipes?

2
Consider the 10 dominoes below.

� Can they be arranged, end to end with ends matching, in a ring?

FDI 4

3
In the city of Königsburg there were once seven bridges.

afoot
� Is it possible to stroll around the city and cross each bridge exactly once?

3/35
All the previous problems can be expressed in terms of graph theory.

Just like with number theory, graph theory is a pure subject that has seen wider
and wider applications recently.

4/35
Foundations

Definition: Graph
A graph is a pair G = (V, E), where
¶ V is a non-empty finite set, called the vertices of G
¶ E is a set of two-element subsets of V , called the edges of G.

� Note: The singular form of vertices is vertex.


4
The list ({1, 2, 3, 4, 5}, {{1, 2}, {2, 3}, {2, 4}, {3, 4}, {4, 5}}) is a graph.

5
The list
({monkey, donkey, cat, rat, dog}, {{monkey, donkey},{donkey, cat},{donkey, rat},{cat, rat},{rat, dog}})
is a graph.

In
We can visualize graphs by drawing a dot for every vertex, and a line/curve
between the two vertices in every edge.
tf
6
Let us visualize G = ({1, 2, 3, 4, 5}, {{1, 2}, {2, 3}, {2, 4}, {3, 4}, {4, 5}}).

WHY
1
a
ftp
� A single graph can have any number of visualizations. They represent the same
graph.

sieve ID
i N
III D
5/35
Adjacency

Definition: Adjacent Vertices


Let G = (V, E) be a graph, and u, v œ V . We say that u and v are adjacent and
write u ≥ v, if {u, v} œ E.

unu
� The word "connected" should not be used as a synonym, as in graph theory it
means something else.
In the graph ({1, 2, 3}, {{1, 2}.{2, 3}}):

15 13
1 and 2 are adjacent 1 and 3 are notadjacent
2 and 3 are adjacent
We now explore "simple graphs": no weights for edges, no directions in edges,
no loops, no multiple edges. Those generalizations are possible, but we will
follow the book and stick to the simple graphs.

p
Notice that adjacency is a relation on V .

G E
is therelation reflexive
NO
is it inreflexive
Yes
is it symmetric
Yes if an b then bra 6
is it antisymmetric 8T
ja I and bra then a 6

6 V

transitivity
in general no
But there are exceptions
6/35
Degree of a Vertex
G V E
Definition: Degree of a Vertex
Let G be a graph, and v a vertex of G.
¶ If u is a vertex adjacent to v, we say that u and v are neighbors.
¶ The neighborhood of v is the set of v’s neighbors:

N (v) = {u œ V : u ≥ v}

¶ The degree of v is the number of vertices adjacent to v.

d(v) = |N (v)|

7
G = ({1, 2, 3}, {{2, 3}})

if
1
2 434 1

8
G = ({1, 2, 3, 4, 5}, {{1, 2}, {2, 3}, {2, 4}, {3, 4}, {4, 5}})

x.
l
Iiii

7/35
Adjacency Matrices

G = ({1, 2, 3, 4, 5}, {{1, 2}, {2, 3}, {2, 4}, {3, 4}, {4, 5}})

FHF.FI
Let V = {v1 , v2 , ..., vn }. We create an n ◊ n matrix A by setting ai,j to be 1 if
vi ≥ vj and 0 otherwise. The matrix A is called the adjacency matrix of G. It
has only zeroes and ones in it.

v V2 Un
O
y o dig 95 4 the

Un o Aij_Hring

8/35
The Handshaking Lemma

Theorem: The "Handshaking Lemma"


ÿ
Let G = (V, E) be a graph. Then d(v) = 2|E|.
vœV

why handshaking number


ofhandshakes 2 Shorthand
handshakes

tTfG vEin terms of adjacency matrix


Q How ones are there in the
adjacency matrix
many
to each edge there are two ones in the adjacency
matrix
if e Zvi uj EE then there is 1in now i
columnj
and 1 in columni
nowj
So in total there are 2 E

U V2 Un
V1
v
01
IT sum up ones in 20W 1

deal
dluz
Un n

so divi 2E
n d un in
divi is the sum of ones in the matrix
9/35
More Notation and Terminology

Definition: Maximum and Minimum Degree, Regular


Let G = (V, E) be a graph.
¶ The maximum and minimum degrees of G are:

(G) = max{d(v) : v œ V }
”(G) = min{d(v) : v œ V }

Ifta
¶ G is regular if all vertices have the same degree. If that degree is r, G is

5
r-regular.
¶ V (G) = V and E(G) = E.
2 regulargraphs
9
Consider G = ({1, 2, 3, 4, 5, 6}, {{1, 2}, {2, 3}, {2, 4}, {3, 4}, {4, 5}}).
What are (G), ”(G)?

3 regulargraph
8 y
6 051
Definition: Order and Size
¶ The order of G is the number of vertices of G:

‹(G) = |V (G)|
V
¶ The size of G is the number of edges of G:

Á(G = |E(G)|
E F E
10
Consider G = ({1, 2, 3, 4, 5, 6}, {{1, 2}, {2, 3}, {2, 4}, {3, 4}, {4, 5}}).
What is the order of G? What is the size of G?

Definition: Complete an Edgeless graphs

¶ G is complete if every pair of two distinct vertices are adjacent. A complete


graph with n vertices is usually denoted as Kn .
¶ G is edgeless if no vertices are adjacent. An edgeless graph with n vertices
is usually denoted as En .

11
Illustrate K2 , K3 , K4 , K5 , K6 .

T.TT T.FI 10/35


Practice

Exercise 1
The three diagrams below represent different graphs. Write them as pairs of sets
of vertices and edges. Find the degree of each of the vertices and verify the
degree-edge formula.

(a) (b) 1
(c)
1 2 3 1 2 3
6 2

5 3
4 5 6 4 5 6
4

G V E
6 141,2 3,415,64 1124 42,34 13,64 46,54 2,54 35,4 44,144

11 3 IE
3 2d d 22 1E1

Eudlv
6
2 3 2 2t3 2

601

11/35
Exercise 2
Draw pictures of these graphs:
a) ({1, 2, 3, 4}, {{1, 2}, {2, 3}})
b) ({1, 2, 3, 4, 5}, {{1, 2}, {2, 3}, {3, 4}, {4, 5}, {5, 2}})
c) ({1, 2, 3, 4}, {{1, 2}, {1, 3}, {1, 4}, {2, 3}, {2, 4}, {3, 4}})
Find the degree of each of the vertices and verify the degree-edge formula.

in 11 E 2

did
Iii

12/35
Exercise 3
Let G be a graph. Prove that there must be an even number of vertices of odd
degree.

suation

atusiim.int ti
tintodddaison
EIETEdlul
Let to be Ietf vertices
ofodddegree and
Ve be the setofvertices ofeven degree
V Uve

du du 2 IE
E Evedlu

0
so

in
t.IE
We get a contradiction odd even

13/35
Exercise 4
How many edges are in Kn , a complete graph on n vertices?

ECK 4
1 21
an
to ambitalpossible

1 w 2 El

14/35
Moving ahead

¶ Objectives for §48:


… Introduce the notions related to subgraphs.

15/35
Introduction

12
Consider the following graph

2
1 3
10

AT 6
7 8

5
Δ 4

bit.ly/F24DML23a

a) How many vertices does it have?


b) How many edges does it have?
c) How many “triangles” (three vertices, each adjacent to the others)?
d) How many “tetrahedrons” (four vertices, each adjacent to the others)?

16/35
Subgraphs

Definition: Subgraph
Let G and H be graphs. We say that G is a subgraph of H if
¶ V (G) ™ V (H)
¶ E(G) ™ E(H)

13
Consider the graph

G = ({1, 2, 3}, {{1, 2}, {1, 3}, {2, 3}})

a) Is H1 = ({1, 2}, {{1, 2}}) a subgraph of G?


b) Is H2 = G a subgraph of G?
c) Is H3 = ( , ) a subgraph of G? notagraph
d) Is H4 = ({1, 2, 3}, ) a subgraph of G?
e) Is H5 = ({1, 2}, {{1, 2}, {1, 3}}) a subgraph of G?
bit.ly/F24DML23b
noFagraph

In other words, a subgraph of H consists of


¶ A (non-empty) subset of the vertices of H,
¶ A subset of the edges of H, which join vertices in that chosen subset of
vertices.

14
There are many subgraphs in the graph we saw before.

2 2 2
1 3 1 3 1 3
9 9 9

7 8 7 8 Tony7 8
4 4 4
6 6 6
5 5 5

17/35
Spanning Subgraph

Definition: Spanning Subgraph


A subgraph G of H is called a spanning subgraph of H provided V (G) = V (H).

In other words, a spanning subgraph consists of all of the vertices and some of
the edges.

2 2
1 3 1 3
9 9

6
7 8

2
5
4
6 É
7 8

2
5
4

1 3 1 3
9 9

7 8 7 8
4 4
6 6
5 5
2 2 allowed

ft
1 3 1 3
9 9

7 8 7 8
4 4
6 6
5 5

� Is G a spanning subgraph of G?
Yes
� What is the smallest spanning subgraph of G?

This relates tothe edgesTswe mustuse allthevertices


G VE
V1

18/35
Vertex and Edge Deletion

Definition: Vertex and Edge Deletion


G V E
Let G be a graph.
¶ if e œ E(G), we form the subgraph G ≠ e by

V (G ≠ e) = V (G)
E(G ≠ e) = E(G) ≠ {e}

¶ If v œ V , we form the subgraph G ≠ v by removing v and all edges


containing it:

V (G ≠ v) = V (G) ≠ {v}
E(G ≠ v) = E(G) ≠ {e œ E(G) : v œ e}

15
Let G be the graph below. 6 47,84 6 7
2
1

why
3
9

6
7 8

5
4

Draw G ≠ {7, 8} and G ≠ 7.


III 5 8 5
4

19/35
Induced Subgraph
2
Definition: Induced Subgraph

amIn
Suppose that H is a graph and A ™ V (H) is a non-empty set of vertices. The
subgraph of H induced by A is the graph H[A] defined by:

V (H[A]) = A
E(H[A]) = {{x, y} œ E(H) : x, y œ A}
any
Remarks:

I
¶ Sometimes the notation is simplified: If x, y œ V (H), and {x, y} œ E(H),
we could write xy for {x, y}.
Don’t make it confusing for the reader, though!
¶ The subgraph of H induced by A is the largest subgraph of H with vertex
set A.
HIAS
Txig4 xy
16
Consider the graph G illustrated below.
2

IT
1 3
9 3
7 8
4
6
5

Let S = {1, 2, 3, 5, 9}. Find G[S], the induced subgraph of G by S.

17
Suppose that G is a graph with ‹ vertices and Á edges.
a) How many subgraphs of G are spanning subgraphs?
b) How many subgraphs of G are induced subgraphs?

We misfallthevertices ofthegraph

É we can include none some all


Number satbettfofdsE.is
of 2E
6
21
20/35
Complete and Edgeless Graphs Nexttime
Definition: Complete and Edgeless Graphs

¶ A graph is called complete if every pair of vertices are adjacent.


¶ A graph is called edgeless if no vertices are adjacent.

18

19
Suppose G is a complete graph with 6 vertices.
a) How many spanning subgraphs does G have?
b) How many induced subgraphs does G have?

21/35
Cliques and Independent Sets

Definition: Cliques and Independent Sets


Let G be a graph, and S ™ V (G).
¶ The set S is called a clique of G if every pair of distinct vertices in S are
adjacent in G.
¶ The set S is called an independent set if no pair of distinct vertices in S are
adjacent in G.

Remarks:
¶ A non-empty set S is a clique iff G[S] is complete.
¶ A non-empty set S is an independent set iff G[S] is edgeless.

More remarks:
Suppose G = (V, E) is a graph.
¶ The empty set is a clique. All pairs of distinct vertices in are adjacent.
¶ If v œ V , then {v} is a clique. All pairs of distinct vertices in {v} are
adjacent.
� What is G[{v}]?

¶ If v, w œ V and v ≥ w, then {v, w} is a clique.


� What is G[{v, w}]?

¶ A clique of size three is what we call a triangle—three vertices, each of


which is adjacent to the others.

¶ A clique of size four is what we call a tetrahedron—four vertices, each of


which is adjacent to the others.

22/35
20
Other than the vertices and edges, find the cliques in the graph

2
1 3
9

7 8
4
6
5

23/35
21
Find the independent sets of order larger than 2 in the graph

2
1 3
9

7 8
4
6
5

24/35
Clique Number and Independence Number

Definition: Clique Number, Independence Number


Let G be a graph.
¶ The clique number of G is the cardinality of the largest clique. We denote
this number by Ê(G).
¶ The independence number of G is the size of the largest independent set.
We denote this number by –(G).

22
Find Ê and – for the graph
2
1 3
9

7 8
4
6
5

� Is there an easy way to find cliques, or the clique number of the graph?

¶ The so called "clique problem" is certified hard, i.e., NP-complete.


¶ The best known algorithm by Bron and Kerbosch is O(3n/3 ), of exponential
order.

25/35
Complements

Definition: Complement
Let G be a graph. The complement of G is the graph G defined by

V (G) = V (G)
E(G) = {{x, y} : x, y œ V (G), x , y, {x, y} < E(G)}

So the complement flips all the edges of a graph.

Proposition
Let G be a graph. Then

–(G) = Ê(G)
Ê(G) = –(G)

23
Draw the complement of the graph
2
1 3
9

7 8
4
6
5

26/35
Ramsey Theory

¶ Let G be a "very large" graph.


¶ A famous theorem in graph theory (Ramsey’s Theorem) implies that either
G or its complement, G, must have a "large" clique.
¶ This is one special case

Proposition: Friends-and-Strangers theorem


Let G be a graph with at least six vertices. Then Ê(G) Ø 3 or –(G) Ø 3.

� Why Friends-and-Strangers?

27/35
Exercise 5
Let G be the graph in the figure.

2
Scheinerman-5059 49421 4 February 02, 2012 14:32 343 a. G

1 3 5 6

Draw pictures of the following subgraphs.


Scheinerman-5059 49421 February 02, 2012 14:32 343

a) G ≠ 1

2 4 a. G

Scheinerman-50591 49421
3 February
5 02, 62012 14:32 343

b) G ≠ 3

2 4 a. G

G H

Scheinerman-50591 49421
3 February
5 02, 62012 14:32 343

c) G ≠ 6 G H

2 4 a. G

Scheinerman-50591 49421
3 February
5 02, 62012 14:32 343

d) G ≠ {1, 2} G H

2 4 a. G

Scheinerman-50591 49421
3 February
5 02, 62012 14:32 343

e) G ≠ {3, 5} G H

2 4 a. G

Scheinerman-50591 49421
3 February
5 02, 62012 14:32 343

f) G ≠ {5, 6} G H

2 4 a. G

Scheinerman-50591 3
49421 5
February 02, 62012 14:32 343

g) G[{1, 2, 3, 4}] G H

2 4 a. G

Scheinerman-50591 3
49421 5
February 02, 62012 14:32 343

h) G[{2, 4, 6}] G H

2 4 a. G

1 3 5 6

i) G[{1, 2, 4, 5}] G H

2 4 a. G

1 3 5 6

G H

28/35
Exercise 6
Let G and H be the two graphs in the figure.

G H

Find –(G), Ê(G), –(H), and Ê(H).

29/35
Exercise 7
Let X = {x1 , x2 , x3 , x4 , x5 } and Y = {y1 , y2 , y3 }. Consider the graph G with
V (G) = X fi Y ,and such that every vertex in X is adjacent to every vertex in Y ,
but there are no other edges in G.
a) Find all the maximal independent sets of G.
b) Find all the maximum independent sets of G.
c) Find all the maximal cliques of G.
d) Find all the maximum cliques of G.

30/35
Exercise 8
Find a graph G on five vertices for which Ê(G) < 3 and Ê(G) < 3. This shows
that the number six in Proposition 48.13 is best possible.

31/35
Exercise 9
Let G be a graph with ‹ vertices and Á edges. Let be the maximum degree of
the vertices of G, and let ” be the minimum degree of the vertices of G. Show
that
Á
a) 2 Ø ”

Á
b) 2 Æ

32/35
Exercise 10
If G is a simple graph with 15 edges and G has 13 edges, how many vertices
does G have?

33/35
Exercise 11
If the simple graph G has ‹ vertices and Á edges, how many edges does G have?

34/35
Exercise 12
Let G = Kn be a complete graph on n vertices.
a) How many spanning subgraphs does G have?
b) How many induced subgraphs does G have?

35/35

You might also like