0% found this document useful (0 votes)
15 views59 pages

Graph Theory - II

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)
15 views59 pages

Graph Theory - II

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/ 59

UFAR

Graph theory

Graph Terminology and Special Types of Graphs

Exercise
Show that in a simple graph with at least two vertices there must be two vertices that have the same degree.
Solution If not, then the possible vertex degrees
0,1,…,n−10,1,…,n−1 would each occur exactly once. But, 0 and n−1 can't both be vertex degrees at the
same time… unless 0=n−1 of course.

ARMEN HAYRAPETIAN 1
UFAR

ARMEN HAYRAPETIAN 2
UFAR

Exercise

Exercise Show that there is no simple graph with 12 vertices and 28 edges in which
 The degree of each vertex is either 3 or 4
 The degree of each vertex is either 3 or 6

Exercise Suppose G has V vertices and E edges. Let M and m denote, respectively, the maximum and
minimum of the degrees of the vertices in G. Show that m ≤ 2E/V ≤ M.

ARMEN HAYRAPETIAN 3
UFAR

ARMEN HAYRAPETIAN 4
UFAR

ARMEN HAYRAPETIAN 5
UFAR

Let G be a graph by 𝑝 vertices and 𝑞 edges:


 Adjacency matrix is size of 𝑝2
 Number of ones in matrix is 2𝑞
 Number of zeroes in matrix is 𝑝2 − 2𝑞
 Sum of each row or column is equal to correspond vertex degree.
 Sum of all numbers in matrix is 2𝑞

ARMEN HAYRAPETIAN 6
UFAR

Exercise How many edges does a graph have if its degree sequence is 4, 3, 3, 2, 2? Draw such a graph.

Exercise Find all nonisomrphic simple graphs of order 4.


Solution N(4,6)=1 is the complete graph. N(4,5)=1 and N(4,4)=2 and from the above example we know
N(4,3)=3. It is easy to see N(4,2)=2, N(4,1)=1, N(4,0)=1. So the total number of nonisomorphic graphs of
order 4 is: N(4,0)+ N(4,1)+ N(4,2)+ N(4,3)+ N(4,4)+ N(4,5)+ N(4,6)=1+1+2+3+2+1+1=11

ARMEN HAYRAPETIAN 7
UFAR

Exercise

Exercise Show that two graphs G and H with the same vertices V={1,2,3,…,n} such that for every i in V
degree of vertex i is the same for the both graphs need not to be isomorphic.

Exercise Determine whether the graphs G and H displayed in Figure are isomorphic.

Solution Both G and H have six vertices and seven edges. Both have four vertices of degree two and two
vertices of degree three. It is also easy to see that the subgraphs of G and H consisting of all vertices of
degree two and the edges connecting them are isomorphic. Now we will try to find an isomorphism f.

ARMEN HAYRAPETIAN 8
UFAR

Exercise Determine whether the graphs G and H shown in Figure are isomorphic.

Solution For the right given graphs, both G and H have five vertices and six edges, both have two vertices
of degree three and three vertices of degree two, and both have a simple circuit of length three, a simple
circuit of length four, and a simple circuit of length five. Because all these isomorphic invariants agree, G
and H may be isomorphic.
we define the mapping f with for the right graph
𝑓(𝑢1 ) = 𝑣3 , 𝑓(𝑢4 ) = 𝑣2 , 𝑓(𝑢3 ) = 𝑣1 , 𝑓(𝑢2 ) = 𝑣5 , 𝑓(𝑢5 ) = 𝑣4
we define the mapping f with for the left graph
𝑓(𝑢1 ) = 𝑣1 , 𝑓(𝑢4 ) = 𝑣4 , 𝑓(𝑢2 ) = 𝑣3 , 𝑓(𝑢3 ) = 𝑣2 , 𝑓(𝑢5 ) = 𝑣6 , 𝑓(𝑢6 ) = 𝑣5

either by showing that f preserves edges or by showing that with the appropriate orderings of vertices the
adjacency matrices of G and H are the same.

Exercise Determine which two graphs are isomorphic?

ARMEN HAYRAPETIAN 9
UFAR

Exercise Show that isomorphism of simple graphs is an equivalence relation.

Exercise Suppose that G and H are isomorphic simple graphs. Show that their complementary graphs G and
H are also isomorphic.

ARMEN HAYRAPETIAN 10
UFAR

Some Special Simple Graphs


 Complete Graphs: 𝐾𝑛

A complete graph on n vertices, denoted by 𝐾𝑛 , is a simple graph that contains exactly one edge
between each pair of distinct vertices.

 Cycles: 𝐶𝑛

 Regular Graphs

𝐾𝑛 𝑖𝑠 (𝑛 − 1) 𝑟𝑒𝑔𝑢𝑙𝑎𝑟 𝑔𝑟𝑎𝑝ℎ.
𝐶𝑛 𝑖𝑠 2 𝑟𝑒𝑔𝑢𝑙𝑎𝑟 𝑔𝑟𝑎𝑝ℎ.
These are samples for 3 regular graphs.

ARMEN HAYRAPETIAN 11
UFAR
 Wheels: 𝑊𝑛

Exercise Find the number of vertices and edges and their degree sequences of each of the
following graphs: 𝐶𝑛 , 𝐾𝑛 , 𝑊𝑛

 n-Cubes: 𝑄𝑛

𝑄𝑛 𝑖𝑠 𝑛 𝑟𝑒𝑔𝑢𝑙𝑎𝑟 𝑔𝑟𝑎𝑝ℎ.

Exercise Represent each of these graphs with an adjacency matrix.

𝐾3 , 𝐾4 , 𝐾5 , 𝐶3 , 𝐶4 , 𝑊3 , 𝑊4 , 𝑄3

Exercise Find an adjacency matrix for each of these graphs.

𝐾𝑛 , 𝐶𝑛 , 𝑊𝑛

ARMEN HAYRAPETIAN 12
UFAR

Exercise A simple graph that is isomorphic with its complement called self-complementary graph. Show
that G and H are self-complementary graphs. Of order 5.

Exercise

𝑝2
Exercise A simple graph 𝐺 with 𝑝 ≥ 3 vertices and [ 4 ] + 1 edges include at least a subgraph 𝐾3 .
𝑝2 32
Solution For 𝑝 = 3: 𝑞 = [ 4 ] + 1 = [ 4 ] + 1 = 3 then the graph is 𝐾3 .
𝑝2 42
For 𝑝 = 4: 𝑞 = [ 4 ] + 1 = [ 4 ] + 1 = 5 then the graph include two 𝐾3 .
(𝑝−2)2
We will proof this by induction and suppose it is true for every graph with 𝑝 − 2 vertices and [ ]+1
4
𝑝2
edges. Now consider a simple graph 𝐺 with 𝑝 vertices and [ 4 ] + 1 edges.
Select the edge = {𝑢, 𝑣} , remove these vertices and all incidence edges on these vertices.
Now 𝐺 − {𝑢, 𝑣} is a graph with 𝑝 − 2 vertices and 𝑞𝑛𝑒𝑤 edges:
(𝑝−2)2
 if 𝑞𝑛𝑒𝑤 ≥ [ ] + 1 by induction the subgraph include a 𝐾3 .
