Graph Theory Note

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 115

Graphs

An Introductory Approach by Robin J. Wilson & John J. Watkins


Chapter 1. What is a graph?
Definition.
A graph G is a diagram consists of a set of elements called vertices and
a list of unordered pairs of these elements called edges.
• The set of vertices of a graph G is called the vertex-set of G (denoted by V(G))
• The list of edges of G is called the edge-list of G (denoted by E(G))
Examples. Consider the following graph.

 uu ,uv ,ux ,vx ,vw ,wx ,wx , xy 


Examples

electrical network a road map


Remarks
1) Since 𝑢𝑣 ∈ 𝐸(𝐺), we say that 𝑢𝑣 join 𝑢 and 𝑣.
2) The graph G can be represented in many ways. For example,
we can represent G as:

3) The vertices 𝑥 and 𝑤 are joined by two edges. These edges are called multiple edges.
4) An edge joining the vertex 𝑢 to itself is called a loop.
5) A graph with no loops or multiple edges is called a simple graph.
Definition.
A graph G is called connected if it is in one piece (So that any two
vertices are connected by a path). Otherwise, it is
called disconnected.
Examples

Non-simple and
Simple and connected Simple and disconnected disconnected
Definition. (Subgraph)
Let G be a graph with vertex-set V(G) and edge-list E(G). A graph (H, V(H), E(H))
is called a subgraph of (G, V(G), E(G)) if 𝑉(𝐻) ⊆ 𝑉(𝐺) and 𝐸(𝐻) ⊆ 𝐸(𝐺).
Example. Consider the following graphs G
and H. Then 𝑉 𝐺 = 𝑢, 𝑣, 𝑤, 𝑥, 𝑦 ,
𝐸 𝐺 = 𝑢𝑣, 𝑢𝑦, 𝑣𝑤, 𝑣𝑦, 𝑤𝑦, 𝑤𝑥, 𝑥𝑦 .
𝑉 𝐻 = 𝑢, 𝑤, 𝑥, 𝑦 ⊆ 𝑉(𝐺) and
𝐸 𝐻 = 𝑢𝑦, 𝑤𝑦, 𝑤𝑥, 𝑥𝑦 ⊆ 𝐸(𝐺).
Therefore, H is a subgraph of G.
Example. Consider the following graphs G
and H. Then H is a subgraph of G
Definition. (The degree of a vertex).
Let G be a graph without loops and let v be a vertex of G. The degree of v
(denoted by deg(𝑣)) is the number of edges meeting at v. If G contains loops,
then each loop contributes 2 to the degree of the corresponding vertex.
The degree sequence of G: Listing the degrees of vertices of G
in a non-decreasing order.
Example. Consider the following graph. Then
deg 𝑢 = 3 deg 𝑣 = 8 deg 𝑝 = 0
deg 𝑤 = 6 deg 𝑧 = 1
The degree sequence of G is (0,1,3,6,8).
Exercise. Find the degree of each vertex of G and the degree
Sequence of G.
Definition (Regular graphs).
A graph G is called regular if all of its vertices have the same degree r.
Example. The following graphs are regular:

𝑟=0 𝑟=2 𝑟=3 𝑟=4

Remark.
We note in the following graph that:
Sum of vertex-degrees = 0 + 1 + 3 + 6 + 8 = 18.
Number of edges = 9
Handshaking Lemma
In any graph, the sum of all vertex-degrees is equal to twice the number of edges.
෍(𝑣𝑒𝑟𝑡𝑒𝑥 − 𝑑𝑒𝑔𝑟𝑒𝑒) = 2(#𝑒𝑑𝑔𝑒𝑠)

Proof.
Since each edge has two ends, it must contributes 2 to the sum of vertex-degrees.
Consequences of H. S. Lemma
Let G be a graph.
1) The sum of all vertex-degrees of G is an even integer.
Proof. Clear.
2) The number of vertices of odd degree is even.
Proof. Suppose that the number of vertices of odd degree is odd. Then:
The sum of vertex-degree of these vertices is 𝑜𝑑𝑑 + 𝑜𝑑𝑑 + ⋯ + 𝑜𝑑𝑑 = 𝑜𝑑𝑑.
𝑜𝑑𝑑−𝑡𝑖𝑚𝑒𝑠
The sum of vertex-degree of the other vertices = 𝑒𝑣𝑒𝑛.
Thus, σ(𝑣𝑒𝑟𝑡𝑒𝑥 − 𝑑𝑒𝑔𝑟𝑒𝑒) = odd + even = odd, a contradiction.
1
3) If G has n vertices and is regular of degree r , then G has exactly 𝑛𝑟 edges.
2
Proof.
σ(𝑣𝑒𝑟𝑡𝑒𝑥 − 𝑑𝑒𝑔𝑟𝑒𝑒) = 𝑛𝑟 = 2(#edges).
1
Therefore, #edges = 𝑛𝑟.
2
Examples.
1) The following graph is regular with 𝑟 = 4 and 𝑛 = 5.
1 1
#edges = 𝑛𝑟 = 5 4 = 10.
2 2
2) The following graph is regular with 𝑟 = 3 and 𝑛 = 10.
1 1
#edges = 𝑛𝑟 = 10 3 = 15.
2 2
Example.
Is there any graph with 9 vertices which is regular of degree 3 ?
Solution.
No. Since otherwise σ(𝑣𝑒𝑟𝑡𝑒𝑥 − 𝑑𝑒𝑔𝑟𝑒𝑒) = 9 3 = 27 (odd) which
Contradicts H. S. Lemma.
Isomorphic graphs.
• Consider the following two graphs G and H. Then
𝑉 𝐺 = 𝑎, 𝑏, 𝑐, 𝑑, 𝑒 = 𝑉 𝐻 and
𝐸 𝐺 = 𝑎𝑏, 𝑎𝑏, 𝑎𝑑, 𝑏𝑒, 𝑐𝑑, 𝑑𝑒, 𝑒𝑒 = 𝐸(𝐻)
Therefore, we have 𝐺 = 𝐻

• Consider the following two graphs G and H. Then


𝑉 𝐺 = 𝑎, 𝑏, 𝑐, 𝑑, 𝑒 𝑉 𝐻 = 𝑢, 𝑣, 𝑤, 𝑥, 𝑦
𝐸 𝐺 = 𝑎𝑏, 𝑎𝑏, 𝑎𝑑, 𝑏𝑒, 𝑐𝑑, 𝑑𝑒, 𝑒𝑒
𝐸 𝐻 = 𝑥𝑣, 𝑥𝑣, 𝑥𝑢, 𝑣𝑦, 𝑤𝑢, 𝑢𝑦, 𝑦𝑦
If we interchange the vertices of G as:
𝑎→𝑥 𝑏→𝑣
𝑐→𝑤 𝑑→𝑢 𝑒→𝑦
we get the graph H.
In this case, we say that G and H are isomorphic.
(We write 𝐺 ≅ 𝐻)
Definition.
Two graphs G and H are isomorphic if H can be obtained from G by relabeling the vertices.
That is, if there is a one to one correspondence between the vertices of G and those of
H such that the number of edges joining any pair of vertices in G is equal to the number
of edges joining the corresponding pair of vertices in H

Example.
The following graphs G and H are isomorphic
Proof. Consider the following correspondence
between V(G) and V(H):
A→ U 𝐵→𝑊 𝐶→𝑉 𝐷→𝑍
Then this correspondence is one to one
satisfying the condition of the above definition.
Example.
The following unlabeled graphs G and H are isomorphic

Proof. If we label V(G) and V(H) by the same labels 1,2,3,4 to get
labeled graphs G’ and H’ we get G’ = H’ (equal graphs). Thus, 𝐺 ≅ 𝐻.

G’ H’
Example.
The following unlabeled graphs G and H are isomorphic

Proof. If we label V(G) and V(H) by the same labels 1,2,3,…,10 to get
labeled graphs G’ and H’ we get G’ = H’ (equal graphs). Thus, 𝐺 ≅ 𝐻.
Example.
Show that the following unlabeled graphs G and H are not isomorphic
Proof. They are not isomorphic since the loop in
the graph G is joined to a vertex of degree 4
but the loop in H is not so.

