Lecture 23 Filled
Lecture 23 Filled
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.
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.
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
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}
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
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
(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?
11
Illustrate K2 , K3 , K4 , K5 , K6 .
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
15/35
Introduction
12
Consider the following graph
2
1 3
10
AT 6
7 8
5
Δ 4
bit.ly/F24DML23a
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
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
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?
18/35
Vertex and Edge Deletion
V (G ≠ e) = V (G)
E(G ≠ e) = E(G) ≠ {e}
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
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
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
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
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}]?
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
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?
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)}
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
� 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
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
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