4
(𝑝 − 2)2 𝑝2 − 4𝑝 + 4 𝑝2
𝑞𝑛𝑒𝑤 ≥ [ ]+1= [ ]+1=[ ]−𝑝+2
4 4 4
𝑝2
 if 𝑞𝑛𝑒𝑤 < [ 4 ] − 𝑝 + 2 then
𝑞𝑛𝑒𝑤 = 𝑞 − 𝑑𝑒𝑔𝑢 − 𝑑𝑒𝑔𝑣 + 1
𝑝2
𝑞 − 𝑑𝑒𝑔𝑢 − 𝑑𝑒𝑔𝑣 + 1 < [ ] − 𝑝 + 2
4
𝑝2 𝑝2
[ ] + 1 − 𝑑𝑒𝑔𝑢 − 𝑑𝑒𝑔𝑣 + 1 < [ ] − 𝑝 + 2
4 4
(𝑑𝑒𝑔𝑢 − 1) + (𝑑𝑒𝑔𝑣 − 1) > 𝑝 − 2
So there is a vertex such as 𝑤 that is adjacent with {𝑢, 𝑣} and this a triangle subgraph.

ARMEN HAYRAPETIAN 13
UFAR

 Bipartite Graphs

Why C6 is bipartite?

𝑊𝑒 𝑐𝑎𝑛 𝑠𝑒𝑙𝑒𝑐𝑡 𝑉1 = {𝑣1 , 𝑣3 , 𝑣5 } 𝑎𝑛𝑑 𝑉2


= {𝑣2 , 𝑣4 , 𝑣6 } 𝑑𝑖𝑠𝑗𝑜𝑖𝑛𝑡 𝑠𝑒𝑡𝑠 𝑎𝑛𝑑 𝑒𝑣𝑒𝑟𝑦 𝑒𝑑𝑔𝑒 𝑖𝑛 𝑡ℎ𝑒 𝑔𝑟𝑎𝑝ℎ 𝑐𝑜𝑛𝑛𝑒𝑐𝑡𝑠 𝑎 𝑣𝑒𝑟𝑡𝑒𝑥 𝑖𝑛 𝑉1 𝑎𝑛𝑑 𝑎 𝑣𝑒𝑟𝑡𝑒𝑥 𝑉2 .

Are the graphs G and H displayed in the figure bipartite?

ARMEN HAYRAPETIAN 14
UFAR
 Complete Bipartite Graphs
A complete bipartite graph 𝐾𝑚,𝑛 is a graph that has its vertex set partitioned into two subsets of m
and n vertices, respectively with an edge between two vertices if and only if one vertex is in the first
subset and the other vertex is in the second subset. The complete bipartite graphs 𝐾2,3 , 𝐾3,3 , 𝐾3,5 , 𝐾2,6
are displayed in Figure.

Exercise
Find cycles in complete bipartite graph and write the length of cycle. Is it even number?

Theorem: The following are equivalent for a graph G:


(i) G is 2-colorable.
(ii) G is bipartite.
(iii) Every cycle of G has even length.

Proof (i) implies (ii). Suppose G is 2-colorable. Let M be the set of vertices painted the first color, and let N
be the set of vertices painted the second color. Then M and N form a bipartite partition of the vertices of G
since neither the vertices of M nor the vertices of N can be adjacent to each other since they are of the same
color.
(ii) implies (iii). Suppose G is bipartite and M and N form a bipartite partition of the vertices of G. If a cycle
begins at a vertex u of, say, M, then it will go to a vertex of N, and then to a vertex of M, and then to N and
so on. Hence when the cycle returns to u it must be of even length. That is, every cycle of G will have even
length.
(iii) implies (i). Lastly, suppose every cycle of G has even length. We pick a vertex in each connected
component and paint it the first color, say red. We then successively paint all the vertices as follows: If a
vertex is painted red, then any vertex adjacent to it will be painted the second color, say blue. If a vertex is
painted blue, then any vertex adjacent to it will be painted red. Since every cycle has even length, no
adjacent vertices will be painted the same color. Hence G is 2-colorable, and the theorem is proved.

ARMEN HAYRAPETIAN 15
UFAR
Example for Bipartite Graphs and Matchings
Bipartite graphs can be used to model many types of applications that involve matching the elements
of one set to elements of another. For example Job Assignments.

ARMEN HAYRAPETIAN 16
UFAR

Paths, Connectivity, Distance and Diameter, Cut points and Bridges

Fig.8-8

ARMEN HAYRAPETIAN 17
UFAR

Fig.8-9

ARMEN HAYRAPETIAN 18
UFAR

Exercise
Consider the graph G in below Fig. Find:

ARMEN HAYRAPETIAN 19
UFAR

Exercise

ARMEN HAYRAPETIAN 20
UFAR

Exercise
Suppose a graph G contains two distinct paths from a vertex u to a vertex v. Show that G has a cycle.
Exercise
Show that a simple graph G with n vertices is connected if it has more than (n − 1)(n − 2)/2 edges.
Exercise
Suppose G is a finite connected cycle-free graph with at least one edge. Show that G has at least two vertices
of degree 1.(proof this by induction).

Exercise Prove that:


If deg(𝑢) + deg(𝑣) ≥ 𝑛 − 1 𝑓𝑜𝑟 𝑒𝑣𝑒𝑟𝑦 𝑡𝑤𝑜 𝑛𝑜𝑛𝑎𝑑𝑗𝑎𝑐𝑒𝑛𝑡 𝑣𝑒𝑡𝑟𝑖𝑐𝑒𝑠 𝑢 𝑎𝑛𝑑 𝑣, 𝑡ℎ𝑒𝑛 𝐺 𝑖𝑠 𝑐𝑜𝑛𝑛𝑒𝑐𝑡𝑒𝑑.
Solution
 If deg(𝑢) = 0 𝑡ℎ𝑒𝑛 𝑤𝑒 ℎ𝑎𝑣𝑒 deg(𝑣) ≥ 𝑛 − 1, 𝑡ℎ𝑖𝑠 𝑠ℎ𝑜𝑤𝑠 𝑣 𝑖𝑠 𝑐𝑜𝑛𝑛𝑒𝑐𝑡𝑒𝑑 𝑡𝑜 𝑎𝑙𝑙 𝑣𝑒𝑟𝑡𝑖𝑐𝑒𝑠, 𝑠𝑜