𝑑𝐺 = 2,3,3,4,4 𝑑𝐻 = 2,3,3,4,4
Example.
Determine whether the following unlabeled graphs G and H are isomorphic or not.
Solution. They are not isomorphic since there are
no vertices of degree 2 that are joined together in G but we
can find vertices of degree 2 that are joined in H.
Exercise. Are the following graphs isomorphic:

𝑑𝐺 = 2,2,2,2,3,3,3,3, 𝑑𝐻 = 2,2,2,2,3,3,3,3,
Counting Graphs.
How to determine the number of (non-isomorphic) graphs with particular properties?
Counting graphs

↙↘
Counting labeled graphs Counting unlabeled graphs
Counting labeled graphs.
Example. Count all (non-isomorphic) labeled simple graphs with 3 vertices.
Solution.

The number of labeled simple graphs of 3 vertices = 8


In general we have:
𝑛(𝑛−1)
The number of labeled simple graphs of n vertices is 2 2

n 1 2 3 4 5 6 7 8
# labeled 1 2 8 64 1024 32768 2097152 268435456
simple graphs

Counting unlabeled graphs.


Example. Count all (non-isomorphic) unlabeled simple graphs with 3 vertices.
Solution.

The number of unlabeled simple graphs of 3 vertices = 4


The following table list the number of unlabeled simple graphs with n vertices

n 1 2 3 4 5 6 7 8
# unlabeled simple 1 2 4 11 34 156 1044 12346
graphs
# unlabeled simple 1 1 2 6 21 112 853 11117
connected graphs

# unlabeled simple 1 2 2 4 3 8 6 20
regular graphs

Example. Draw the 11 unlabeled simple graphs of 4 vertices.


Solution.

(0,0,0,0) (0,0,1,1) (0,1,1,2) (1,1,1,1) (0,2,2,2) (1,1,2,2)

(1,1,1,3) (1,2,2,3) (2,2,2,2) (2,2,3,3) (3,3,3,3)


Graph Cards
They are cards include all 208 unlabeled simple graphs with vertices less than or equal 6.

n = number of vertices
m = number of edges
n =5 n =6 d = degree sequence
m=5 m=4
d=(1,1,2,3,3) d=(1,1,1,1,1,3)
Example. Locate the graph card that depict the following graph:
Solution. We have n = 6 , m = 10 , d = (2,2,3,4,4,5).
There is only one graph card with n, m and d as above which is Card 180.
180

n =6
m=10
d=(2,2,3,4,4,5)

Example. Locate the graph card that depict the following graph:
Solution. We have n = 6 , m = 7 , d = (2,2,2,2,3,3).
There are 4 cards with n, m and d as above. (Cards #127, #128, #129, #130)
127 128 129 130

We note that the graphs #127 and #129 contain triangles while our graph G is not.
Also, in the graph #130 the two vertices of degree 3 are not joined together
while they are joined together in G.
Therefore, the needed graph card is # 128.
Chapter 2. Definitions and Examples
Adjacency and incidence
Consider the following graph e
u and v are adjacent
e is incident with u and v
Definition.
Let u and v be to two vertices of a graph G. If u and v are joined by an edge, then
u and v are said to be adjacent.
Also u and v are said to be incident with e and eis incident with u and v.
Example. Consider the following graph with vertices 1 , 2 , 3 , 4
1 and 2 are joined by 1 edge.
1 and 4 are joined by 1 edge
2 and 3 are joined by 1 edge
2 and 4 are joined by 2 edge
3 and 4 are joined by 2 edge
1 and 3 are joined by 0 edge.
We can form the following matrix
1 2 3 4
1 0 1 0 1
2 1 0 1 2 
 
3 0 1 0 2
 
4 1 2 2 0 

Which is called the adjacency matrix of the graph G


Definition.
Let G be a graph without loops with vertices labeled 1 , 2 , …, n .
The adjacency matrix M(G) is the 𝑛 × 𝑛 matrix 𝑎𝑖𝑗 where 𝑎𝑖𝑗 is the number of
edges joining the vertices i and j .
Example. Consider the following graph G with vertices 1 , 2 , 3 , 4
and edges 1, 2, 3, 4, 5, 6, 7.
Vertex 1 is incident to edge 1.
Vertex 1 is incident to edge 7.
Vertex 2 is incident to edge 5.

We can form the following matrix 1 2 3 4 5 6 7
1 1 0 0 0 0 0 1
1 1 0 0 1 1 0  Which is called the incidence
2 
3 0 1 1 1 0 0 0  matrix of the graph G
 
4 0 0 1 1 1 1 1
Definition.
Let G be a graph without loops with vertices labeled , 2 , …, n and edges
labeled 1, 2, …, m. The Incidence matrix I(G) is the 𝑛 × 𝑚 matrix 𝑎𝑖𝑗 where
1 𝑖𝑓 i 𝑖𝑠 𝑖𝑛𝑐𝑖𝑑𝑒𝑛𝑡 𝑤𝑖𝑡ℎ 𝑗
𝑎𝑖𝑗 = ቊ
0 𝑜𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Example. Draw the graph whose incidence matrix is
1 2 3 4 5 6 7 8
1
1 1 1 1 0 0 0 0
2 1 1 0 0 1 1 0 0 

3 0 0 0 0 0 0 0 0
4
 
0 0 0 1 0 1 1 1
5  0 0 1 0 1 0 1 1 
Solution
Paths and Cycles.
Definition. Let G be a graph.
A walk of length k in a graph G is a succession of k edges of G of the form
𝑢𝑣, 𝑣𝑤, 𝑤𝑥, 𝑥𝑦, ⋯ , 𝑎𝑏.
𝑘−𝑡𝑒𝑟𝑚𝑠
This walk is denoted by 𝑢𝑣𝑤𝑥𝑦 ⋯ 𝑎𝑏 and we call it a walk
between 𝑢 and 𝑏.
Remark. Consider the following graph G.
1) The walk uvwvyzz in G is of length 6.
2) The walk uvwvyzz in G can be written as zzyvwvu.
3) The edges and vertices of a walk need not be different.
Example. The walk uvwxywvzzy is of length 9. It includes the vertices v, w, y, z twice
and it also includes the edge vw twice.
Definition. Let G be a graph.
1) If all the edges of a walk in G are different, then the walk is called a trail.
2) If all vertices of a trail in G are different, then the trail is called a path.
Example. Consider the following graph G.
1) The walk uvwxyzzv is a trail that is not a path (the vertex z
is repeated twice).
2) The walk uvwxyz is a path of length 5.
3) The walk uzvuz is a trail although the edge uz appears
twice since there are two edges joining u and z.
Definition. Let G be a graph.
1) A closed walk in G is a walk starting and ending by the same vertex.
2) A closed trail in G is a closed walk with different edges.
3) A cycle is a closed trail with different vertices.
Example. Consider the following graph G.
1) uvwvyzu is a closed walk that is not a closed trail.
2) uvywvzu is a closed trail that is not a cycle.
3) yxwvzy is a cycle of length 5.
Theorem.
A graph G is connected if and only if there is a path between any given
pair of vertices and it is disconnected otherwise.
Every disconnected graph can be split up into connected subgraphs called components.
Example. The following graph G is connected since we can find a path between any two
vertices of G.

Example. The following graph G is disconnected since for example


there is no path between P and V.
The graph G splits up into 3 components.
Examples of graphs.
1) Complete graphs: graphs in which every two distinct vertices are joined by exactly one
edge. A complete graph with n vertices is denoted by 𝐾𝑛 .

K1 K2
K3
Remarks. K4
K5
1. 𝐾𝑛 is a regular graph with 𝑟 = 𝑛 − 1.
1
2. # of edges of 𝐾𝑛 is 𝑛(𝑛 − 1).
2
2) Null graphs: graphs containing no edges. A null graph with n vertices is denoted by 𝑁𝑛 .

