0% found this document useful (0 votes)
18 views5 pages

Co 220 Sols 5

Uploaded by

Kalpana M IITM
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)
18 views5 pages

Co 220 Sols 5

Uploaded by

Kalpana M IITM
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/ 5

CO 220 Homework #5 SOLUTIONS

1(a) What is the maximum number of edges that a (simple) graph


with p vertices can have?
The edges are 2-element sets of vertices. There are p2 2-element

subsets of the set of p vertices. This is the maximum number of edges
in a simple graph with p vertices.
1(b) Show that if a (simple) graph G has 17 vertices and 121 edges,
then G is connected.
If G is not connected then let H be a connected component of G, and
let J = G r H be the rest of G. If H has h vertices then J has 17 − h
vertices. Since H is not empty and not all of G, we have 1 ≤ h ≤ 16.
The maximum number of edges that G could have is now
   
h 17 − h
q(h) = +
2 2
h(h − 1) (17 − h)(16 − h)
= +
2 2
h − h + 272 − 33h + h2
2
=
2
= h2 − 17h + 136.
This function is maximized for 1 ≤ h ≤ 16 either at an endpoint of the
interval (h = 1 or h = 16) or at a critical point (where the derivative
is zero). Set the derivative of h2 − 17h + 136 to zero: 2h − 17 = 0, so
that h = 17/2. Now,
h h2 − 17h + 136
1 120
17/2 63.75
16 120
Thus, if G is not connected then it has at most 120 edges. Since G has
121 edges it must be connected.

2. Show that if G = (V, E) is a graph in which every vertex has


degree at least 2, then G contains a cycle C as a subgraph.
Suppose that G does not contain a cycle. Consider any connected
component H of G. Since every vertex of G has degree at least 2, H
has at least three vertices. Since H is connected and contains no cycles,
H is a tree. Since H is a tree with at least two vertices, H has at least
two vertices of degree one. But this contradicts the hypothesis that
1
every vertex of G has degree at least two. This contradiction shows
that G must contain a cycle. (In fact, every connected component of
G must contain a cycle.)

3. Let G be a connected graph with 2k ≥ 2 vertices of odd degree.


Show that there are k trails W1 , W2 ,..., Wk such that each edge of G is
in exactly one of these trails.
Let the vertices of odd degree in G be x1 , y1 , x2 , y2 , . . . xk , yk . Form
a new (multi)graph H by adding in new edges e1 , e2 , . . . , ek with ei
joining xi and yi for each 1 ≤ i ≤ k. Every vertex of H has even
degree, and H is connected (since G is a connected spanning subgraph
of H). By the theorem on Euler circuits, H has an Euler circuit Q.
Now delete the k edges e1 , e2 , . . . , ek from Q. What is left over is a set
of k trails W1 , W2 ,. . . , Wk that together cover all of the edges of G,
once each. That does it!

4. The 4–by–4 Knight’s Graph is shown in the figures below.


Parts (a) to (c) ask for Breadth–First Search trees in this graph with
specific root vertices. When growing these trees, at each stage of the
algorithm choose the next vertex to be the vertex labelled by the smallest
number, among all the available vertices.
(a) Grow a BFS tree rooted at vertex 1.

(b) Grow a BFS tree rooted at vertex 2.


(c) Grow a BFS tree rooted at vertex 6.

(d) What is the maximum distance between any two vertices in this
graph? Explain.
In the BFS tree rooted at 1 the last vertex on the queue is 13. The
distance from 13 to 1 is 5.
In the BFS tree rooted at 2 the last vertex on the queue is 12. The
distance from 12 to 2 is 4.
In the BFS tree rooted at 6 the last vertex on the queue is 16. The
distance from 16 to 6 is 4.
Every vertex of the graph is equivalent to one of the vertices 1, 2,
or 6 by a symmetry of the graph. Therefore, the maximum distance
between any two vertices of this graph is 5.

5. For a graph G and integer k ≥ 0, let nk be the number of vertices


of G that have degree k.
(a) Show that if G is a tree with p ≥ 2 vertices then n0 = 0 and
n1 = 2 + n3 + 2n4 + 3n5 + · · · .
Since G is connected and p ≥ 2, G can have no vertices of degree
zero: n0 = 0. The total number of vertices is
p = n1 + n2 + n3 + n4 + n5 + · · ·
By the Handshake Lemma, twice the number of edges is
2q = n1 + 2n2 + 3n3 + 4n4 + 5n5 + · · ·
Since G is a tree, q = p − 1. That is, 2q = −2 + 2p, so that
n1 + 2n2 + 3n3 + 4n4 + 5n5 + · · · = −2 + 2n1 + 2n2 + 2n3 + 2n4 + 2n5 + · · ·
Rearrange this to get
n1 = 2 + n3 + 2n4 + 3n5 + · · ·
as desired.
(b) Consider a graph G with nk given by the following table:
k 0 1 2 3 4 5
nk 0 20 8 4 1 2
and nk = 0 for all k ≥ 6. Assume that G does not contain any cycles.
How many connected components does G have?
The graph G has
p = 20 + 8 + 4 + 1 + 2 = 35
vertices. By the Handshake Lemma,
2q = 20 + 2 · 8 + 3 · 4 + 4 · 1 + 5 · 2
= 20 + 16 + 12 + 4 + 10 = 62
so that G has q = 31 edges.
If G contains no cycles then every connected component of G is a
tree. Let the components of G be G1 , G2 , . . . Gc . If Gi has pi vertices
and qi edges then qi = pi − 1, since Gi is a tree. That is, pi − qi = 1.
Now, p = p1 + p2 + · · · + pc and q = q1 + q2 + · · · + qc . Therefore,
p − q = (p1 − q1 ) + (p2 − q2 ) + · · · + (pc − qc ) = c.
Since p = 35 and q = 31 we see that G has c = p − q = 35 − 31 = 4
connected components.

6. Is the graph shown below planar or nonplanar? Explain your


answer.

MY BAD! I didn’t have enough time to get to this material. This


question will not be graded this week, but it will reappear as question
one on the sixth homework assignment.

You might also like