0% found this document useful (0 votes)
305 views

Graph Theory: Introduction. Distance in Graphs. Trees

Graph theory is the study of graphs, which are mathematical structures used to model pairwise relations between objects. A graph G consists of a set of vertices V and a set of edges E that connect the vertices. Common graph types include undirected graphs, directed graphs, weighted graphs, and labeled graphs. Some key concepts in graph theory include connectivity, cuts, paths, cycles, and operations on graphs like edge and vertex deletion. Theorems in graph theory relate the number of edges, vertices, and degrees of vertices in a graph. Graphs are frequently used to model problems across many domains.

Uploaded by

Raluca Romanov
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
305 views

Graph Theory: Introduction. Distance in Graphs. Trees

Graph theory is the study of graphs, which are mathematical structures used to model pairwise relations between objects. A graph G consists of a set of vertices V and a set of edges E that connect the vertices. Common graph types include undirected graphs, directed graphs, weighted graphs, and labeled graphs. Some key concepts in graph theory include connectivity, cuts, paths, cycles, and operations on graphs like edge and vertex deletion. Theorems in graph theory relate the number of edges, vertices, and degrees of vertices in a graph. Graphs are frequently used to model problems across many domains.

Uploaded by

Raluca Romanov
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

Graph Theory

Introduction. Distance in Graphs. Trees

Isabela Drămnesc UVT

Computer Science Department,


West University of Timişoara,
Romania

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 1 / 33


What is Graph Theory?

The study of graphs as mathematical structures G = (V , E ) used to


model pairwise relations (a.k.a. edges) between objects of a
collection V .
The objects are modeled as nodes (or vertices) of a set V
The pairwise relations are modeled as edges, which are
elements of a set E .
Graphs differ mainly by the types of edges between nodes.
Most common types of graphs are:
I Undirected: there is no distinction between the nodes
associated with each edge.
I Directed: edges are arcs from one node to another.
I Weighted: every edge has a weight which is typically a real
number.
I Labeled: every edge has its own label.
...

Graphs are among the most frequently used models in problem


solving.
Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 2 / 33
History of graph theory

1736: L. Euler publishes ”Seven Bridges of Königsberg” – first paper on graph


theory.

Later: Euler’s formula relating the number of edges, vertices, and faces of
a convex polyhedron ⇒ generalizations by Cauchy and L’Huillier ⇒ study
of topology and special classes of graphs.
1852: De Morgan introduces the“Four Color Map Conjecture”: four is the
minimum number of colors required to color any map where bordering regions
are colored differently.
1969: Heesch publishes a solving method
1976: computer-generated proof of K. Appel and W. Haken.
1878: The term “graph” was first used by Sylvester in a publication in Nature.
1936: D. König publishes first textbook on graph theory.

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 3 / 33


Introductory concepts
Vocabulary

Assumption: G = (V , E ) is a simple graph or digraph.


The order of G is |V |, the number of its nodes.
The size of G is |E |, the number of its edges.
The neighborhood of v ∈ V is N(v ) = {x ∈ V | (v , x) ∈ E }.
The closed neighborhood of v ∈ V is N[v ] = {v } ∪ N(v ).
The degree of v ∈ V is the number of edges incident with V :
deg(v ) = |{e ∈ E | e = (v , x) or e = (x, v ) for some x ∈ V }|
The maximum degree of G is ∆(G ) = max{deg(v ) | v ∈ V }.
The minimum degree of G is δ(G ) = min{deg(v ) | v ∈ V }.
The degree sequence of G with order n is the n-term sequence
(usually written in descending order) of the vertex degrees of
its nodes.

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 4 / 33


Introductory concepts
Example

a b c d

e f g h

G = (V , E ) where V = {a, b, c, d, e, f , g , h}, E = {{a, d}, {a, e},


{b, c}, {b, e}, {b, g }, {c, f }, {d, f }, {d, g }, {g , h}}
N(d) = {a, f , g }, N[d] = {a, d, f , g },
∆(G ) = deg(b) = 3
δ(G ) = deg(h) = 1,
The degree sequence is 3, 3, 3, 2, 2, 2, 2, 1

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 5 / 33


First Theorem of Graph Theory

Theorem
In a graph G , the sum of the degrees of the vertices is equal to
twice the number of edges. Consequently, the number of vertices
with odd degree is even.

Combinatorial
P proof.
Let S = v ∈V deg(v ). Notice that in counting S, we count each
edge exactly twice. Thus, S = 2|E | (the sum of the degrees is
twice the number of edges). Since
X X
S= deg (v ) + deg (v )
v ∈V v ∈V
deg (v ) even deg (v ) odd

and S is even, the second sum must be even, thus the number of
vertices with odd degree is even.

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 6 / 33


Introductory concepts
Perambulation and Connectivity

Assumption: G = (V , E ) is a simple graph or digraph.


A walk or path in G is a sequence of (not necessarily distinct)
nodes v1 , v2 , . . . , vk such that (vi , vi+1 ) ∈ E for
i = 1, 2, . . . , k − 1. Such a walk is sometimes called a v1 − vk
walk.
v1 and vk are the end vertices of the walk.
If the vertices in a walk are distinct, then the walk is called a
simple path.
If the edges in a walk are distinct, then the walk is called a
trail.
A cycle is a simple path v1 , . . . , vk (where k ≥ 3) together
with the edge (vk , v1 ).
A circuit or closed trail is a trail that begins and ends at the
same node.
The length of a walk (or simple path, trail, cycle, circuit) is its
number of edges, counting repetitions.
Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 7 / 33
Introductory concepts
Perambulation and Connectivity

Example
a

c b

d e

f g

a, c, f , c, b, d is a walk of length 5.
b, a, c, b, d is a trail of length 4.
d, g , b, a, c, f , e is a simple path of length 6.
g , d, b, c, a, b, g is a circuit.
e, d, b, a, c, f , e is a cycle.
Note that walks, trails and simple paths can have length 0. The
minimum length of a cycle or circuit is 3.

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 8 / 33


Second Theorem of Graph Theory
Theorem
In a graph G with vertices u and v , every u−v walk contains a
u−v simple path.

Proof. Let W be a u−v walk in G . We prove this theorem by


induction on the length of the walk W .
If W has length 1 or 2, then it is easy to see that W must be
a simple path.
For the induction hypothesis, suppose the result is true for all
walks of length < k and suppose W has length k. Say that
W is u = w0 , w1 , . . . , wk−1 , wk = v . If the nodes are distinct,
then W itself is the desired u−v simple path. If not, then let
j be the smallest integer such that wj = wr for some r > j.
Let W1 be the walk u = w0 , . . . , wj , wr +1 . . . , wk = v . This
walk has length strictly less than k, and thus W1 contains a
u−v simple path by induction hypothesis. Thus W contains a
simple u−v path.
Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 9 / 33
Operations on graphs
Assumptions: G = (V , E ) is a simple graph,
v ∈ V , S ⊆ V , e ∈ E, T ⊆ E
Vertex deletion:
G − v is the graph obtained by removing v and all edges
incident with v from G .
G − S is the graph obtained by removing each node of S and
each edge incident with a node of S from G .
Edge deletion:
G −e is the graph obtained by removing only the edge e from
G (its end nodes stay).
G −T is the graph obtained by removing each edge of T from
G.
G is connected if every pair of nodes can be joined by a path.
Otherwise, G is disconnected.
A component of G is a maximal connected piece of G .
v is a cut vertex if G − v has more components than G .
e is a bridge if G − e has more components than G .
Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 10 / 33
Operations on graphs and properties related to connectivity
Example (Deletion operations)
a a a a

b c b c b c b c

d d d
e f e f e f e f
g g g g

G −d G G −(c, d) G − {(e, g ), (f , g )}