N1 N2
Remark. N3
N4
1) 𝑁𝑛 is a regular graph with 𝑟 = 0.
N5
3) Cycle graphs: A graph consisting of a single cycle.
A cycle graph with n vertices is denoted by 𝐶𝑛 .

C1 C2
Remarks.
C3 C4 C5
1. 𝐶𝑛 is a regular graph with 𝑟 = 2.
1
2. # of edges of 𝐶𝑛 is 𝑛 2 = 𝑛.
2
4) Path graphs: A graph consisting of a single path.
A path graph with n vertices is denoted by 𝑃𝑛 .

P1
P2
Remarks. P3 P4 P5
1) 𝑃𝑛 has 𝑛 − 1 edges.
2) 𝑃𝑛 can be obtained from 𝐶𝑛 by removing 1 edge.
5) Bipartite graphs: A graph whose vertex-set can be split into two set:
A (black vertices) and B (white vertices) such that each edge of the graph joins
a vertex in A to a vertex in B.
Example.
The following are bipartite graphs.

6) Complete bipartite graphs: A bipartite graph such that each black


vertex is joined to each white vertex by exactly one edge. The complete
bipartite graph with r black vertices and s white vertices is denoted by 𝐾𝑟,𝑠 .
Example. The following are complete bipartite graphs.
Remarks.
1. The graph 𝐾1,𝑠 is called a star graph.
2. 𝐾𝑟,𝑠 has 𝑟 + 𝑠 vertices and 𝑟𝑠 edges.
6) Cubes graphs:

Example. The following is the 3-cube graph 𝑄3 .


Remarks.
1. 𝑄𝑘 has 2𝑘 vertices and regular with 𝑟 = 𝑘.
2. 𝑄𝑘 has 𝑘. 2𝑘−1 edges.
3. 𝑄𝑘 is a bipartite graph.
6) Paterson graphs: Graphs of the form
are called Paterson graphs. They are
regular with 𝑟 = 3.

6) Tree graphs: A connected graph which contains no cycle is called a tree.


Examples.
Union of graphs.

Remark.
Complement of graphs.

Examples.
1)

2) The complement of the null graph 𝑁𝑛 is the complete graph 𝐾𝑛 .


3) For any simple graph 𝐺, we have 𝐺Ӗ = 𝐺.
4)

G  G  
Remarks. Let 𝐺 be a graph with n vertices.
1) (# of vertices of 𝐺ҧ ) = (# of vertices of 𝐺) = n .
1
2) (# of edges of 𝐺ҧ ) + ((# of edges of 𝐺 ) = # of edges of 𝐾𝑛 = 𝑛(𝑛 − 1).
2
3) If 𝐺 is simple and regular of degree 𝑟 , then 𝐺ҧ is regular of degree 𝑛 − 1 − 𝑟.

Theorem.
If 𝐺 is a disconnected graph, then 𝐺ҧ must be connected.
Proof.
Let v and w be two vertices of 𝐺.ҧ We have two case:
If v and w lie in different components of 𝐺, then they are joined by an edge in 𝐺.ҧ
If v and w lie in the same component of 𝐺 and z is any vertex in another component
of 𝐺, then vzw is a path between v and w in 𝐺.ҧ Therefore, any two vertices of can be
connected by a path in 𝐺.ҧ Thus, 𝐺ҧ is connected.
On application of graphs
Phasing traffic lights.
Consider the following road intersection.

a
b
f
e
• Stream a is compatible with dc
b, c, e and f but not with d.
• Stream f is compatible with
a and e but not with b, c and d.

We can represent a compatibility graph as follows:
Problem. How can the traffic light be phased if the traffic lights operate on 60-second cycle?
Solution 1.
Each stream through the light for 10 seconds. f a
The waiting time = 6 × 50 = 300 seconds.
⟹ Bad solution.
Solution 2. (By using the compatibility graph).
Vertices a, b and c form a complete subgraph of G.
Vertices a, f and e form a complete subgraph of G.
e b
Vertices c, d and e form a complete subgraph of G.
One set of complete subgraphs of G that contains each
vertex of G is 𝑎𝑏𝑐, 𝑎𝑓𝑒, 𝑐𝑑𝑒 . d c
Streams a, b, c proceed for 20 seconds.
Streams a, f, e proceed for 20 seconds.
Streams c, d, e proceed for 20 seconds.
Streams a, c, e proceed for 40 seconds.
Streams b, d, f proceed for 20 seconds.
The total waiting time = 3 × 20 + 3 × 40 = 180 seconds.
Exercise. Consider the following road intersection.
1) Draw the compatibility graph G.
2) Find a set of complete subgraphs of G containing each
vertex of G.
1) Find a suitable traffic light sequence and
calculate the total waiting time involved.
(use a 60-second cycle)
Chapter 4. Digraphs (Directed graphs)
Definition.
A digraph D consists of a set of elements called vertices and a list of ordered
pairs of these elements called arcs.
Remarks. Let D be a digraph.
1) The vertex-set of D is denoted by V(D).
2) The arc-list of D is denoted by A(D).
3) If v and w are vertices of D, then the arc vw is said to be directed from v to w.
4) Multiple arcs: Two or more arcs joining the same vertices.
5) A loop: An arc joining a vertex to itself.
6) Simple digraph: A digraph with no loops or multiple arcs.
in the same direction.
Example.
Consider the following digraph D.
1) 𝑉(𝐷) = 𝑢, 𝑣, 𝑤, 𝑧 . 𝐴(𝐷) = 𝑢𝑣, 𝑣𝑣, 𝑣𝑤, 𝑣𝑤, 𝑤𝑣, 𝑤𝑢, 𝑧𝑤 .
2) Note that 𝑢𝑣 ∈ 𝐴(𝐷) but 𝑣𝑢 ∉ 𝐴(𝐷).
3) vw, vw are multiple arcs and vv is a loop. D is not simple.
Definition.
Let D be a digraph. The underlying graph of D is the graph obtained
by replacing each arc of D by the corresponding (undirected) edge.
Example. Consider the following digraph D. Then the graph G is the
Underlying graph of D.

Definition.
A subdigraph of a digraph D is a digraph all of whose vertices belong
to V(D) and all of whose arcs belong to A(D).
Example.
Consider the following digraph D.
𝑉(𝐷) = 𝑢, 𝑣, 𝑤, 𝑧 . 𝐴(𝐷) = 𝑢𝑣, 𝑣𝑣, 𝑣𝑤, 𝑣𝑤, 𝑤𝑣, 𝑤𝑢, 𝑧𝑤 .
Consider the digraph H where
𝑉(𝐻) = 𝑢, 𝑣, 𝑤 . 𝐴(𝐷) = 𝑢𝑣, 𝑣𝑤, 𝑤𝑣, 𝑤𝑢 .
Then H is a subdigraph of D.
Adjacency and Incidence.
Definition. e
In the following digraph, we say that
1) The vertices u and v are adjacent.
2) The arc e is incident from u and incident to v.
Definition.
Let D be a digraph and let 𝑣 ∈ 𝑉(𝐷). Then
1) Out-degree of 𝑣 = the number of arcs incident from 𝑣 (denoted by outdeg(𝑣)).
2) In-degree of 𝑣 = the number of arcs incident to 𝑣 (denoted by indeg(𝑣)).
3) Out-degree sequence of D: Listing the out-degrees in a non-decreasing order.
4) In-degree sequence of D: Listing the In-degrees in a non-decreasing order.
Remark.
A loop in a digraph D contribute 1 to both the out-degree and the in-degree
of the corresponding vertex.
Example. Consider the following digraph D.
outdeg(u) = 1 indeg(u) = 1
outdeg(v) = 3 indeg(v) =3
outdeg(w) = 2 indeg(w) =3
outdeg(x) = 0 indeg( x) =0
outdeg(z) = 1 indeg(z)=0
Out-degree sequence: (0,1,1,2,3)
In-degree sequence: (0,0,1,3,3)
Remark. Note that in the previous example, ෍(𝑂𝑢𝑡 − 𝑑𝑒𝑔𝑟𝑒𝑒) = ෍(𝐼𝑛 − 𝑑𝑒𝑔𝑟𝑒𝑒) = 7

