Graph Theory Solutions to Midterm 2

advertisement
Graph Theory
Solutions to Midterm 2
You must show all your work. The number of points earned on each problem
will depend upon how well you have justified your solution.
Choose nine of the following problems and complete them. Write the number of the
chosen problems in the table above and return the cover sheet with your test.
1. Prove that r (3, n) ≤
n(n + 1)
for all n ∈ Ζ + .
2
We use induction on n.
Assume the statement holds for all integer values less than n.
Using the table on page 84, we see that the statement holds for n = 1,..,9.
Using Theorem 4.3.2, we have
(n − 1)(n − 2) 2n + n 2 − 3n + 2
n + r (3, n − 1) ≤ n +
=
=
2
2
n 2 − n + 2 (n − 2)(n + 1)
=
2
2
(n − 1)n
r (3, n) ≤ r (2, n) + r (3, n − 1) = n + r (3, n − 1) ≤ n +
=
2
n(n + 1)
2
by the inductive hypothesis.
2. Find the number of spanning trees in the graph below.
Assume f is on a spanning tree and e is not. We need three edges from each of the two
components in G –{e,f}. We cannot find 4 since we would force a cycle.
There are 8 such possible choices of three edges in each component giving us 8(8) =
64 trees.
There are 64 spanning trees with the edge e and no f.
Let us assume that e and f are both edges in a spanning tree. Then one component has
3 edges and one component has 2 edges. There are 8 ways to choose three edges in
one of the components. But with any of these choices there are only 8 choices for the
edges in the second component. Therefore there are 2(8)(8)= 128 spanning trees.
There is a total of 256 spanning trees.
 6
3. a. Find the   2-element subsets of the set {1,2,3,4,5,6} and set up a
 2
correspondence between these elements and the elements in the set A =
{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}.
b. Label the vertices in the graph below with the elements from A in such a way that
no two vertices are adjacent if the 2-element subsets to which they correspond have a
common element.
4. Find the largest graph with n vertices and k components.
Claim. The graph in which every component but one contains exactly one vertex is
the graph with the greatest number of edges.
The most number of edges in any one component occurs when the graph is the
complete graph on the given vertices.
We will take any two components which have more than one vertex and show how to
create a graph with more edges.
Say |V(C1)| = n1 and say |V(C2)| = n2, the number of vertices in the component named
n  n 
C1 and C2. The greatest number of edges possible is  1  +  2  . Say n1 ≥ n2. Take
2  2
 n + 1   n − 1
one vertex from C2 and place it into C1. We now have  1  +  2  edges.
 2   2 
 n1   n2  n12 − n1 + n2 2 − n2
 +  =
2
2  2
 n1 + 1  n2 − 1 n12 + n1 + n2 2 − 3n2 + 2

+
=
2
 2   2 
2n1 − 2n2 + 2
= n1 − n2 + 1 . Since n1 ≥ n2 we
2
have increased the number of edges. Continuing until all components except for one
have only 1 vertex with obtain a graph with k components with the greatest number
of edges.
The second sum exceeds the first sum by
5. Find graceful labelings of the six nonisomorphic trees with 6 vertices.
6.a. Find the tree associated by the Prüfer method with the sequence 1,2,3,4,5,6.
b. Find the sequence associated by the Prüfer method of the tree below.
a.
b. 4,1,1,2,4,2
7. Prove that the number of spanning trees in the graph K4,n is n34n-1.
Let {a,b,c,d} be the set containing the names of the four vertices in the 4-partite set.
a,b,c, and d are all at a distance of two from each other.
Two vertices are at a distance of six from each other.
Exactly two vertices are at a distance of four from exactly one other vertex.
Three vertices are at a distance of four from each other.
There are n4n −1 such trees.
 n  n −3
4 ⋅ 3 ⋅ 3 ⋅ 2 ⋅ 2  n  n −3
n−2
There are
  4 = 72   4 = 3n(n − 1)(n − 2)4 such trees.
2
 3
 3
There are 4 ⋅ 3!n(n − 1)4n − 2 = ( 3n 2 − 3n ) 4n −1 .
n
There are 4 ⋅ 3!  4n −3 = n(n − 1)(n − 2)4n − 2 .
 3
The total of these trees is
n 4n −1 + ( 3n 2 − 3n ) 4n −1 + 3(n3 − 3n 2 + 2n)4n − 2 + (n3 − 3n 2 + 2n)4n − 2 =
(3n 2 − 2n)4n −1 + ( 4n3 − 12n 2 + 8n ) 4n − 2 =
(3n 2 − 2n)4n −1 + ( n3 − 3n 2 + 2n ) 4n −1 = n3 4n −1
8. The graphs of the three nonisomorphic spanning trees are shown below. Determine
how many of each of these spanning trees are subgraphs of K5.
Explain how your result relates to Theorem 5.2.1.
Graph 1. There are 5 ways to choose an vertex for an endpoint of the path. There are
the 4 ways to choose an adjacent vertex, 3 ways to choose the next vertex along the
path, 2 ways to choose the next to the last vertex, and only one way to choose the last
point. As we are counting every path twice, there are 60 such spanning trees.
Graph 2. We have 5 ways in which we can choose a vertex that is the vertex of degree
 4
3 in the spanning tree. After having chosen this vertex, call it v, there are   ways to
 2
choose the vertices of degree one at a distance of one from the vertex v. We then have
2 ways to choose the third vertex adjacent to v. There are then 5(6)(2) = 60 such
spanning trees.
Graph 3. There are 5 ways to choose a vertex of degree five. As the other vertices are
determined, there are 5 such spanning trees.
There are 125 spanning trees, which is confirmed by Theorem 5.2.1.
9. Find conservative labelings of the graphs below.
10. a. Use Kruskal’s algorithm to find a minimal spanning tree for the graph below.
b. Use Prim’s algorithm (as shown in class) to find a minimal spanning tree different
from the one in part a.
a.
b.
The total weight is 23 in both trees.
11. Consider ten items with frequencies 1,1,3,3,4,5,5,6,7,7. Use Huffman’s algorithm
to construct an optimal binary code for these ten items. What is the total weight of the
binary tree?
The weight of the binary tree is 133.
12. Write a program that describes the derangements of 5 objects. Include the output
showing all these derangements.
for i from 2 to 5 do
for j from 1 to 5 do
if (j<>i and j<>2) then
for k from 1 to 5 do
if (k<>i and k<>j and k<>3) then
for m from 1 to 5 do
if (m<>k and m<>j and m<>i and m<>4) then
for n from 1 to 5 do
if(n<>m and n<>k and n<>j and n<>i and n<>5) then
print(i,j,k,m,n) fi
od
fi
od
fi
od
fi
od
od;
Download