deg(𝑢) ≠ 0 .
 If deg(𝑢) = 𝑘 𝑡ℎ𝑒𝑟𝑒 𝑎𝑟𝑒 {𝑤1 , 𝑤2 , 𝑤3 , … , 𝑤𝑘 } 𝑣𝑒𝑟𝑡𝑖𝑐𝑒𝑠 𝑠𝑢𝑐ℎ 𝑡ℎ𝑎𝑡 𝑢𝑤1 , 𝑢𝑤2 , … , 𝑢𝑤𝑘 ∈ 𝐸
If 𝑣𝑤1 , 𝑣𝑤2 , … , 𝑣𝑤𝑘 ∉ 𝐸 𝑎𝑙𝑠𝑜 𝑤𝑒 ℎ𝑎𝑣𝑒 𝑣𝑢 ∉ 𝐸 𝑡ℎ𝑒𝑛, deg(𝑣) ≤ 𝑛 − 𝑘 − 2
deg(𝑢) + deg(𝑣) ≤ 𝑘 + 𝑛 − 𝑘 − 2 = 𝑛 − 2
𝑛 − 1 ≤ deg(𝑢) + deg(𝑣) ≤ 𝑛 − 2
Therefore 𝑣 𝑖𝑠 𝑎𝑑𝑗𝑎𝑐𝑒𝑛𝑡 𝑡𝑜 𝑎𝑡 𝑙𝑒𝑎𝑠𝑡 𝑜𝑛𝑒 𝑤𝑗 , 𝑠𝑜 (𝑢, 𝑤𝑗 , 𝑣) 𝑖𝑠 𝑎 𝑝𝑎𝑡ℎ 𝑡𝑜 𝑐𝑜𝑛𝑛𝑒𝑐𝑡 𝑢 𝑡𝑜 𝑣.

Exercise
𝑛−1
Let G has 𝑛 vertices, and 𝑑𝑚𝑖𝑛 = 𝛿 is the minimal degree. Prove that if 𝑑𝑚𝑖𝑛 = 𝛿 ≥ 2 , then G is
connected.
Solution Select two vertices 𝑢, 𝑣 ∈ 𝑉 𝑠𝑢𝑐ℎ 𝑡ℎ𝑎𝑡 𝑢𝑣 ∉ 𝐸 , by given condition we will proof above property
for graph G, so G is connected.
𝑛−1
deg(𝑢) + deg(𝑣) ≥ 𝛿 + 𝛿 = 2𝛿 ≥ 2 =𝑛−1
2

Exercise
Let G be a simple graph with 𝑛 vertices and 𝑚 edges. How many edges has the complementary graph?

𝑛(𝑛−1)
Solution Since 𝐺 ∪ 𝐺̅ = 𝐾𝑛 and |𝐸(𝐾𝑛 )| = 2 we have:

𝑛(𝑛 − 1) 𝑛(𝑛 − 1)
|𝐸(𝐺)| + |𝐸(𝐺̅ )| = ⇒ |𝐸(𝐺̅ )| = −𝑛
2 2

ARMEN HAYRAPETIAN 21
UFAR
Exercise
Can a graph and its complement both be disconnected?

Solution No. At least one of the graphs 𝐺 or 𝐺̅ is connected. We will proof if G is disconnected then its
complement is connected.
Let 𝐺 be a disconnected graph. Since 𝑉(𝐺) = 𝑉(𝐺̅ ) we will show every pair of distinct vertices in 𝐺 is
connected in 𝐺̅ . Select two vertices 𝑢, 𝑣 ∈ 𝑉(𝐺), and because 𝐺 is disconnect there are at least two
components in 𝐺, so there are two possibilities with our two vertices, there either in different components or
in the same component.
1) If 𝑢, 𝑣 are in different components then 𝑢𝑣 ∉ 𝐸(𝐺) so 𝑢𝑣 ∈ 𝐸(𝐺̅ ) .

u v

2) If 𝑢, 𝑣 are in the same component, since we have a disconnected graph there is at least a vertex in the
other component, we select 𝑤 ∈ 𝑉(𝐺) on the other component:
𝑢𝑤 ∉ 𝐸(𝐺) 𝑎𝑛𝑑 𝑣𝑤 ∉ 𝐸(𝐺) ⇒ 𝑢𝑤 ∈ 𝐸(𝐺̅ ) 𝑎𝑛𝑑 𝑣𝑤 ∈ 𝐸(𝐺̅ ) so (𝑢, 𝑤, 𝑣) is a path to connect 𝑢, 𝑣 in
the 𝐺̅ .
u w
v

The number of paths between vertices of a specified length

ARMEN HAYRAPETIAN 22
UFAR

Vertex cut, Edge cut


Vertex cut
A subset V  of the vertex set V of G = (V, E) is a vertex cut, or separating set, if G  V  is disconnected.
We define the vertex connectivity of a noncomplete graph G, denoted by κ(G), as the minimum number of
vertices in a vertex cut.

EDGE CONNECTIVITY
We can also measure the connectivity of a connected graph G = (V, E) in terms of the minimum number of
edges that we can remove to disconnect it. If a graph has a cut edge, then we need only remove it to
disconnect G. If G does not have a cut edge, we look for the smallest set of edges that can be removed to
disconnect it. A set of edges E  is called an edge cut of G if the subgraph G − E  is disconnected. The edge
connectivity of a graph G, denoted by λ(G), is the minimum number of edges in an edge cut of G.
This defines λ(G) for all connected graphs with more than one vertex because it is always possible to
disconnect such a graph by removing all edges incident to one of its vertices.
Note that λ(G) = 0 if G is not connected. We also specify that λ(G) = 0 if G is a graph consisting of a single
vertex. It follows that if G is a graph with n vertices, then 0 ≤ λ(G) ≤ n − 1.
λ(G) = n − 1 where G is a graph with n vertices if and only if G = Kn, which is equivalent to the statement
that λ(G) ≤ n − 2 when G is not a complete graph.
APPLICATIONS OF VERTEX AND EDGE CONNECTIVITY Graph connectivity plays an important
role in many problems involving the reliability of networks. For instance, as we mentioned in our
introduction of cut vertices and cut edges, we can model a data network using vertices to represent routers
and edges to represent links between them. The vertex connectivity of the resulting graph equals the
minimum number of routers that disconnect the network when they are out of service. If fewer routers are
down, data transmission between every pair of routers is still possible. The edge connectivity represents the
minimum number of fiber optic links that can be down to disconnect the network. If fewer links are down, it
will still be possible for data to be transmitted between every pair of routers.

Exercise In the given graph determine λ(G), κ(G).

ARMEN HAYRAPETIAN 23
UFAR

AN INEQUALITY FOR VERTEX CONNECTIVITY AND EDGE CONNECTIVITY


When G = (V , E) is a noncomplete connected graph with at least three vertices, the minimum degree of a
vertex of G is an upper bound for both the vertex connectivity of G and the edge connectivity of G.

Connectedness in Directed Graphs


Strongly connected
A directed graph is strongly connected if there is a path from a to b and from b to a whenever a and b are
vertices in the graph.
Weakly connected
A directed graph is weakly connected if there is a path between every two vertices in the underlying
undirected graph.
That is, a directed graph is weakly connected if and only if there is always a path between two vertices when
the directions of the edges are disregarded. Clearly, any strongly connected directed graph is also weakly
connected.
Example Are the directed graphs G and H shown in Figure 5 strongly connected? Are they weakly
connected?
Solution G is strongly connected because there is a path
between any two vertices in this directed graph. Hence, G is
also weakly connected. The graph H is not strongly
connected. There is no directed path from a to b in this graph.
However, H is weakly connected, because there is a path
between any two vertices in the underlying undirected graph
of H.

Exercise Determine whether each of these graphs is strongly connected and if not,
whether it is weakly connected?

ARMEN HAYRAPETIAN 24
UFAR

Exercise

Exercise

Exercise The Petersen graph is a simple graph whose vertices are two element subset of a 5 element set and
whose edges are the pairs of disjoint 2 elements subset. By this definition construct the graph and show that
in the Petersen graph κ(G)=3.

ARMEN HAYRAPETIAN 25
UFAR

Eulerian Graphs, Hamiltonian Graphs

APPLICATIONS OF EULER PATHS AND CIRCUITS For example, if a postman can find an Euler path in
the graph that represents the streets the postman needs to cover, this path produces a route that traverses
each street of the route exactly once. If no Euler path exists, some streets will have to be traversed more than
once.

ARMEN HAYRAPETIAN 26
UFAR

Example
Which of the undirected graphs in Figure have an Euler circuit? Of those that do not, which have an Euler
path?

Solution: The graph G1 has an Euler circuit, for example, a, e, c, d, e, b, a. Neither of the graphs G2 or G3 has
an Euler circuit. However, G3 has an Euler path, namely, a, c, d, e, b, d, a, b. G2 does not have an Euler path.

Fleury’s algorithm, published in 1883, constructs Euler circuits by first choosing an arbitrary vertex of a
connected multigraph, and then forming a circuit by choosing edges successively. Once an edge is chosen, it
is removed. Edges are chosen successively so that each edge begins where the last edge ends, and so that
this edge is not a cut edge unless there is no alternative.
1. Make sure the graph has either 0 or 2 odd vertices.
2. If there are 0 odd vertices, start anywhere. If there are 2 odd vertices, start at one of them.
3. Follow edges one at a time. If you have a choice between a bridge and a non-bridge, always choose
the non-bridge.
4. Stop when you run out of edge.

ARMEN HAYRAPETIAN 27
UFAR

ARMEN HAYRAPETIAN 28
UFAR

ARMEN HAYRAPETIAN 29
UFAR

Example
Many puzzles ask you to draw a picture in a continuous motion without lifting a pencil so that no part of the
picture is retraced. We can solve such puzzles using Euler circuits and paths. For example, can
Mohammed’s scimitars, shown in Figure 6, be drawn in this way, where the drawing begins and ends at the
same point?

Solution We can solve this problem because the graph G shown in Figure 6 has an Euler circuit. It has such
a circuit because all its vertices have even degree.
The Euler circuit a, b, d, g, h, j, i, h, k, g, f, d, c, b, e, i, f, e, a. This circuit gives a way to draw the scimitars
without lifting the pencil or retracing part of the picture.

Example
Find a Hamilton circuit for Q3.

circuit for Q3 is displayed in Figure 14. The sequence of bit strings differing in exactly one bit produced by
this Hamilton circuit is 000, 001, 011, 010, 110, 111, 101, 100.

Example Does the following graph have a Hamiltonian Circuit?


SolutionYes,it has a Hamiltonian circuit. The solution is –

ARMEN HAYRAPETIAN 30
UFAR
Example An example of a HC is shown below.

Exercise Show that the Petersen graph, shown here, does not have a Hamilton circuit, but that the subgraph
obtained by deleting a vertex v, and all edges incident with v, does have a Hamilton circuit.

For example by removing vertex “a” : f-i-d-e-j-g-b-c-h-f is a Hamilton circuit in graph G-{a}

ARMEN HAYRAPETIAN 31
UFAR
Ore’s Theorem
Let G be a simple Ore graph of order 𝑛 ≥ 3.
That is:
For each pair of nonadjacent vertices 𝑑𝑒𝑔𝑢 + 𝑑𝑒𝑔𝑣 ≥ 𝑛 .
Then G is Hamiltonian (has a Hamiltonian circuit).

Proof We prove by contradiction:

ARMEN HAYRAPETIAN 32
UFAR

Notice: Hamiltonian Graph is not necessarily Ore Graph


Example 𝐶5 is a Hamiltonian graph and is not Ore graph.

DIRAC’S THEOREM If G is a simple graph with n vertices with n ≥ 3 such that the degree of every vertex
in G is at least n/2, then G has a Hamilton circuit.
𝑛 𝑛
Proof For each pair of nonadjacent vertices 𝑑𝑒𝑔𝑢 + 𝑑𝑒𝑔𝑣 ≥ 2 + 2 ⇒ 𝑑𝑒𝑔𝑢 + 𝑑𝑒𝑔𝑣 ≥ 𝑛
From Ore’s Theorem G is a Hamiltonian graph.

Notice: Hamiltonian Graph is not necessarily Dirac Graph


Example 𝐶5 is a Hamiltonian graph and is not Dirac graph.
Example Give a counterexample to show that Ore and Dirac conditions are not necessary for a graph to be a
Hamiltonian graph.

Exercise For each of these graphs, determine (i) whether Dirac’s theorem can be used to show that the graph
has a Hamilton circuit, (ii) whether Ore’s theorem can be used to show that the graph has a Hamilton circuit,
and (iii) whether the graph has a Hamilton circuit.

(𝑛−1)(𝑛−2)
Exercise Let G be a simple graph with 𝑛 vertices and 𝑛 ≥ 3 . If 𝑚 ≥ + 2 ,then G is Hamiltonian.
2
Solution If G is complete graph then G is Hamiltonian. Suppose G is not complete, so there are two
nonadjacent vertices 𝑢 𝑎𝑛𝑑 𝑣. 𝐻 = 𝐺 − {𝑢, 𝑣} has 𝑛 − 2 vertices and 𝑞 edges.
(𝑛 − 2)(𝑛 − 3)
𝑞≤
2
𝑚 − 𝑞 = 𝑑𝑒𝑔𝑢 + 𝑑𝑒𝑔𝑣
(𝑛 − 1)(𝑛 − 2) (𝑛 − 2)(𝑛 − 3)
𝑚−𝑞 ≥ +2−
2 2
𝑚 − 𝑞 ≥ 𝑛 ⇒ 𝑑𝑒𝑔𝑢 + 𝑑𝑒𝑔𝑣 ≥ 𝑛
For each pair of nonadjacent vertices 𝑑𝑒𝑔𝑢 + 𝑑𝑒𝑔𝑣 ≥ 𝑛. So G is a Ore graph and is Hamiltonian.

ARMEN HAYRAPETIAN 33
UFAR
Exercises
1. A sequence d1, d2,...,dn is called graphic if it is the degree sequence of a simple graph.
Determine whether each of these sequences is graphic. For those that are, draw a graph having the given
degree sequence.
a) 5, 4, 3, 2, 1, 0(not graphic) b) 6, 5, 4, 3, 2, 1(not graphic) c) 2, 2, 2, 2, 2, 2,0(graphic)
d) 3, 3, 3, 2, 2, 2(not graphic) e) 3, 3, 2, 2, 2, 2(graphic) f ) 1, 1, 1, 1, 1, 1(graphic)
g) 5, 3, 3, 3, 3, 3(graphic) h) 5, 5, 4, 3, 2, 1 (not graphic) i) 5,4,4,4,3,3,2,2,2,1,0,0(graphic)

2. How many vertices does a regular graph of degree 4 with 10 edges have?

3. How many vertices does a regular graph of degree r with q edges have?

4. How many vertices and how many edges do these graphs have?
a) 𝐾𝑛 b) 𝐾𝑚,𝑛 c) 𝐶𝑛 d) 𝑊𝑛

5. Draw these graphs: 𝐾7 , 𝐶7 , 𝑊7 , 𝑄4 , 𝐾4,4 , 𝐾1,8

𝑛∙2𝑛
6. Show that the hypercube graph 𝑄𝑛 is a n-regular with edges.
2

Solution Since each component of n-tuple either 0 or 1 there are 2𝑛 vertices. For any vertex that
corresponds a n-tuple there are n vertices with n-tuples that differ from the given n-tuple in exactly in
𝑛∙2𝑛
one component. Thus 𝑄𝑛 is a n-regular graph with 2𝑛 vertices, so with edges.
2

7. The complementary graph 𝐺̅ of a simple graph 𝐺 has the same vertices as G. Two vertices are
adjacent in 𝐺̅ if and only if they are not adjacent in 𝐺. Describe each of these graphs:
̅𝑛 , 𝐶𝑛̅ , ̅
𝐾 𝐾𝑛,𝑚 , ̅̅̅̅
𝑊𝑛

ARMEN HAYRAPETIAN 34
UFAR

ARMEN HAYRAPETIAN 35
UFAR
Graph Coloring
A coloring of a simple graph is the assignment of a color to each vertex of the graph so that no two
adjacent vertices are assigned the same color.
The chromatic number of a graph is the least number of colors needed for a coloring of this graph.
The chromatic number of a graph G is denoted by χ(G).
THE FOUR COLOR THEOREM The chromatic number of a planar graph is no greater than four.
Example What are the chromatic number of the graph G shown in Figure.

Solution The chromatic number of G is at least three, because the vertices a, b, and c must be assigned
different colors. To see if G can be colored with three colors, assign red to a, blue to b, and green to c. Then,
d can (and must) be colored red because it is adjacent to b and c. Furthermore, e can (and must) be colored
green because it is adjacent only to vertices colored red and blue, and f can (and must) be colored blue
because it is adjacent only to vertices colored red and green. Finally, g can (and must) be colored red
because it is adjacent only to vertices colored blue and green. This produces a coloring of G using exactly
three colors. Below figure displays such a coloring, so χ(G)=3.

Exercise What is the chromatic number for a bipartite graph? χ (𝐾𝑚,𝑛 ) = 2


Example What is the chromatic number of 𝐾𝑛 ?
Solution A coloring of 𝐾𝑛 can be constructed using n colors by assigning a different color to each vertex.
Is there a coloring using fewer colors? The answer is no. No two vertices can be assigned the same color,
because every two vertices of this graph are adjacent. Hence, the chromatic number of 𝐾𝑛 is n. That is,
χ (𝐾𝑛 ) = n. (Recall that 𝐾𝑛 is not planar when n ≥ 5, so this result does not contradict the four color
theorem.) A coloring of 𝐾5 using five colors is shown in Figure.

Example What is the chromatic number of 𝐶6 ?


Solution χ (𝐶6 ) = 2

ARMEN HAYRAPETIAN 36
UFAR
Example What is the chromatic number of 𝐶5 ?
Solution χ (𝐶5 ) = 3

Example What is the chromatic number of the graph 𝑊𝑛 , 𝐶𝑛 , where n ≥ 3?


Solution χ (𝐶𝑛 ) = 2 if n is an even positive integer with n ≥ 4 and χ (𝐶𝑛 ) = 3 if n is an odd positive integer
with n ≥ 3.
χ (𝑊𝑛 ) = 4 if n is an odd positive integer with n ≥ 3 and χ (𝑊𝑛 ) = 3 if n is an even positive integer with n ≥ 4.

ARMEN HAYRAPETIAN 37
UFAR

Theorem For every graph G, 𝜒(𝐺) ≤ Δ(G) + 1.

ARMEN HAYRAPETIAN 38
UFAR

Applications of Graph Colorings


Example Scheduling Final Exams
How can the final exams at a university be scheduled so that no student has two exams at the same time?
This scheduling problem can be solved using a graph model, with vertices representing courses and with an
edge between two vertices if there is a common student in the courses they represent. Each time slot for a
final exam is represented by a different color. A scheduling of the exams corresponds to a coloring of the
associated graph.
For instance, suppose there are seven finals to be scheduled. Suppose the courses are numbered 1 through 7.
Suppose that the following pairs of courses have common students: 1 and 2, 1 and 3, 1 and 4, 1 and 7, 2 and
3, 2 and 4, 2 and 5, 2 and 7, 3 and 4, 3 and 6, 3 and 7, 4 and 5, 4 and 6, 5 and 6, 5 and 7, and 6 and 7. In
Figure 8 the graph associated with this set of classes is shown.

By coloring this graph, we will get that χ (G) = 4 so four time slots are needed. A coloring of the graph using
four colors and the associated schedule are shown in Figure 9.

ARMEN HAYRAPETIAN 39
UFAR
Welsh Powell Graph coloring Algorithm
In graph theory, vertex coloring is a way of labelling each individual vertex such that no two adjacent
vertex have same color. But we need to find out the number of colors we need to satisfy the given
condition. It is not desirable to have a large variety of colors or labels. So, we have an algorithm called
welsh Powell algorithm that gives the minimum colors we need. This algorithm is also used to find the
chromatic number of a graph. This is an iterative greedy approach.
Chromatic number: A graph G that requires K distinct colors for it’s proper coloring, and no less, is
called a K-chromatic graph, and the number K is called the chromatic number of graph G.
Welsh Powell Algorithm consists of following Steps:
1. Find the degree of each vertex
2. List the vertices in order of descending degrees.
3. Color the first vertex with color 1.
4. Move down the list and color all the vertices not connected to the colored vertex, with the same color.
5. Repeat step 4 on all uncolored vertices with a new color, in descending order of degrees until all the
vertices are colored.
By starting with the highest degree, we make sure that the vertex with the highest number of conflicts can
be taken care of as early as possible.

First, order the list in descending order of degrees.


So, the new order will be: H, K, D, G, I, J, A, B, E, F, C
Now, Following Welsh Powell Graph coloring Algorithm,
H – color Red
K – don’t color Red, as it connects to H
D – color Red
G – don’t color Red, as it connects to H
I – don’t color Red, as it connects to H
J – don’t color Red, as it connects to H
A – don’t color Red, as it connects to H
B – don’t color Red, as it connects to D
E – color Red
F – don’t color Red, as it connects to E
C – don’t color Red, as it connects to D
After this, the graph will look like the one.

ARMEN HAYRAPETIAN 40
UFAR
Ignoring the vertices already colored, we are left with : K, G, I, J, A, B, F, C
We can repeat the process with the second color Green
K – Color green
G – don’t color green, as it connects with K
I – color green
J – don’t color green, as it connects with I
A – color green
B – don’t color green, as it connects with A
F – color green
C – color green

Again, ignoring the colored vertices, we are left with


G, J, B Let’s color it with Blue.
G – Color blue
J – color blue
B – color blue
The final figure is shown below. Now, we can see that
using Welsh Powell’s algorithm we can color the vertices
with only 3 types of colors (chromatic number of this
graph is 3) which is the optimal solution, since this graph
contains at least one triangle.

ARMEN HAYRAPETIAN 41
UFAR
Exercise Use the Welch-Powell Algorithm to paint the graph in below Fig.

Solution First order the vertices according to decreasing


degrees to obtain the sequence H, A, D, F, B, C, E, G
Proceeding sequentially, we use the first color to paint the
vertices H, B, and then G. (We cannot paint A, D, or F the first
color since each is connected to H, and we cannot paint C or E
the first color since each is connected to either H or B.)
Proceeding sequentially with the unpainted vertices, we use the
second color to paint the vertices A and D. The remaining
vertices F, C, and E can be painted with the third color. Thus
the chromatic number n cannot be greater than 3. However, in
any coloring, H, D, and E must be painted different colors since
they are connected to each other. Hence n = 3.

Exercise Use the Welch-Powell algorithm to paint each graph in Fig. 8-65. Find the chromatic number n
of the graph.

ARMEN HAYRAPETIAN 42
UFAR

Edge coloring
In graph theory, an edge coloring of a graph is an assignment of "colors" to the edges of the graph so that
no two incident edges have the same color.
The edge-coloring problem asks whether it is possible to color the edges of a given graph using at
most k different colors, for a given value of k, or with the fewest possible colors. The minimum
required number of colors for the edges of a given graph is called the chromatic index of the graph
and denoted by 𝝌́(𝑮).

Vizing's theorem
By Vizing's theorem, the number of colors needed to edge color a simple graph
is either its maximum degree Δ or Δ+1.
𝚫(𝑮) ≤ 𝝌́(𝑮) ≤ 𝚫(𝑮) + 𝟏

When n is odd, the chromatic index of the complete graph on n vertices is n; When n is even, the
chromatic index of the complete graph on n vertices is n - 1.

ARMEN HAYRAPETIAN 43
UFAR
Planar graph
We will use the term planar graph to refer to a graph where it is possible to draw the graph without
crossings. We will use the abbreviation PG for a planar graph. PG’s are graphs that can be mapped in the
plane.

Three Houses and Three Utilities.

Example Show that complete graph by 4 vertices and hypercube by 8 vertices are planar.

Kuratowski’s Theorem

Exercise Draw a planar representation, if possible, of the graphs (a), (b), and (c) in Fig.

Example Show that the Petersen graph is not planar.

ARMEN HAYRAPETIAN 44
UFAR
EULER’S FORMULA
The number of vertices, edges, and faces of a map or a graph are related by Euler’s formula, provided
that we consider the unbounded surrounding area as one of the faces. We define the symbols V, E, and F
as follows:
• V is the number of vertices.
• E is the number of edges.
• F is the number of faces.
Remember to count the unbounded surrounding area. According to Euler’s formula, for a map or a
graph :
V + F = E + 2 The number of vertices plus the number of faces is two more than the number of edges.
V+F=E+2

Exercise Verify Euler’s formula for the graphs.

Exercise An example of a PG that doesn’t have a HC is shown:

Exercise An example of a PG that has a HC is shown:

ARMEN HAYRAPETIAN 45
UFAR
Exercise Let G be a connected planar graph with p vertices and q edges, where p ≥ 3. Then 3p − 6 ≥q .
Solution Let r be the number of regions in a planar representation of G. By Euler’s formula,
p − q + r = 2. Each region has degree 3 or more; hence 2q ≥ 3r. Substituting this in Euler’s formula gives
us our result.

Exercise By the last result for connected planar graph 3p − 6 ≥q. Now explain why 𝐾5 is not planar.
Solution The complete graph 𝐾5 on p = 5 vertices and has q = 10 edges. If the graph is planar, then
10 = q ≤ 3p − 6 = 15 − 6 = 9 which is impossible. Thus 𝐾5 is nonplanar.

Exercise Let G be a finite connected planar graph with at least three vertices. Show that G has at least
one vertex of degree 5 or less.
Solution Let p be the number of vertices and q the number of edges of G, and suppose deg(u) ≥ 6 for
each vertex u of G.

2𝑞 ≥ 6𝑝 𝑎𝑛𝑑 𝐺 𝑖𝑠 𝑝𝑙𝑎𝑛𝑎𝑟 𝑠𝑜 𝑞 ≤ 3𝑝 − 6
6𝑝 ≤ 2𝑞 ≤ 6𝑝 − 12 ⇒ 6𝑝 ≤ 6𝑝 − 12
This is a contradiction.

Five Color Theorem Every planar graph can be colored with 5 colors.

Proof. The proof is by induction on the number of vertices n; when n≤5 this is trivial. Now suppose G is
planar on more than 5 vertices; by the exercise some vertex v has degree at most 5. By the induction
hypothesis, G−v can be colored with 5 colors. Color the vertices of G, other than v, as they are colored in
a 5-coloring of G−v. If deg(v)≤4, then v can be colored with one of the 5 colors to give a proper coloring
of G with 5 colors. So we now suppose deg(v)=5. If the five neighbors of v are colored with four or
fewer of the colors, then again v can be colored to give a proper
coloring of G with 5 colors.

Now we suppose that all five neighbors of v have a different color, as


indicated in figure.

Suppose that in G there is a path from v1 to v3, and that the vertices
along this path are alternately colored red and green; call such a path a
red-green alternating path. Then together with v, this path makes a cycle with v2 on the inside and v4 on
the outside, or vice versa. This means there cannot be a purple-blue alternating path from v2 to v4.
Supposing that v2 is inside the cycle, we change the colors of all vertices inside the cycle colored purple
to blue, and all blue vertices are recolored purple. This is still a proper coloring of all vertices
of G except v, and now no neighbor of v is purple, so by coloring v purple we obtain a proper coloring
of G.

If there is no red-green alternating path from v1 to v3, then we recolor vertices as follows: Change the
color of v1 to green. Change all green neighbors of v1 to red. Continue to change the colors of vertices
from red to green or green to red until there are no conflicts, that is, until a new proper coloring is
obtained. Because there is no red-green alternating path from v1 to v3, the color of v3 will not change.
Now no neighbor of v is colored red, so by coloring v red we obtain a proper coloring of G.

ARMEN HAYRAPETIAN 46
UFAR
Exercise By Euler’s formula show that 𝐾3,3 is not planar.
Solution Let us prove by contradiction. if 𝐾3,3 is planar. Then by Euler’s formula
v − e + f = 2. Note that here, v = 6 and e = 9. Moreover, since 𝐾3,3 is bipartite, it contains no 3-cycles
(since it contains no odd cycles at all). So each face of the embedding must be bounded by at least 4
edges from 𝐾3,3. Hence, we must have
f ≤ 2e/4 = e/2 = 4.5
Now, plugging this data in to Euler’s formula, we obtain 2 = v − e + f ≤ 6 − 9 + 4.5 = 1.5, which is
clearly false. Hence, it cannot be that 𝐾3,3 is planar.

Exercise Use Euler’s formula :


a) If a 4 regular PG has 8 faces, find the number of its vertices and edges.

b) If a 4 regular PG has 10 faces, find the number of its vertices and edges.

c) If a 3 regular PG has 12 faces, find the number of its vertices and edges.

d) If the boundary of each region of a connected PG has r edges, what is the relation between number of
vertices, edges and r?

e) In a connected PG no face is triangle, show that q (#edges) is not exceed 2p-4.

f) Let g be the minimum number of edges in a cycle in a connected PG.


Show that 𝑞(𝑔 − 2) ≤ 𝑔(𝑝 − 2).

Exercise Show that a graph with fewer that nine edges is planar.

ARMEN HAYRAPETIAN 47
UFAR
Introduction to Trees

A tree is a connected undirected graph with no simple circuits.


Because a tree cannot have a simple circuit, a tree cannot contain multiple edges or loops. Therefore any
tree must be a simple graph.
Trees are often defined as undirected graphs with the property that there is a unique simple path between
every pair of vertices.

Exercise Which of the graphs shown in Figure are trees?

Exercise Draw all trees with exactly six vertices.

Exercise Prove that:


An undirected graph is a tree if and only if there is a unique simple path between any two of its vertices.

Solution First assume that T is a tree. Then T is a connected graph with no simple cycles. Let x and y be
two vertices of T. Because T is connected, there is a simple path between x and y. Moreover, this path
must be unique, for if there were a second such path, the path formed by combining the first path from x
to y followed by the path from y to x obtained by reversing the order of the second path from x to y
would form a circuit. This implies, that there is a simple circuit in T. Hence, there is a unique simple
path between any two vertices of a tree.
Now assume that there is a unique simple path between any two vertices of a graph T. Then T is
connected, because there is a path between any two of its vertices. Furthermore, T can have no simple
circuits. To see that this is true, suppose T had a simple circuit that contained the vertices x and y. Then
there would be two simple paths between x and y, because the simple circuit is made up of a simple path
from x to y and a second simple path from y to x. Hence, a graph with a unique simple path between any
two vertices is a tree.

ARMEN HAYRAPETIAN 48
UFAR
Exercise A vertex of degree 1 in a graph is called a pendant vertex or end vertex. Show that every tree of
order two or more has at least two end vertices.
Solution Suppose the degree sequence is 𝑑1 , 𝑑2 , 𝑑3 , … , 𝑑𝑛 for n vertices in a tree of order n. This tree has
n-1 edges and if each degree is more than one, the sum of degrees is:
𝑑1 + 𝑑2 + 𝑑3 + ⋯ + 𝑑𝑛 ≥ 2𝑛 ⇒ 2𝑞 ≥ 2𝑛 ⇒ 𝑞 ≥ 𝑛 ⇒ 𝑛 − 1 ≥ 𝑛
And if there is only one pendant vertex the sum of degrees will be 2n-1, so there are at least two pendant
vertices.

Prove Theorem Let G be a finite graph with n ≥ 1 vertices. Then the following are equivalent.
(i) G is a tree.
(ii) G is a cycle-free and has n − 1 edges
(iii) G is connected and has n − 1 edges.

Proof The proof is by induction on n. The theorem is certainly true for the graph with only one vertex
and hence no edges. That is, the theorem holds for n = 1.
We now assume that n > 1 and that the theorem holds for graphs with less than n vertices.
(i) implies (ii)
Suppose G is a tree. Then G is cycle-free, so we only need to show that G has n−1 edges. By
Problem(Suppose G is a finite cycle-free graph with at least one edge. Show that G has at least two vertices
of degree 1), G has a vertex of degree 1. Deleting this vertex and its edge, we obtain a tree T which has n − 1
vertices. The theorem holds for T , so T has n − 2 edges. Hence G has n − 1 edges.
(ii) implies (iii)
Suppose G is cycle-free and has n − 1 edges. We only need show that G is connected. Suppose G is
disconnected and has k connected components, 𝑇1 , 𝑇2 , 𝑇3 , … , 𝑇𝑘 , which are trees since each is connected and
cycle-free. Say 𝑇𝑖 has 𝑛𝑖 vertices. Note 𝑛𝑖 < 𝑛. Hence the theorem holds for 𝑇𝑖 , so 𝑇𝑖 has 𝑛𝑖 − 1 edges.
Thus
𝑛 = 𝑛1 + 𝑛2 + ⋯ + 𝑛𝑘 and
𝑛 − 1 = (𝑛1 − 1) + (𝑛2 − 1) + ⋯ + (𝑛𝑘 − 1)
𝑛 − 1 = (𝑛1 − 1) + (𝑛2 − 1) + ⋯ + (𝑛𝑘 − 1) = (𝑛1 + 𝑛2 + ⋯ + 𝑛𝑘 ) − 𝑘 ⟹ 𝑛 − 1 = 𝑛 − 𝑘 ⇒ 𝑘 = 1
But this contradicts the assumption that G is disconnected and has k > 1 components. Hence G is connected.
(iii) implies (i)
Suppose G is connected and has n − 1 edges. We only need to show that G is cycle-free. Suppose G has a
cycle containing an edge e. Deleting e we obtain the graph H = G − e which is also connected. But H has n
vertices and n − 2 edges, and can not be connected. Thus G is cycle-free and hence is a tree.

Exercise
Display a full set of nonisomorphic trees with seven vertices.

ARMEN HAYRAPETIAN 49
UFAR
Spanning Trees A subgraph T of a connected graph G is called a spanning tree of G if T is a tree and T
includes all the vertices of G.(A graph is connected iff has a spanning tree.)
Finding a spanning tree in a connected graph G is not hard. If G has no circuits, then it is already a tree,
so G is a spanning tree for G. If G contains a circuit, then, we can delete an edge (without deleting any
vertex) so as to remove the circuit but leave the graph connected. By repeating this procedure, we
eventually find a connected subgraph without circuits containing all the vertices of G, that is, a spanning
tree.
Spanning trees are considered to be "different" if they make use of different edges of the graph. Trees T1
and T2 in Fig. are isomorphic, but they are different spanning trees of G.

Exercise Find 3 spanning trees of the graph G shown in below Fig.

Solution 3 different spanning trees of G.

Exercise Find all spanning trees of the graph G shown in below Fig.

Solution All spanning trees

ARMEN HAYRAPETIAN 50
UFAR
Exercise Find a spanning tree of the graphs G shown in below Fig.

ARMEN HAYRAPETIAN 51
UFAR
Kirchhoff Theorem
Let M be the matrix obtained from the adjacency matrix of a connected graph G by changing all l's to -l's
and each diagonal 0 to the degree of the corresponding vertex. Then the number of spanning trees of G is
equal to the value of any cofactor of M.

Example Consider the graph whose adjacency matrix is

Thus, there are eight spanning trees in the graph.

Theorem
The number of labeled trees with n vertices is 𝑛𝑛−2 .
Proof After the vertices of the complete graph 𝐾𝑛 , are labeled, any spanning tree of 𝐾𝑛 is a labeled tree on
n vertices. Conversely, any tree with these n vertices is a spanning tree for 𝐾𝑛 because 𝐾𝑛 , contains all
possible edges. Thus, the number of labeled trees on n vertices is the number of spanning trees for 𝐾𝑛 ,
and the latter number can be determined by Kirchhoff's Theorem.

Example How many spanning trees does 𝐾5 have?

Example How many spanning trees does 𝐾7 have?

ARMEN HAYRAPETIAN 52
UFAR
Labeled and Weighted Graphs

(P, A4, A2, A5, A3, A6, Q) 4+2+3+2+1+2=14

Minimum Spanning Trees (MST)


Suppose G is a connected weighted graph. Then any spanning tree T of G is assigned a total weight obtained
by adding the weights of the edges in T. A minimal spanning tree of G is a spanning tree whose total weight
is as small as possible.

The weight of a minimal spanning tree is unique, but the minimal spanning tree itself is not. Different
minimal spanning trees can occur when two or more edges have the same weight. In such a case, the
arrangement of the edges in Step 1 of Algorithms 8.2. or 8.3 is not unique and hence may result in different
minimal spanning trees as illustrated in the following example.

ARMEN HAYRAPETIAN 53
UFAR
Example Find a minimal spanning tree of the weighted graph Q in Fig. 8-20(a). Note that Q has six vertices,
so a minimal spanning tree will have five edges.

Solution Here we apply Algorithm 8.2. First we order the edges by decreasing weights, and then we
successively delete edges without disconnecting Q until five edges remain. This yields the following data:

Thus the minimal spanning tree of Q which is obtained contains the edges
BE, CE, AE, DF , BD
The spanning tree has weight 24 and it is shown in Fig.

Here we apply Algorithm 8.3.


First we order the edges by increasing weights, and then we successively add edges without forming any
cycles until five edges are included. This yields the following data:

Thus the minimal spanning tree of Q which is obtained contains the edges
BD, AE, DF , CE, AF
The spanning tree appears in Fig.

Observe that this spanning tree is not the same as the one obtained using Algorithm 8.2 as expected it also
has weight 24.

ARMEN HAYRAPETIAN 54
UFAR
Exercise Find the weight of a minimum spanning tree in Fig.

Exercise The roads represented by this graph are all unpaved. The lengths of the roads between pairs of
towns are represented by edge weights. Which roads should be paved so that there is a path of paved roads
between each pair of towns so that a minimum road length is paved?

ARMEN HAYRAPETIAN 55
UFAR
Rooted tree
A rooted tree is a tree in which one vertex has been designated as the root and every edge is directed
away from the root.

Suppose that T is a rooted tree:


 If v is a vertex in T other than the root, the parent of v is the unique vertex u such that there is a
directed edge from u to v.
 When u is the parent of v, v is called a child of u.
 Vertices with the same parent are called siblings.
 The ancestors of a vertex other than the root are the vertices in the path from the root to this vertex,
excluding the vertex itself and including the root.
 The descendants of a vertex v are those vertices that have v as an ancestor.
 A vertex of a rooted tree is called a leaf if it has no children.
 Vertices that have children are called internal vertices. The root is an internal vertex unless it is the
only vertex in the graph, in which case it is a leaf.
 If a is a vertex in a tree, the subtree with a as its root is the subgraph of the tree consisting of a and
its descendants and all edges incident to these descendants.

Exercise In the rooted tree T (with root a) shown in Figure 5, find the parent of c, the children of g, the
siblings of h, all ancestors of e, all descendants of b, all internal vertices, and all leaves. What is the
subtree rooted at g?

Solution
The parent of c is b. The children of g are h, i, and j . The siblings of h are i and j . The ancestors of e are
c, b, and a. The descendants of b are c, d, and e. The internal vertices are a, b, c, g, h, and j . The leaves
are d, e, f , i, k, l, and m. The subtree rooted at g is shown in Figure 6.

ARMEN HAYRAPETIAN 56
UFAR
m-ary tree
A rooted tree is called an m-ary tree if every internal vertex has no more than m children. The tree is
called a full m-ary tree if every internal vertex has exactly m children. An m-ary tree with m = 2 is called
a binary tree.

Exercise Are the rooted trees in Figure, full m-ary trees for some positive integer m?

Exercise Draw a decision Tree for sorting three distinct numbers.

ARMEN HAYRAPETIAN 57
UFAR
Exercise Consider any
binary tree T. Each node
of T can have at most two
children. Accordingly,
one can show that level r
of T can have at most 2r
nodes. Fig. shows a
complete tree T26 with 26
nodes.

What are the left and


right children of the node K? Which node is the parent of K? What is the depth dn of the complete tree Tn
with n nodes?
Solution

Exercise Consider the binary tree T in Fig.

Suppose ITEM = 33 is added to the tree. Find the new tree T.


Suppose ITEM = 68 is added to the tree. Find the new tree T.

Solution

Exercise Find the final tree T if the following numbers are inserted into an empty binary search tree T :
50, 33, 44, 22, 77, 35, 60, 40

ARMEN HAYRAPETIAN 58
UFAR
References:
1. Discrete math_Kenneth H. Rosen
2. Practical Discrete Mathematics Ryan T. White Archana Tikayat Ray
3. Discrete Mathematics Marc Lipson
4. Discrete and Combinatorial Mathematics Ralph P.Grimaldi
5. Graphs and Their Applications
6. Graph Theory Balakrishnan

ARMEN HAYRAPETIAN 59

You might also like