The Hand-shaking Di-Lemma


In any digraph,
෍(Out−degrees) = ෍(In−degree𝑠) = # of edges

Proof. Since each arc has two ends, it must contribute exactly 1 to the sum of
the out-degrees and exactly 1 to the sum of the in-degrees.
The adjacency matrix.
Let D be a digraph without loops with n vertices labeled 1 , 2 , …, n .
The adjacency matrix M(D) is the 𝑛 × 𝑛 matrix [𝑎𝑖𝑗 ] where
𝑎𝑖𝑗 = the number of arcs from vertex i to vertex j
Example.
Find the adjacency matrix of the following digraph D.
Solution. 1 2 3 4

1 0 1 0 1
2
1 0 0 2 
M (D )  
3 0 1 0 0
4  
0 0 1 0
The Incidence matrix.
Let D be a digraph without loops with n vertices labeled 1 , 2 , …, n and m arcs
Labeled as 1, 2, …, m.
The Incidence matrix I(D) is the 𝑛 × 𝑚 matrix [𝑎𝑖𝑗 ] where
1
1 if 𝑗 is incident from 𝑖
𝑎𝑖𝑗 = −1
2
if 𝑗 is incident to 𝑖 3
0 otherwise 5 7
Example. 6
Find the Incidence matrix of the following digraph D.
Solution. 1 2 3 4 5 6 7 4
1  1 1 0 0 1 0 0 
2
 1 1 1 0 0 1 1 
I (D )   
3  0 0 1 1 0 0 0 
 
 0 0 0 1 1 1 1
4
Paths and Cycles.
Definition. Consider the following digraph D.
1) 𝑣𝑤𝑥𝑦𝑣𝑤𝑦𝑧𝑧𝑢 is an example of a walk of length 9 in D.
(vertices and arcs can be repeated)
2) 𝑢𝑣𝑤𝑦𝑣𝑧 is an example of a trail of length 5 in D.
(a walk with all arcs are different).
3) 𝑣𝑤𝑥𝑦𝑧 is an example of a path of length 4 in D.
(a trail with all vertices are different)
4) 𝑢𝑣𝑤𝑥𝑤𝑦𝑣𝑤𝑦𝑧𝑢 is an example of a closed walk in D.
(a walk starting and ending by the same vertex)
5) 𝑢𝑣𝑤𝑥𝑤𝑦𝑧𝑢 is an example of a closed trail in D.
( a trail starting and ending by the same vertex)
6) 𝑣𝑤𝑥𝑦𝑧𝑢𝑣 is an example of a cycle in D.
( a path starting and ending by the same vertex)
Definition.
Two digraphs C and D are isomorphic if D can be obtained from C by relabeling the vertices.
That is, if there is a one to one correspondence between the vertices of C and those of
D such that the number of arcs joining any pair of vertices in C is equal to the number
of arcs joining the corresponding pair of vertices (in the same direction) in D.
Example.
The following digraphs C and D are
isomorphic
Proof. Consider the following correspondence
between V(C) and V(D):
𝑎 →z 𝑏→𝑤 𝑐→𝑣 𝑑→𝑢
Then this correspondence is one to one
satisfying the condition of the above definition.
C D
Example. Which of the following digraphs are isomorphic?

D1
D2 D3 D4
Solution.
• We first not that the in-degree (and out-degree) sequence of all digraphs are the same.
• 𝐷2 ≇ 𝐷1 , 𝐷3 , 𝐷4 since the two triangles in 𝐷2 are not a 3-cycle but one of triangles is
A 3-cycle in 𝐷1 , 𝐷3 and 𝐷4 .
• 𝐷1 ≇ 𝐷3 , 𝐷4 since 𝐷1 contains two 4-cycles but each of 𝐷3 and 𝐷4 contain only one
one 4-cycle.
• We prove that 𝐷3 ≅ 𝐷4 :
After labeling the two digraphs by the
same labels 1, 2, 3, 4, 5 we get equal
Digraphs.
Definition. Let D be a digraph.
1) D is called connected if its underlying graph is a connected graph.
2) D is called strongly connected if there is a path in D from any vertex to any other.
Example.
Consider the following digraphs.

D1 D2 D3
1) 𝐷1 is disconnected since its underlying graph is disconnected.
2) 𝐷2 is connected but not strongly connected since for example, there is
no path from vertex 6 to vertex 2.
3) 𝐷3 is strongly connected since there is a path from any vertex to any other.
Remark. Any strongly connected digraph is connected.
Remark. Consider the following two graphs.

We note that we can direct the edges of G so that the resulting digraph is strongly connected.
But we can not do the same thing in H. The graph G is called orientable but H is not orientable.
Definition.
A graph G is called orientable if it is an underlying graph of a strongly
connected digraph. (that is, if it is possible to direct the edges of G
Such that the resulting digraph is strongly connected.)
Definition.
An edge in a connected graph is called a bridge if its removal leaves a disconnected graph.
Theorem. A connected graph G is orientable if and only if it has no bridges.
Proof. ⟹) Suppose G is orientable. If G has a bridge uv, then this bridge must be directed in
one way (say, u to v). Thus, there are no paths from v to u and so the resulting digraph is not
strongly connected. Therefore, G is not orientable, a contradiction. Hence, G has no bridges.
⟸) See the book.
Eulerian graphs and digraphs
1) The Explorer’s Problem
An explorer wishes to explore all the routes between a number of cities. Can we find a tour
(starting and ending by the same city) which traverses each route only once?
In graph language: Can we find a closed trail which includes every edge of the graph?
2) The Traveler’s Problem
A traveler wishes to visit a number of cities.
Can we find a tour which visits each city only once?
In graph language: Can we find a cycle which includes every vertex of the graph?
Definition.
1) A connected graph G is called Eulerian if there is a closed trail which includes
every edge of G. (called an Eulerian trail)
2) A connected graph G is called Hamiltonian if there is a cycle which includes every
vertex of G. (called a Hamiltonian cycle)
Example. Consider the following graphs.

Eulerian with Eulerian Not Eulerian Eulerian with Eulerian Not Eulerian
trail ABCDEFBLCELFA Hamiltonian with trail BCLEFLB Not Hamiltonian
Hamiltonian with Hamiltonian Cycle Not Hamiltonian
Hamiltonian Cycle BCELFA
ABCDELFA
Konigsberg
ሷ bridges Problem.
The Seven Bridges of Königsberg is a historically notable
problem in mathematics. Its negative resolution
by Leonhard Euler in 1736 laid the foundations of graph
theory and prefigured the idea of topology.
The city of Königsberg in Prussia (now Kaliningrad, Russia)
was set on both sides of the Pregel River, and included two
large islands (Kneiphof and Lomse) which were connected
to each other, or to the two mainland portions of the city, by
seven bridges. The problem was to devise a walk through
the city that would cross each of those bridges once and
only once.

Can we find a rout crossing each bridge exactly once and returning to the starting point?
Euler proved that the problem has no solution.
In graph language: Can we find an Eulerian trail in the following graph?
(Is the following graph Eulerian?)
Answer: No since the graph is not Eulerian.
For more information's, see
https://en.wikipedia.org/wiki/Seven_Bridges_of_Königsberg
Theorem. Let G be a connected graph. Then G is Eulerian if and only if every
vertex of G has an even degree.
Proof.
⟹) Suppose that G is Eulerian. Then we can travel along a closed trail by using each
edge once. Whenever we pass through a vertex of G, the degree of this vertex will be
contributed by 2. Thus, the degree of each vertex is the sum of a number of 2’s and
so it is an even number.
⟸) See the book.
Fleury's Algorithm.
If G is an Eulerian graph, then the following steps can provide an Eulerian trail in G.
Step 1: Choose a starting vertex u.
Step 2: At each stage, traverses any available edge choosing a bridge only if there is
no alternative.
Step 3: After traversing each edge erase it and then choose another available edge.
Step 4: Stop when there are no more edges.
Example. Use the Fleury’s Algorithm to find an Eulerian trail of the following Eulerian graph.
Solution.
1) Start by the vertex F.
2) Traverse the edges FB , BE and erase them.
3) Traverse the edges EA , AD , DE and erase them.
4) Traverse the bridge EF and erase it.
5) Traverse the edges FC , CJ , JF and erase them.
The Eulerian trail is FBEADEFCJF.

1) 2) 3)

4) 5)
Eulerian-type problems.
Definition. A connected graph G is called edge -traceable if there is an open trail which
include every edge of G.

Problem. In Konigsberg
ሷ bridges Problem, can we find a rout crossing each bridge exactly
once and returning to any point?
In graph language : Is the following graph edge-traceable?
Answer. No since there is no open trail which include every edge of G.

Example. The following complete bipartite graph 𝐾2,3 is edge-traceable


with open trail ywxzyux .

Note: The graph 𝐾2,3 has exactly two vertices of odd degree.
Theorem. Let G be a connected graph. Then G is edge-traceable if and only if
G has exactly two vertices of odd degree.
Proof.
⟹) Suppose G is edge-traceable. Let u and w be the starting and finishing
vertices of the open trail. Add an edge e joining v and w to get an Eulerian graph G’.
Then by a previous theorem, every vertex of G’ must have an even degree.
If we remove e to get the graph G again, we conclude that v and w are the only
vertices in G of odd degree.
⟸) See the book.

G’ G
Example of Eulerian and edge-traceable graphs.
1) For an odd integer 𝑛 the complete graph 𝐾𝑛 is Eulerian since it is regular
with degree 𝑟 = 𝑛 − 1 (even).
2) A cycle graph 𝐶𝑛 is Eulerian for any integer 𝑛 since it is regular
with degree 𝑟 = 2 (even).
3) The cube graph 𝑄𝑛 is Eulerian whenever 𝑛 is even since it is regular
with degree 𝑟 = 𝑛.
4) The complete graph 𝐾𝑟,𝑠 is Eulerian if and only if 𝑟 and 𝑠 are even.
5) The path graph 𝑃𝑛 is edge-traceable for 𝑛 ≥ 2.
6) The complete graph 𝐾𝑟,𝑠 is edge-traceable if and only if either 𝑟 = 2 and 𝑠 is odd or
𝑠 = 2 and 𝑟 is odd (see the graph 𝐾2,3 ) .
Definition. A weighted graph is a graph in which every edge has been assigned
a positive number (called its weight).
Example. The following graph is weighted.
The edge AB has a weight 3
The edge ED has a weight 9

Chinese postman problem.


In a weighted graph G, find a closed walk of minimum total weight which includes
every edge of G at least once.
Note. We solve this problem in the case G is edge-traceable (contains exactly two
vertices of odd degree)
Example. Solve the Chinese postman problem for the following weighted graph G.
Solution.
1) B and E are the only vertices of odd degrees.
2) We find a path of minimum weight from B to E
(which is the path BAFE of total weight 3+4+6 = 13).
3) We double up each edge in this path to get a graph G’.
4) G’ is Eulerian since all vertices are of even degrees.
One Eulerian trail in G’ is ABCDEFCEFABFA.
5) The above Eulerian trail in G’ is a closed walk in G of G
minimum weight with
total weight = 3+5+5+9+6+14+10+6+4+3+8+4 = 77.

G’
Definition.
1) A connected digraph D is called Eulerian if there is a closed trail which includes all arcs of D.
2) A connected digraph D is called arc-traceable if there is an open trail which includes all arcs.
Theorem. Let D be a connected digraph.
1) D is Eulerian if and only if outdeg(u)=indeg(u) for all 𝑢 ∈ 𝑉 𝐷 .
2) D is arc-traceable if and only if there are 𝑥, 𝑦 ∈ 𝑉(𝐷) such that
outdeg(x) – indeg(x) = 1 , indeg(y) – outdeg(y) = 1 and
outdeg(u) = indeg(u) for all 𝑢 ∈ 𝑉 𝐷 − 𝑥, 𝑦
Example.
1) The digraph C is Eulerian (not arc-traceable) since
outdeg(u)=indeg(u) for all 𝑢 ∈ 𝑉 𝐶 . D
2) The digraph D is not Eulerian since for example,
indeg(b) ≠ outdeg(b) .
3) The digraph D is arc-traceable since
outdeg(f) – indeg(f) = 1 , indeg(b) – outdeg(b) = 1 and
outdeg(u) = indeg(u) for all 𝑢 ∈ 𝑉 𝐷 − 𝑓, 𝑏
C
Hamiltonian Graphs
Definition. A connected graph G is called Hamiltonian if there is a cycle which
includes all vertices of G. Such a cycle is called a Hamiltonian cycle.
Example.
1) The following graph is Hamiltonian with Hamiltonian cycle BCLEFB.
2) The cycle graph 𝐶𝑛 is Hamiltonian for all n.
3) The complete graph 𝐾𝑛 is Hamiltonian for all 𝑛 ≥ 3.
Theorem. (Dirac’s Theorem)
Let G be a simple graph with n vertices where 𝑛 ≥ 3. If
𝑛
deg(𝑣) ≥ for all 𝑣 ∈ 𝑉(𝐺), then G is Hamiltonian.
2
Example. Show that the following graph G is Hamiltonian.
Proof.
deg 𝐴 = 3 , deg 𝐵 = 4 , deg 𝐶 = 3
deg 𝐷 = 3 , deg 𝐸 = 3 , deg 𝐹 = 4
𝑛
deg 𝑣 ≥ = 3 for all 𝑣 ∈ 𝑉(𝐺).
2
G is Hamiltonian by Dirac’s Theorem.
𝑛
Remark. The condition “deg(𝑣) ≥ for all 𝑣 ∈ 𝑉(𝐺)” in Dirac’s Theorem is sufficient
2
but not necessary for G to be Hamiltonian.
Example. Determine whether the following graph G is Hamiltonian or not.
Solution.
𝑛 𝑛
= 3 and deg 𝐷 = 2 ≱ .
2 2
Thus, we cannot use Dirac’s Theorem. So, G may or may not
be Hamiltonian. However, G is Hamiltonian since ACFDEBA
is a Hamiltonian cycle in G.
Theorem. (Ore’s Theorem)
Let G be a simple graph with n vertices where 𝑛 ≥ 3. If
deg 𝑣 + deg(𝑤) ≥ 𝑛 for each pair of non-adjacent vertices G
𝑣 and 𝑤, then G is Hamiltonian.
Example. Determine whether the following graph G is Hamiltonian or not.
Solution.
𝑛
𝑛 = 5 and deg 𝐴 = 2 ≱ . Thus, we cannot use Dirac’s Theorem.
2
However, we have
Pairs of non-adjacent deg 𝑣 + deg(𝑤)
vertices 𝑣 and 𝑤
𝐴, 𝐷 2+3=5
𝐴, 𝐹 2+3=5
G
𝐵, 𝐸 3+3=6

Thus, deg 𝑣 + deg(𝑤) ≥ 𝑛 for each pair of non-adjacent vertices and so


G is Hamiltonian by Ore’s Theorem.
Definition (Hamiltonian Digraphs)
A connected digraph D is called Hamiltonian if there is a (directed) cycle which
includes all vertices of D. Such a cycle is called a Hamiltonian cycle in D.
Theorem. Let D be a simple graph with n vertices where 𝑛 ≥ 3. If
𝑛 𝑛
outdeg(𝑣) ≥ and indeg(𝑣) ≥ for all 𝑣 ∈ 𝑉(𝐷), then D is Hamiltonian.
2 2
Example. Show that the following digraph D is Hamiltonian.
𝑛
Proof. = 2
2
outdeg 𝐴 = 2 , indeg 𝐴 = 2 , outdeg 𝐵 = 2 , indeg 𝐵 = 2
outdeg 𝐶 = 3 , indeg 𝐶 = 2 , outdeg 𝐷 = 2 , indeg 𝐷 = 2
𝑛 𝑛
Thus, outdeg(𝑣) ≥ and indeg(𝑣) ≥ for all 𝑣 ∈ 𝑉(𝐷),
2 2
Therefore, D is Hamiltonian by the above theorem.
Theorem. Let D be a simple graph with n vertices where 𝑛 ≥ 3. If D
outdeg 𝑣 + indeg(𝑤) ≥ 𝑛 for any pair of vertices 𝑣 and 𝑤
such that 𝑣 is not adjacent to 𝑤, then D is Hamiltonian.
Path Algorithm.
The shortest path algorithm.
To find the shortest path between two vertices in a weighted digraph (network).
Example. Use the shortest path algorithm to find the shortest path
from S to T in the following network.
Solution. 7
Step 1: Assign to vertex S potential 0 and label each
vertex V reached directly from S with the distance
From S to V. Choose the smallest of these labels (the 0
label 4) and make it the potential of the 4
4
4
corresponding vertex (vertex B).
9

7
General step : Consider the vertex V just assigned a potential (vertex B).
For each such vertex V look at each vertex W reached directly from V
(vertices A and C) and assign to W the label:
(potential of V) + (distance from V to W) unless W has a smallest label.
We label A by 4 + 1 = 5 (≨ 7) , C by 4 + 3 = 7 (≨ 9) and D still by 7.
When all such vertices W have been labeled, choose 5
the smallest label in the network which is not a 7
potential and make it a potential at each vertex where
it occurs (We make 5 the potential of the vertex A).
11
Repeat the general step with new potentials. 0
4
Stop : When vertex T has been assigned a potential. 4
This potential is the smallest distance from S to T (10). 10
The shortest path is SBCT. 9
7

7 7
Tabular Method.

vertices S A B C D T
S 0 7 4 9 7 ---
B 5 4 7 7 ---
A 7 7 11 7
5
10
C, D 7 7 10
T 10

The shortest distance = 10


The shortest path is SBCT
Example. Use the shortest path algorithm to find the shortest path
from S to T in the following network.
Solution.
vertices S A B C D E T
S 0 7 13 28 --- --- ---
A 7 11 28 32 17 ---
B 11 16 17 17 ---
C 16 17 17 ---
D, E 17 17 22
T 22
22

The shortest distance = 22


The shortest path is SABDT
The longest path algorithm (Tabular Method).
To find the longest path between two vertices in a weighted digraph (network).
Example. Use the longest path algorithm to find the longest path from S to T.
Solution. 1) Assign to S potential 0. 7
2) Vertices B and D are the only vertices reached
only from S.
Assign to B potential 4 (the distance from S to B) and
0 13
assign to D potential 7 (the distance from S to D).
3) Vertex A is reached only from S and B (Their 4
Potentials are known). 9
Assign to A potential = 𝑚𝑎𝑥 7, 4 + 1 = 7.
4) Vertex C is reached only from S, B, D (their potentials
are known)
Assign to C potential = 𝑚𝑎𝑥 9, 4 + 3, 7 + 1 = 9.
5) Vertex T is reached only from A, C, D (their potential are known) 7
Assign to T potential = 𝑚𝑎𝑥 7 + 6, 9 + 3, 7 + 4 = 13.
The longest distance = 13 and the longest path is SAT
Vertices S A B C D T
(S,B) (S) (S,B,D) (S) (A,C,D)
S 0 4 7
S, B, D 7 9
S, B, D, A, C 13

The longest distance = 13


The longest path is SAT
Example. Use the longest path algorithm to find the longest path from S to T.
Solution.
vertices S A B C D E F T
(S) (S) (S) (A,B,E) (A,C) (B,C,E) (D,E,F)
S 0 4 6 7 --- --- --- ---
S,A,B,C --- 11 --- ---
S,A,B,C,E 14 13 ---
S,A,B,C,E,D,F 21

The longest distance = 21


The longest path is SCEDT
Potential of E = 𝑚𝑎𝑥 4 + 5, 7 + 4 = 11.
Potential of D = 𝑚𝑎𝑥 4 + 7, 6 + 5, 11 + 3 = 14.
Potential of F = 𝑚𝑎𝑥 6 + 7, 7 + 5, 11 + 2 = 13.
Potential of T = 𝑚𝑎𝑥 14 + 7, 11 + 9, 13 + 6 = 21.
Trees.
Definition. A tree is a connected graph which contains no cycles.
Example. All trees with at most 6 vertices are

n = 1: n = 2: n = 3:

n = 4:

n = 5:

n = 6:
Remark.
To get a tree with n + 1 vertices, we add an edge joining a new vertex to an
existing one in a tree with n vertices. For example, the following tree with 7 vertices can
be obtained by a tree of 6 vertices.
Definition (spanning trees).
Let G be a connected graph. A spanning tree in G is a subgraph H of G such that
1) H includes all vertices of G.
2) H is a tree.
Example. Consider the following graph G. Then the subgraph H is a spanning tree of G

G H
Methods of obtaining spanning trees from a graph.
Cutting-down Method
Choose any cycle in G and remove one of its edges. Repeat this
procedure until there are no cycles left.
Example. Obtain one of the spanning trees of the graph G by
Cutting-down method.
Solution. G

Remove VY from Remove ZY from Remove XY from


the cycle VWYV the cycle VWYZV the cycle XYWX

We get the spanning tree of G.


Building-up Method
We select edges of G in such a way that no cycles are created. Repeat
this procedure until all vertices are included.
Example. Obtain one of the spanning trees of the graph G by
building-up method.
Solution.
1) We choose the edge VZ. 2) We choose the edge VW.
G

1) We choose the edge WX. 4) We choose the edge XY.


Centers and bicenters of trees.
Let T be any tree. If we
1) Remove all vertices of degree 1 together with their incident edges.
2) Repeat 1) until we obtain either
a) A single vertex. In this case, this vertex is called a center of T and T is called central.
b) Two adjacent vertices. In this case, these two vertices are called the bicenter of T
and T is called bicentral.
Example. Find the center (or bicenter) of the following tree.
Solution.

T is central with center E.


Example. Find the center (or bicenter) of the following tree.
Solution.

T is bicentral with a bicenter CD


Centroids and bicentroids of trees.
Let T be a tree with n vertices.
1) For each vertex v of degree ≥ 2, count the number of vertices in each of the subtrees
emanating from v.
2) Let 𝑛𝑣 be the maximum of these numbers. Then we have two cases:
𝑛−1
a) There is just one vertex v for which 𝑛𝑣 ≤ . In this case, v is the centroid of T and
2
T is centroidal .
𝑛
b) There are two adjacent vertices v and w for which 𝑛𝑣 = 𝑛𝑤 = . In this case, vw is
2
the bicentroid of T and T is bicentroidal.
Example. Find the centroid (or bicentroid) of the
following tree.
Solution.
𝑛𝐶 = 𝑚𝑎𝑥 1,1,1,4 = 4 𝑛𝐸 = 𝑚𝑎𝑥 3,4 = 4 T
𝑛𝐹 = 𝑚𝑎𝑥 5,2 = 5 𝑛𝐺 = 𝑚𝑎𝑥 1,6 = 6
𝑛−1 7 𝑛
= =4
2 2 2
𝑛
Thus, there are two vertices C and E such that 𝑛𝐶 = 𝑛𝐸 =
2
T is bicentroidal with bicentroid CE .
Example. Find the centroid (or bicentroid) of the following tree.
Solution.
𝑛𝐵 = 𝑚𝑎𝑥 1,6 = 6 𝑛𝐶 = 𝑚𝑎𝑥 2,5 = 5
𝑛𝐷 = 𝑚𝑎𝑥 3,3,1 = 3 𝑛𝐹 = 𝑚𝑎𝑥 2,5 = 5 T
𝑛−1 7 𝑛
= =4
2 2 2
𝑛−1
Thus, there is one vertex D such that 𝑛𝐷 = 3 ≤
2
T is centroidal with centroid D .
Counting trees.
The following table lists the number of labeled and unlabeled trees with n vertices for 𝑛 ≤ 10.

n 1 2 3 4 5 6 7 8 9 10
Unlabeled trees 1 1 1 2 3 6 11 23 47 106

Labeled trees 1 1 3 16 125 1296 16807 86 97 108

Caley’s Theorem.
There are exactly 𝑛𝑛−2 labeled trees with n vertices.

To prove Caley’s Theorem, we need the following definition:


Definition.
The sequences of 𝑛 − 2 numbers of the form (𝑎1 , 𝑎2 , ⋯ 𝑎𝑛−2 ) where for each 𝑖,
𝑎𝑖 = 1,2, ⋯ , 𝑛 are called Prufer sequences.
Theorem.
There is a one to one correspondence between the set of labeled trees with n
vertices and the set of all Prufer sequences.
We justify the method of finding the Prufer sequence corresponding to a labeled
tree (and conversely) by the following two examples:
Example. Find the Prufer sequence corresponding to the following labeled tree:
Solution. 𝑛 = 7 and 𝑛 − 2 = 5
Step 1: Find the vertex of degree 1 with the smallest label (vertex 2).
Step 2: Find the vertex adjacent to vertex 2 (vertex 6).
The sequence starts with 6 (6, ⋯ , ⋯ , ⋯ , ⋯ ).
Step 3: Remove the vertex 2 and the edge 2-6.
We repeat step 1, step 2 and step 3 until there are only two
vertices left.
We summarize the method as follows:
(6, ⋯ , ⋯ , ⋯ , ⋯ ) (6,6, ⋯ , ⋯ , ⋯ )

(6,6, 5, ⋯ , ⋯ ) (6,6, 5,5, ⋯ ) (6,6, 5,5,1)

The Prufer sequence is (6,6, 5,5,1).


Example. Find the labeled tree corresponding to the Prufer sequence (6,6, 5,5,1).
Solution. The Prufer sequence contains 5 numbers implies 𝑛 − 2 = 5 and so 𝑛 = 7 vertices.
We list the vertices as (1,2,3,4,5,6,7).
Step 1: The smallest number in the list that is not in the sequence
is 2 and the first number in the sequence is 6 We join 2 and 6.
Step 2: Remove 2 from the list and remove 6 from the sequence.
The new list: (1,3,4,5,6,7).
The new sequence: (6, 5,5,1).
Step 3: The smallest number in the (new) list that is not in the (new) sequence
is 3 and the first number in the (new) sequence is 6 We join 3 and 6.
Step 4: Remove 3 from the list and remove 6 from the sequence.
The new list: (1,4,5,6,7). The new sequence: (5,5,1).
Step 5: Repeat the above steps to get the required labeled tree.

(New) list (New) sequence Edge T


(1,2,3,4,5,6,7) (6,6, 5,5,1) 2↔6 The corresponding
(1,3,4,5,6,7) (6, 5,5,1) 3↔6 Labeled tree
(1,4,5,6,7) (5,5,1) 4↔5
(1,5,6,7) (5,1) 6↔5
(1,5,7) (1) 5↔1
(1,7) ------- 1↔7
Caley’s Theorem.
There are exactly 𝑛𝑛−2 labeled trees with n vertices.
Proof.
By the previous theorem, there exists a one to one correspondence between the set
of labeled tree with n vertices and the set of all Prufer sequences (sequences of the
form (𝑎1 , 𝑎2 , ⋯ 𝑎𝑛−2 ) where for each 𝑖, 𝑎𝑖 = 1,2, ⋯ , 𝑛). Since there are n possible
values for each number 𝑎𝑖 , the total number of possible sequences is 𝑛𝑛−2 .
Therefore, the total number of labeled trees with n vertices is 𝑛𝑛−2 .
Example. Find the Prufer sequence corresponding to the labeled tree.
Solution. n =7 and n – 2 = 5.

(6, ⋯ , ⋯ , ⋯ , ⋯ ) (6, 6, ⋯ , ⋯ , ⋯ )

(6, 6, 1, ⋯ , ⋯ ) (6, 6, 1, 6, ⋯ ) (6, 6, 1, 6, 6)

The Prufer sequence is (6, 6, 1, 6, 6)


Example. Find the labeled tree corresponding to the Prufer sequence (2,1, 1,3,5,5).
Solution. n – 2 = 6 and so n = 8 vertices.
(New) list (New) sequence Edge
(1,2,3,4,5,6,7,8) (2,1, 1,3,5,5) 4↔2
(1,2,3,5,6,7,8) (1, 1,3,5,5) 2↔1
(1,3,5,6,7,8) (1,3,5,5) 6↔1
(1,3,5,7,8) (3,5,5) 1↔3
(3,5,7,8) (5,5) 3↔5
(5,7,8) (5) 7↔5
(5,8) ----- 5↔8

T
Constructing Trees
Definition. Let G be a connected weighted graph and let T be a spanning tree in G of
minimum total weight. Then T is called a minimum spanning tree of G and its weight is
denoted by 𝑊(𝑇).

The minimum connector problem.


Given a weighted graph G. Find a minimum spanning tree in G.

The greedy algorithm.


We choose edges of G of minimum weight in such a way that no cycles are created.
Example. Use the greedy algorithm to find a minimum spanning tree in the
following weighted graph.
Solution.
1) We choose an edge of minimum weight (EA with weight 2).
2) We choose an edge of next smallest weight
(AC or EC with weight 4). Let us choose EC.
3) We can not include AC in the tree since it would create
a cycle. So, we look for the edge of the next smallest
weight (BC with weight 5).
4) We can not include AB or EB (with weight 6) since they G
would create a cycle. We choose instead the edge ED with
weight 7.
5) We stop since all vertices of G are included and we get the
minimum spanning tree T with total weight
2 + 4 + 5 + 7 = 18

T
Prim’s Algorithm.
To construct a minimum spanning tree T in a connected graph G, we build up T step by
step as in the following example.
Example. Use Prim’s algorithm to find a minimum spanning tree in the following
weighted graph.
Solution. We use the following table of weights of edges of G:
vertices A B C D E
A ----- 6 4 8 2
B 6 ----- 5 8 6
C 4 5 ----- 9 4
D 8 8 9 ----- 7
E 2 6 4 7 -----
1) Choose any vertex (say B) and put it in T. G
2) Delete row B from the table and look for the smallest entry in column B (which is 5).
⇒ We put BC in T.
3) Delete row C from the table and look for the smallest entry
in columns B and C (which is 4). ⇒ We put either CA or CE in T (say CA).
4) Delete row A from the table and look for the smallest entry
in columns A, B, C (which is 2). ⇒ We put EA in T.
5) Delete row E from the table and look for the smallest entry
in columns A, B, C, E (which is 7) ⇒ We put ED in T.
Therefore, we construct a minimum spanning tree T of G with total weight 18

vertices A B C D E
A ----- 6 4 8 2
B 6 ----- 5 8 6
C 4 5 ----- 9 4
D 8 8 9 ----- 7 T
E 2 6 4 7 -----
Example. Use Prim’s algorithm to find a minimum spanning tree in the following
weighted graph.
Solution. vertices A B C D E
A ----- 10 12 13 17
B 10 ----- 14 ---- 14
C 12 14 ----- 13 ----
D 13 ---- 13 ----- 14
E 17 14 ---- 14 -----
G
1) Start by vertex A.
2) Delete row A ⇒ smallest entry = 10 ⇒ Put AB.
3) Delete row B ⇒ smallest entry = 12 ⇒ Put AC.
4) Delete row C ⇒ smallest entry = 13 ⇒ Put (say) AD.
(We can not now choose CD since we get a cycle) T
5) Delete row D ⇒ smallest entry = 14 ⇒ Put (say) DE.
Thus, we get a minimum spanning tree with total weight = 49
Planar Graphs.

Example. Consider the complete graph 𝐾4 . We can draw 𝐾4 in several ways:

Not a plane graph for 𝐾4


a plane graph for 𝐾4 a plane graph for 𝐾4

Note. In the last plane graph for 𝐾4 , we represent edges by straight lines.
Theorem. Every simple planar graph can be drawn by straight lines
Theorem. The graphs 𝐾3,3 and 𝐾5 are not planar.
Proof.
Solution. We can draw the graph in a plane without crossing as follows
Euler’s Formula

Example. Consider the following plane graphs:

The graph has 4 faces. The face


The graph has 8 faces. The face 𝑓4
𝑓4 the infinite face.
is called the infinite face.
Definition. For any face 𝐹 in a planar graph G, the degree of 𝐹 (denoted by deg(𝐹))
is the number of edges around 𝐹.
Example. Find the degree of the faces of each of the following planar graphs

Solution.
a) deg 𝑓1 = 3, deg 𝑓2 = 4, deg 𝑓3 = 3, deg 𝑓5 = 4, deg 𝑓6 = 3, deg 𝑓7 = 4,
deg 𝑓8 = 3, deg 𝑓4 = 6. Note: σ(face − degrees) = 30 = 2(#𝑒𝑑𝑔𝑒𝑠).
b) deg 𝑓1 = 11, deg 𝑓2 = 3, deg 𝑓3 = 3, deg 𝑓4 = 9.
Note: σ(face − degrees) = 26 = 2(#𝑒𝑑𝑔𝑒𝑠).
Remark. If G is a planar graph, then σ(face − degrees) = 2(#𝑒𝑑𝑔𝑒𝑠).
Proof. Since each edge either bounds two faces or bounds a face twice,
it must contributes 2 to the sum of face-degrees.
Example. In the following graph, we have 𝑛 = 9, 𝑚 = 15
and 𝑓 = 8. We note that 𝑛 − 𝑚 + 𝑓 = 9 − 15 + 8 = 2.
*

Proof.
Let 𝑓 denotes the number of faces of G. Since each face 𝐹 is bounded by at least 3 edges,
then deg(𝐹) ≥ 3. Moreover, we have
2𝑚 = 2 #𝑒𝑑𝑔𝑒𝑠 = σ(face − degrees) ≥ 3𝑓. By Euler’s formula we get
3 2 − 𝑛 + 𝑚 = 3𝑓 ≤ 2𝑚 and so 6 − 3𝑛 + 3𝑚 ≤ 2𝑚. Therefore, 𝑚 ≤ 3𝑛 − 6.
If G has no triangles, then each face is bounded by at least 4 edges and so 2𝑚 ≥ 4𝑓. Thus,
4 2 − 𝑛 + 𝑚 = 4𝑓 ≤ 2𝑚 and so 𝑚 ≤ 2𝑛 − 4.
1
Proof. 𝐾5 has 5 vertices and 5 4 = 10 edges. If 𝐾5 is planar, then by Corollary(*),
2
we must have 10 = 𝑚 ≤ 3𝑛 − 6 = 9, which is a contradiction.
1
Similarly, 𝐾3,3 has 6 vertices and 6 3 = 9 edges. Moreover, 𝐾3,3 has no triangles.
2
If 𝐾3,3 is planar, then by the Corollary(*), we must have 9 = 𝑚 ≤ 2𝑛 − 4 = 8,
which is a contradiction.

Proof. Suppose G is a simple planar graph with n (≥ 3) vertices. If all vertices of G are of
Degree ≥ 6, then by Hand-shaking lemma, 2𝑚 = σ(vertex − degrees) ≥ 6𝑛.
Therefore, 3𝑛 ≤ 𝑚 and so by Corollary (*), we have 3𝑛 ≤ 𝑚 ≤ 3𝑛 − 6 , a contradiction
Coloring Graphs.
Vertex-colorings.
Let G be a graph without loops. A k-coloring of G is an assignment of k colors to the
vertices of G in such a way that adjacent vertices are assigned different colors. If G
has a k-coloring, then G is said to be k-colorable.
The smallest number k for which G is k-colorable is called the
chromatic number of G and is denoted by 𝜒(𝐺).
Examples. Consider the following graph G

3-coloring of G 4-coloring of G 5-coloring of G


Example. Find the chromatic number 𝜒(𝐺) of the graph G.
Solution.
Since G has a 3-colorable, then 𝜒(𝐺) ≤ 3 …….(1)
Since G contains a triangle (3-complete subgraph 𝐾3 ), then we
must have 𝜒(𝐺) ≥ 3 ……(2). Therefore, 𝜒 𝐺 = 3.
Remark. G
To find a lower bound for 𝜒(𝐺), we look for the largest complete subgraph
(say, 𝐾𝑚 ) in G. Then we have 𝜒(𝐺) ≥ 𝑚.
How to find an upper bound for 𝜒(𝐺).
Theorem. If G is a simple graph whose maximum
vertex-degree is d, then 𝜒 𝐺 ≤ 𝑑 + 1.
Example.
The following graph is simple with maximum vertex-degree
Is d = 4. Therefore, 𝜒 𝐺 ≤ 4 + 1 = 5.
Theorem (Brook’s Theorem).
Let G be a connected simple graph whose maximum
vertex-degree is d. If G is neither a cycle graph with an odd
number of vertices nor a complete graph, then 𝜒 𝐺 ≤ 𝑑.
Example. In the following graph, G is connected simple with
maximum vertex-degree d = 4. Moreover, G is neither a cycle
graph nor a complete graph.
Therefore, 𝜒 𝐺 ≤ 4. Since also G contains 𝐾4 , then 𝜒 𝐺 ≥ 4
and so 𝜒 𝐺 = 4. G
Theorem
That is, 𝜒 𝐺 ≤ 4.

Example The following graph G is simple and planner.


Therefore, 𝜒 𝐺 ≤ 4.

G
Exercise. 1)

2)
Definition.

𝜒(𝐺) is the smallest positive integer for which 𝑃𝐺 (𝑘) ≩ 0.


Examples.
1) Consider the path graph 𝐺 = 𝑃3 . Then

In general, if 𝐺 = 𝑃𝑛 , then

2) Consider the complete graph 𝐺 = 𝐾3 . Then

In general, if 𝐺 = 𝐾𝑛 , then

3) 𝑃𝐶𝑛 𝑘 = 𝑘 − 1 𝑛 + −1 𝑛 (𝑘 − 1)
Remark. Consider the following graph 𝐺.
1) Delete the edge 𝑒 from 𝐺 to get the graph 𝐺 − 𝑒.
2) Contract the edge 𝑒 to get the graph 𝐺 Τ𝑒.

𝑃𝐺 𝑘 = 𝑘(𝑘 − 1)(𝑘 − 2)(𝑘 − 3)

𝐺−𝑒 𝐺 Τ𝑒

𝑃𝐺−𝑒 𝑘 = 𝑘(𝑘 − 1)(𝑘 − 2)2 𝑃𝐺 Τ𝑒 𝑘 = 𝑘(𝑘 − 1)(𝑘 − 2)

We note that 𝑃𝐺−𝑒 𝑘 − 𝑃𝐺 Τ𝑒 𝑘 = 𝑘 𝑘 − 1 𝑘 − 2 𝑘 − 2 − 1 = 𝑃𝐺 𝑘


We simply write:

Deletion-Contraction Theorem.

Example. Use deletion-contraction Theorem to calculate the chromatic polynomial of G


and find 𝜒(𝐺).
Solution.

We note that 𝑃𝐺 1 = 0 , 𝑃𝐺 2 = 0 but 𝑃𝐺 3 = 6 ≩ 0. Therefore, 𝜒 𝐺 = 3.


Exercise.

Solution.
(i) We have two cases:
• If a and b have the same color, then 𝑃𝐺 𝑘 = 𝑘(𝑘 − 1)5 .
• If a and b have different colors, then 𝑃𝐺 𝑘 = 𝑘(𝑘 − 1)(𝑘 − 2)5 .
Therefore, 𝑃𝐺 𝑘 = 𝑘(𝑘 − 1)5 +𝑘(𝑘 − 1)(𝑘 − 2)5 .
Since 𝑃𝐺 1 = 0 but 𝑃𝐺 2 = 2 ≩ 0, then 𝜒 𝐺 = 2.
(ii)

= ( - )

Since 𝑃𝐺 1 = 0 , 𝑃𝐺 2 = 0 but 𝑃𝐺 3 ≩ 0 then 𝜒 𝐺 = 3.

You might also like