d is a cut node in G . (a, b) is a bridge in G .

Example (Connected and disconnected graphs)

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 11 / 33


Graph-related notions
Node cut sets, connectivity, complete graphs

Assumption: G = (V , E ) is a graph.
∅=
6 S ( V is a node cut set of G if G − S is disconnected.
G is complete if every node is adjacent to every other node.
We write Kn for the complete graph with n nodes.
The complete graphs Kn have no node cut sets because Kn − S
is connected for all proper subsets S of the set of nodes.
If G is not complete then the connectivity of G , denoted by
κ(G ), is the minimum size of a node cut set of G .
If G is a connected and incomplete graph of order n, then
1 ≤ κ(G ) ≤ n − 2.
If G is disconnected, then κ(G ) = 0.
If G = Kn then we say that κ(G ) = n − 1.
If k > 0, we say that G is k-connected if k ≤ κ(G ).

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 12 / 33


Consequences of the definitions

1 A graph is connected if and only if κ(G ) ≥ 1.


2 κ(G ) ≥ 2 if and only if G is connected and has no cycles.
3 Every 2-connected graph contains at least one cycle.
4 For every graph G , κ(G ) ≤ δ(G ).

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 13 / 33


Exercises (1)

1. If G is a graph of order n, what is the maximum number of


edges in G ?
2. Prove that for any graph G of order at least 2, the degree
sequence has at least one pair of repeated entries.
3. Consider the complete graph K5 shown in the following figure.
b
c

d
e

a. How many different simple paths have c as an end vertex?


b. How many different simple paths avoid vertex c altogether?
c. What is the maximum length of a circuit in this graph? Give
an example of such a circuit.

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 14 / 33


Exercises (2)

4. Let G be a graph where δ(G ) ≥ k.


a. Prove that G has a simple path of length at least k.
b. If k ≥ 2, prove that G has a cycle of length at least k + 1.
5. Prove that every closed odd walk in a graph contains an odd
cycle.
6. Let P1 and P2 be two paths of maximum length in a
connected graph G . Prove that P1 and P2 have a common
vertex.
7. Prove that every 2-connected graph contains at least one
cycle.

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 15 / 33


Special types of graphs
Complete graphs Kn and empty graphs En

1 The complete graphs Kn . The graph Kn has order n and a


connection between every two nodes. Examples:

2 Empty graphs En . The graph En has order n and no edges.


Example:

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 16 / 33


Special types of graphs
Complements and regular graphs

Assumption: G = (V , E ) is a graph.
The complement of G is the graph G whose node set is the
same as that of G and whose
edge set consists of all the edges that are not in E . For example

G is regular if all its nodes have the same degree. G is


r -regular if deg(v ) = r for all nodes v in G .
Kn are (n − 1)-regular graphs; En are 0-regular graphs.

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 17 / 33


Special types of graphs
Cycles, paths, and subgraphs

The cycle Cn is simply a cycle on n vertices. Example: The


graph C7 looks as follows:

The graph Pn is a simple path on n vertices. For example, the


graph P6 looks as follows:

Given a graph G = (V , E ) and a subset S ⊆ V , the subgraph


of G induced by S, denoted hSiG , is the subgraph with vertex
set S and with edge set {(u, v )|u, v ∈ S and (u, v ) ∈ E }. So,
hSiG contains all vertices of S and all edges of G whose end
vertices are both in S.

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 18 / 33


Special types of graphs

Example: a graph and two of its induced subgraphs

A graph G = (V , E ) is bipartite if V can be partitioned into


two sets X and Y such that every edge of G has one end
vertex in X and the other in Y .
In this case, X and Y are called the partite sets.
A complete bipartite graph is a bipartite graph with partite
sets X and Y such that its edge set is
E = {(x, y ) | x ∈ X , y ∈ Y }.
Such a graph is complete bipartite graph denoted by K|X |,|Y | .

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 19 / 33


Special types of graphs: Examples
Bipartite graphs
The first two graphs in the following figure are bipartite, whereas
the third graph is not bipartite.

Complete bipartite graphs

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 20 / 33


Bipartite graphs
Characterization Theorem

Theorem
A graph with at least 2 nodes is bipartite if and only if it contains
no odd cycles.
Proof.
“⇒:” Let G = (V , E ) be a bipartite graph with partite sets X and Y ,
and let C = v1 , . . . , vk , v1 be a cycle in G . We can assume v1 ∈ X
w.l.o.g. Then vi ∈ X for all even i and vi ∈ Y for all odd i. Since
(vk , v1 ) ∈ E , we must have k even ⇒ we can not have an odd cycle in G .
“⇐:” We can assume w.l.o.g. that G is connected, for otherwise we
could treat each of its components separately.
Let v ∈ V and define
X = {x ∈ V | the shortest path from x to v has even length},
Y = V \ X.
It is easy to verify that G is a bipartite graph with partite sets X and Y .

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 21 / 33


Isomorphic graphs
Note that the following graphs are the same:

a b 1 2
c d 8 3

e f 7 4
g h 6 5

This is so because one graph can be redrawn to look like the other.

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 22 / 33


Isomorphic graphs
Note that the following graphs are the same:

a b 1 2
c d 8 3

e f 7 4
g h 6 5

This is so because one graph can be redrawn to look like the other.

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 22 / 33


Isomorphic graphs
Note that the following graphs are the same:

a b 1 2
c d 8 3

e f 7 4
g h 6 5

This is so because one graph can be redrawn to look like the other.
The idea of isomorphism formalizes this phenomenon.

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 22 / 33


Isomorphic graphs
Note that the following graphs are the same:

a b 1 2
c d 8 3

e f 7 4
g h 6 5

This is so because one graph can be redrawn to look like the other.
The idea of isomorphism formalizes this phenomenon.
Isomorphic graphs
Two graphs G = (V1 , E1 ) and H = (V2 , E2 ) are isomorphic if there
is a bijective mapping f : V1 → V2 such that (x, y ) ∈ E1 if and
only if (f (x), f (y )) ∈ E2 .
Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 22 / 33
Isomorphic graphs

When two graphs G and H are isomorphic, it is not


uncommon to simply say that “G = H” or that “G is H.”
If G and H are isomorphic then they have the same order and
size. The converse of this statement is not true, as seen in
Figure 1 below.

Figure: Two graphs G and H with same order and size, which are
not isomorphic.

If G and H are isomorphic then their degree sequences


coincide. The converse of this statement is not true.
Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 23 / 33
Exercises

1. For n ≥ 2 prove that Kn has n(n − 1)/2 edges.


2. Determine whether K4 is a subgraph of K4,4 . If yes, then
exhibit it. If no, then explain why not.
3. The line graph L(G ) of a graph G is defined in the following
way:
I the vertices of L(G ) are the edges of G , V (L(G )) = E (G ), and
I two vertices in L(G ) are adjacent if and only if the
corresponding edges in G share a vertex.
a. Find L(G ) for the graph

b. Find the complement of L(K5 ).

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 24 / 33


Distance in Graphs
Definitions

Assumption: G = (V , E ) is a connected graph.


The distance d(u, v ) from node u to node v in G is the
length of the shortest path u−v from u to v in G .
The eccentricity ecc(v ) of v in G is the greatest distance
from v to any other node.

Example

d(b, k) = 4, d(c, m) = 6.
ecc(a) = 5 since the farthest nodes from a are k, m, n, and they are a
distance 5 from a.

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 25 / 33


Distance in Graphs
More definitions

Assumption: G = (V , E ) is a connected graph.


The radius rad(G ) of G is the value of the smallest eccentricity.
The diameter diam(G ) of G is the value of the greatest eccentricity.
The center of G is the set of nodes v such that ecc(v ) = rad(G ).
The periphery of G is the set of nodes v such that
ecc(v ) = diam(G ).

Example

rad(G ) = 3 and diam(G ) = 6. The center of G is {e, f , g }.


The periphery of G is {c, k, m, n}.
Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 26 / 33
Distance in graphs
Properties

Theorem 1
For any connected graph G , rad(G ) ≤ diam(G ) ≤ 2 rad(G ).

Proof. By definition, rad(G ) ≤ diam(G ), so we just need to prove the


second inequality. Let u, v be nodes in G such that d(u, v ) = diam(G ).
Let c be a node in the center of G . Then
diam(G ) = d(u, v ) ≤ d(u, c) + d(c, v ) ≤ 2 ecc(c) = 2 rad(G ).
Theorem 2
Every graph G = (V , E ) is isomorphic to the center of some graph.

Proof. We construct a new graph H by adding 4 nodes w , x, y , z to G


along with the following edges:
{(w , x), (y , z)} ∪ {(x, a) | a ∈ V } ∪ {(b, y ) | b ∈ V }.
The newly constructed graph H looks as shown in the figure below.

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 27 / 33


Distance in graphs
Properties

Proof of Theorem 2 continued.

I ecc(w ) = ecc(z) = 4, ecc(y ) = ecc(x) = 3, and


I for any node v of G : ecc(v ) = 2.
Therefore G is the center of H.

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 28 / 33


Exercises

1. Find the radius, diameter and center of the following graph:

2. Find the radius and diameter of each of the following graphs:


P2k , P2k+1 , C2k , C2k+1 , Kn , and Km,n .
3. Given a connected graph G = (V , E ) and a positive integer k,
the k-th power of G , denoted G k , is the graph whose set of
nodes os V and where vertices u and v are adjacent in Gk if
and only if d(u, v ) ≤ k in G .
a. Draw the 2-nd and 3-rd powers of P8 and C10 .
b. For a graph G of order n, what is G diam(G ) ?

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 29 / 33


Trees
A tree is a connected graph which contains no cycles.

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 30 / 33


Trees
A tree is a connected graph which contains no cycles.
Quiz: Which ones are trees?

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 30 / 33


Trees
A tree is a connected graph which contains no cycles.
Quiz: Which ones are trees?

A forest is a graph whose connected components are trees. E.g., the


graph D is a forest.

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 30 / 33


Trees
A tree is a connected graph which contains no cycles.
Quiz: Which ones are trees?

A forest is a graph whose connected components are trees. E.g., the


graph D is a forest.
A leaf in a tree is a node with degree 1.

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 30 / 33


Trees
A tree is a connected graph which contains no cycles.
Quiz: Which ones are trees?

A forest is a graph whose connected components are trees. E.g., the


graph D is a forest.
A leaf in a tree is a node with degree 1.
Note that K1 and K2 are the only trees of order 1 and 2,
respectively. P3 is the only tree of order 3.
Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 30 / 33
Trees and forests
Properties

If T is a tree of order n, then T has n − 1 edges.


If F is a forest of order n containing k connected components,
then F contains n − k edges.
A graph of order n is a tree if and only if it is connected and
contains n − 1 edges.
A graph of order n is a tree if and only if it is acyclic and
contains n − 1 edges.
Let T be the tree of order n ≥ 2. Then T has at least two
leaves.
In any tree, the center is either a single vertex or a pair of
adjacent vertices.

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 31 / 33


Trees
Exercises

1 Show that every edge in a tree is a bridge.


2 Show that every nonleaf in a tree is a cut vertex.

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 32 / 33


References

J. M. Harris, J. L. Hirst, M. J. Mossinghoff. Combinatorics and


Graph Theory, Second Edition. Springer 2008.
Chapter 1: Graph Theory. Sections §1.1, §1.2 and §1.4.

Isabela Drămnesc UVT Graph Theory and Combinatorics – Lecture 8 33 / 33

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy