Solutions To Exercises 8: Discrete Mathematics Lent 2009 MA210

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

Discrete Mathematics Lent 2009

MA210
Solutions to Exercises 8
(1) Suppose that G is a graph in which every vertex has degree at least k, where k 1, and in
which every cycle contains at least 4 vertices.
(a) Show that G contains a path of length at least 2k 1.
Solution. Take the longest path v
1
, v
2
, . . . , v

in G. By maximality, all k neighbours of


v

must be on this path, i.e., in the set {v


1
, v
2
, . . . , v
1
}. But it is not possible that two
consecutive vertices v
i
, v
i+1
are both neighbours of v
2k
, for otherwise, we would have
a cycle on three vertices v
i
, v
i+1
, v

. Hence, the set {v


1
, v
2
, . . . , v
1
} must also contain
at least k 1 non-neighbours of v

. Consequently, 1 k +(k 1), or, 2k and


the path has at least 2k 1 edges, that is, it has length 2k 1.
(b) For each k 1, give an example of a graph in which every vertex has degree at least k,
every cycle contains at least 4 vertices, but which does not contain a path of length 2k.
Solution. The complete bipartite graph K
k,k
contains no odd cycles (hence no cycle on
3 vertices), every vertex has degree k, and any path in it can have at most 2k vertices
because there are no more vertices in K
k,k
.
(2) How many non-isomorphic trees with ve vertices are there? Let V = {1, 2, 3, 4, 5}. How
many different trees with vertex set V are there?
Solution. Removing a leaf from a tree yields a tree. There are only two trees on 4 vertices
- a path P
4
and a star K
1,3
. By adding one vertex and examining the possibilities for adding
a leaf to these two trees, we obtain the following three non-isomorphic trees on 5 vertices:
t t t
t t t t t t
t t t t t t
A
A
A
A
A
A
A
A
A
A
A
A
@
@
@
@

2
So, in how many ways we can assign labels from {1, 2, 3, 4, 5} to the trees above so that
each time we get a different edge set?
For the rst rst tree, which a path P
5
, each such an assignment is simply an ordering
of {1, 2, 3, 4, 5} to the line. There are 5! = 120 orderings, but some of them represent the
same graph. Which one are these? If we take any ordering, say 1, 2, 3, 4, 5, and ip it (to
5, 4, 3, 2, 1), then these two sequences represent the same path (in this particuar example,
its edges are 12, 23, 34, 45). Hence, there are 5!/2 = 60 trees on V of this type.
For the second tree, any assignment of labels is uniquely determined by the labels on
vertices of degree 3, 2 and on the leaf attached to a vertex of degree 2. We have 5 possible
labels for the vertex of degree 3. After choosing this label, we have 4 labels for the vertex
of degree 2, and, after that selection is made, we have 3 choices for the leaf attached to the
vertex of degree 2. By the Multiplication Rule, there are 5 4 3 = 60 trees on V of this
type.
Finally, for the star K
1,4
, any assignment of labels is uniquely determined by the labels
on the vertex of degree 3. We have 5 options for this, so there are 5 trees of this type on V .
Altogether, there are 60 + 60 + 5 = 125 different trees on V .
(3) Prove that if G is a connected graph with n vertices and n 1 edges, then G is a tree.
Solution. We proceed by induction on n. For n = 1, the only graph with 1 vertex and
0 edges is K
1
, which is a tree.
Suppose that every connected graph with n 1 vertices and n 2 edges is a tree. Let G
be a connected graph with n vertices and n 1 edges. First we claim that G has a vertex v
of degree 1. Indeed, we see that
2(n 1) = 2e(G) =

vV (G)
deg(v).
If every vertex had degree at least 2, then the right-hand side of the above equation would
be at least 2n and that is not possible. Since G is connected, every vertex has degree at least
1 and, therefore, there must be a vertex v of degree 1. Let u be the only neighbor of v in G.
We claim that G v (the graph obtained from G by removing v and the edge vu) is
connected. Indeed, let x and y be two vertices in G v. Since G is connected, there is a
path from x to y in G. Can this path contain v? If it did, then v would not be the endpoint
3
of this path (x and y are the endpoints) and so the degree of v would have to be at least 2.
However, v has degree 1 so we would get a contradiction. So, a path connecting x and y in
G does not contain v, therefore, it is also a path in Gv. Hence, any two vertices in Gv
are connected by some path in Gv, i.e., Gv is connected.
Now, Gv has n1 vertices, n2 edges, and it is connected. By induction assumption,
it must be a tree. Hence, G v does not contain a cycle. By adding v and vu back, we
cannot create a cycle. (Such a cycle would have to contain v, forcing it to have degree at
least 2. However, v has degree 1.) Also, G is connected by assumption, so G must be a
tree.
(4) Let G be a graph. Prove that G is a tree if and only if for every pair of vertices u and v,
there is a unique path between u and v.
Solution. We have two implications to prove.
Let G be a graph in which for every pair of vertices u and v, there is a unique path
between u and v.
In order to show that G is a tree, we must verify that G is connected and G has no cycle.
G must be connected because we are given that for every pair of vertices u and v, there
is a path between u and v.
Suppose now that there is a cycle in G with vertices v
1
, v
2
, . . . , v
k
and edges v
1
v
2
,
v
2
v
3
, . . . , v
k1
v
k
, v
k
v
1
. Then there are two paths between v
1
and v
k
, namely, v
1
, v
k
and
v
1
, v
2
, . . . , v
k
. This is a contradiction with our assumption that between every two vertices
there is a unique path connecting them. Hence, G contains no cycles.
Suppose that G is a tree, that is, G is connected and acyclic. Since G is connected,
there is a path between every two vertices of G. We mus prove that such a path is unique.
Suppose there are two vertices, u and v, for which there are two different paths from u
to v. Let the vertices of the rst path be u = x
1
, x
2
, . . . , x
k1
, x
k
= v and let the vertices
of the second path be u = y
1
, y
2
, . . . , y
1
, y

= v.
We also assume that u and v are chosen in such a way that k + (the sum of lengths of
these two paths) is as small as possible among all the pairs of vertices which have at least
two paths in between them.
4
If x
i
= y
j
for all 1 < i < k and 1 < j < , then the two paths together form a cycle in G
and that is not possible because G is a tree.
Otherwise, we must have x
i
= y
j
= w for some 1 < i < k and 1 < j < . What now?
(a) If u = x
1
, x
2
, . . . , x
i1
, x
i
= w and u = y
1
, y
2
, . . . , y
j1
, y
j
= w are two different
paths between u and w, then the sum of lengths of these paths i + j is smaller than
k + . Thus, we have a contradiction with our initial choice of u and v.
(b) In the same way we obtain a contradiction if w = x
i
, x
i+1
, . . . , x
k1
, x
k
= v and
w = y
j
, y
j+1
, . . . , y
1
, y

= v are two different paths between w and v.


(c) However, if neither of the above occurs, then both paths u = x
1
, x
2
, . . . , x
k1
, x
k
=
v and u = y
1
, y
2
, . . . , y
1
, y

= v are the same! This is a contradiction with our


assumption that there are at least two different paths between u and v.

(5) Suppose that G is a forest with n vertices and c components. Prove that G has n c edges.
Solution. Let G
1
, . . . , G
c
be all the components of G. Each component is then connected
and with no cycle, i.e., every G
i
is a tree. If we denote by n
i
the number of vertices in
component G
i
, then we have e(G
i
) = n
i
1 and n = n
1
+ n
2
+ + n
c
.
As we have no edges between two components, we also have e(G) = e(G
1
) + e(G
2
) +
+ e(G
c
), and therefore
e(G) = e(G
1
) + e(G
2
) + + e(G
c
) = (n
1
1) + (n
2
1) + + (n
c
1) = n c.

(6) Prove by induction that every tree is a bipartite graph. (Do not use the theorem about the
characterization of bipartite graphs from lectures. This problem is easy to prove directly.)
Solution. We will use the property that every tree T contains a vertex v of degree 1, and
that T v is also a tree. (Why is this true?)
Now we proceed by induction on the number n of vertices of a tree T. For n = 1, 2,
the only trees are K
1
and K
2
and both are bipartite. Suppose that any tree on less than n
vertices is bipartite and let T be a tree on n vertices.
5
Let v be a vertex of degree 1 in T and let u be its only neighbor. We know that T v is
a tree with n 1 vertices, so, by induction assumption, T v has bipartition X, Y . (This
means that every edge in T v has one endpoint in X and the other one in Y .)
Now, if u X, then X, Y {v} is a bipartition of T. However, if u Y , then Y, X{v}
is a bipartition of T.
(7) (a) How many spanning trees does the graph P
n
have?
Solution. P
n
is a tree itself; removing any of its edges disconnects it (resulting graph
has n 2 edges, so it cannot be a tree). Hence, there is only one spanning tree of P
n
.

(b) How many spanning trees does the graph C


n
have?
Solution. Since every tree on n vertices has exactly n 1 edges, we must remove
exactly one edge from C
n
. For this we have n possibilities, and each time we get a
different tree. Hence, C
n
has n different spanning trees.
(c) How many spanning trees does the graph K
4
have?
Solution. There are two trees on 4 vertices: path P
4
and star K
1,3
(i.e., one vertex
adjacent to 3 other vertices).
There are 4! ways to order the vertices of K
4
and each such ordering forms the path P
4
.
However, orderings a, b, c, d and d, c, b, a form the same path (with edges ab, bc, cd),
hence K
4
has 4!/2 = 12 different spanning paths P
4
.
Any star K
1,3
in K
4
is uniquely determined by the center of this star (the vertex that is
adjacent to the other 3 vertices). In K
4
, we have 4 choices for this center, so K
4
has
four different spanning stars K
1,3
.
Altogether, K
4
has 12 + 4 = 16 different spanning trees.
(8) Let the graph K
n
have vertices {1, 2, . . . , n} and suppose that for each u, v {1, 2, . . . , n},
the edge uv has weight c
uv
= u + v. Determine the minimum cost spanning tree of this
graph. What is the total cost for this minimum cost spanning tree?
Solution. We prove that for every n, Kruskals algorithmwill choose edges 12, 13, . . . , 1n.
Hence, the total cost of this mimimum cost spanning tree is
3 + 4 + + n + (n + 1) =
1
2
(n + 1)(n + 2) 3.
6
We order the edges as follows:
12,
13,
14, 23,
15, 24,
16, 25, 34,
.
.
.
1i, all the remaining edges of weight i + 1,
.
.
.
1n, all the remaining edges of weight at least n.
We claim that from each row above, Kruskal Algorithm will chose only the rst edge (the
only one that contains vertex 1).
This is certainly true for the rst 2 rows. So, let suppose that Kruskals Algorithm se-
lected the edges 12, 13, . . . , 1(i 1), rejected all the others, and it is going to consider the
row:
1i, all the remaining edges of weight i + 1
Since the edge 1i together with 12, 13, . . . , 1(i 1) form a star K
1,i1
, which is a tree,
Kruskals Algorithm will accept it.
The remaining edges with weight i+1 are jk, where 2 j i1 and k = i+1j < i.
Since 1j and 1k were already picked by Kruskals Algorithm, adding jk would create a
cycle: 1j, 1k, jk. Hence, Kruskals Algorithm will reject it.
By induction, Kruskals algorithm will choose edges 12, 13, . . . , 1n. After edge 1n the
algorithm stops because we have a spanning tree.

You might also like

pFad - Phonifier reborn

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

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


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy