0% found this document useful (0 votes)
74 views3 pages

2014 09 Combinatorics I Letture Note

This document provides solutions to a midterm examination for graphs theory. It answers 4 questions involving properties of graphs like the number of components, conditions for an Eulerian tour, existence of centroid vertices, and calculating the number of spanning trees. Key points addressed include: - The graph Gn,k has either 1, 2, or 2n-1 components depending on the values of n and k. - Gn,k has an Eulerian tour if and only if n > k and k is odd and (n/k) is even. - Every tree has either 1 centroid vertex or 2 adjacent centroid vertices. - The number of spanning trees in the graph Gn is τ(Gn) =

Uploaded by

王大洋
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)
74 views3 pages

2014 09 Combinatorics I Letture Note

This document provides solutions to a midterm examination for graphs theory. It answers 4 questions involving properties of graphs like the number of components, conditions for an Eulerian tour, existence of centroid vertices, and calculating the number of spanning trees. Key points addressed include: - The graph Gn,k has either 1, 2, or 2n-1 components depending on the values of n and k. - Gn,k has an Eulerian tour if and only if n > k and k is odd and (n/k) is even. - Every tree has either 1 centroid vertex or 2 adjacent centroid vertices. - The number of spanning trees in the graph Gn is τ(Gn) =

Uploaded by

王大洋
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/ 3

Solution to Midterm Examination for Graphs Theory I

2007-11-8

1. (40%) For integers n and k satisfying n k 1, let Gn,k = (Vn,k , En,k ) be the graph with
Vn,k = {a1 . . . an : each ai = 0 or 1} and En,k = {{a1 . . . an , b1 . . . bn } :

Pn

i=1

|ai bi | = k}.

Answer the following questions with proofs.


(a) How many components does Gn,k have?
(b) For which n and k does Gn,k have an Eulerian tour?
(c) Construct a graph not isomorphic to Gn,k , but has the same degree sequence as Gn,k .
Solution. (a) The graph Gn,k has exactly 2n1 , 2, 1 components when n = k, n > k with
k even, n > k with k odd, respectively. The reasons are as follows.
We first notice that Gn,k has 2n vertices, each of degree

 
n
k

For the case of n = k, every vertex is adjacent to exactly one vertex which is its 1s
complement. So, in fact the graph is 2n1 K2 .
We now assume n > k. For any a Vn,k and any S {1, 2, . . . , n}, let a(S) be the
vertex a0 with a0i 6= ai for i S and a0j = aj for j
/ S. We first claim that for any a Vn,k
and 1 i < j n, there is a walk from a to a({i, j}). To see this, we choose a subset
A of k 1 elements from {1, 2, . . . , n} {i, j}. Then, a is adjacent to a(A {i}), which
in turn is adjacent to a({i, j}). This gives the claim. Repeatedly applying the claim we
have that for any a Vn,k and S {1, 2, . . . , n} with |S| even, there is a walk from a to
a(S). Using this, we know that those a with ni=1 ai even are in a same component C,
P
and those a with ni=1 ai odd are in a same component C 0 . Hence Gn,k has at most two
P

components.
For the case of n > k with k even, by definition, if a is adjacent to b then
Pn

i=1 bi

Pn

i=1

ai and

have the same parity. Consequently, C 6= C 0 . This gives that Gn.k has exactly 2

components.
k

z }| {

z }| {

For the case of n > k with k odd, 00 . . . 0 0 . . . 0 C is adjacent to 11 . . . 1 0 . . . 0 C 0 .


Hence, C = C 0 and so Gn.k has exactly 1 component.
(b) The graph Gn,k has an Eulerian tour if and only if n > k and k is odd and
even.
 
n
k

n
k

is

P
ni 2i with each ni {0, 1} and k = ri=0 ki 2i with each
i=0
 
Qr ni 
n
(mod
2).
In
other
words,
is odd if and only if
i=0 ki
k

Remark. Suppose n =
ki {0, 1}. Then,

Pr

 

ni = 0 implies ki = 0 for 0 i r.
1

(c) This is impossible for n = k or (n, k) = (2, 1), since Gn,n = 2n1 K2 and G2,1 = C4 .
We now assume that n > k and (n, k) 6= (2, 1). In this case, n 3 and 1 k n 1
implying

 
n
k

> 1 and 2n1 1 +

 
n
k

(check it).

We first claim that if m > r > 1 with mr even, then there is a connected rregular graph of m vertices. Let s = br/2c. Consider the graph Cm,r with vertex
set {v0 , v1 , . . . , vm1 } and edge set {vi vi+j : j = 1, 2, . . . , s} for even r (respectively,
{vi vi+j : j = 1, 2, . . . , s} {vi vi+m/2 : i = 0, 1, . . . , m/2 1} for odd r), where the indices
for the vertices are taken modulo m. It is easy to check that the graph so constructed is
connected and r-regular.
For the case of k is even, Gn,k has exactly two components. Then, C2n ,(n) is a conk
nected graph with the same degree sequence as Gn,k .
For the case of k is odd, Gn,k is connected. Then, 2C2n1 ,(n) is a graph of 2 components
k

with the same degree sequence as Gn,k .


Another solution for the case when k is even. For the case when k is even, the
graph has exactly two components which are not trees as each vertex has degree

 
n
k

> 1.

Choose an edge xy in a cycle of component C and an edge x0 y 0 in a cycle of component


C 0 . Removing edges xy from C and x0 y 0 from C 0 result two connected graphs D and D0 .
Add two new edges xx0 and yy 0 to D D0 result a connected graph G with the same
degree sequence as Gn,k . Notice that G is different from Gn,k as G is connected but Gn,k
is not.

2. (20%) Suppose x1 , x2 , . . . , xn are n distinct numbers. The following method finds the
maximum of these n numbers using n 1 comparisons:
max = x1 ;
do i = 2 to n ;
if max < xi then max = xi ;
Similarly, we may find the minimum by using n 1 comparisons. Consequently, we may
find the maximum and the minimum by using totally 2n 2 comparisons.
Design an algorithm to find the maximum and the minimum by using less than
2n 2 comparisons. Is your method the best possible one?
Solution. Suppose we use fn comparisons to do the job. Clearly, f2 = 1 and f3 = 3 will
do the job. For n 4, we first use fn2 comparisons to find the max M 0 and the min m0
of the first n 2 numbers. We use 1 comparison to get the max M 00 and the min m00 of
2

the rest two numbers. Finally, compare M 0 and M 00 to get the max, and compare m0 and
m00 to get the min. So, fn = 3 + fn2 . In conclusion, fn = d3n/2e 2.
Reasons for this number of comparisons is the best possible: please refer to the book
Fundamentals of Computer Algorithms by Ellis Horowitz and Sartaj Sahni.

3. (20%) In a tree T , a branch at a vertex u is a maximal sub-tree containing u as a leaf.


The branch weight b(u) of u is the maximum number of edges in a branch at u. A centroid
vertex is a vertex u with the minimum branch weight b(u).
Prove that every tree has exactly one centroid vertex or has exactly two centroid
vertices that are adjacent.
Solution. A tree certainly has at least one centroid.
Suppose T is a tree with two nonadjacent centroids u and v. Choose a vertex z in
the internal of the path from u to v. Let Tu,v be the branch at u containing v, and Tv,u
be the branch at v containing u. For any branch B at z, either B is a proper sub-tree of
Tu,v or else B is a proper sub-tree of Tv,u . In the former we have |B| < |Tu,v | b(u), and
in the later |B| < |Tv,u | b(v). Hence, b(z) < b(u) = b(v), a contradiction.
4. (20%) Suppose Gn is the graph with vertex set Vn = {a1 , a2 , . . . , an , b1 , b2 , . . . , bn } and
edge set En = {ai ai+1 , bi bi+1 : 1 i n 1} {ai bi : 1 i n}.
Prove that (Gn ) = 4 (Gn1 ) (Gn2 ) for n 3. Determine (Gn ) in terms of n
for all n 1.
Solution. Let Hn be the graph obtained by contracting the rightmost edge of Gn . Also,
let tn = (Gn ) and un = (Hn ). Deleting and contracting the rightmost edge of Gn yields
tn = tn1 + un (pendant edges appear in all spanning trees). Deleting and contracting
the rightmost edges of Hn yields un = 0 + 2tn1 + un1 (0 from the deletions, tn1 each
time we delete one and contract the other, and un1 because contracting both yields Hn1
plus an unusable loop). Replacing un by tn tn1 and un1 by tn1 tn2 in the above
equality to get tn tn1 = 0 + 2tn1 + tn1 tn2 leads tn = 4tn1 tn2 as desired.
The characteristic equation x2 4x + 1 = 0 for the recurrence tn = 4tn1 tn2 has

roots 2 3. So, tn = a(2 + 3)n + b(2 3)n . Using initial conditions t1 = 1 and t2 = 4



we get a = b = 2 3 and so tn = (2 + 3)n (2 3)n /2 3.

You might also like