Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
66
Добавлен:
20.03.2016
Размер:
776.96 Кб
Скачать

39.Construct all self-complementary graphs on four and ve vertices.

39.P4, C5, and f(1,2), (2, 3), (3, 1), (1, 4), (2, 5)g

41.Let G = (V; E) be a graph. Prove that if for any two nonadjacent vertices v and w of G we have deg(v) + deg(w) j V j, then G is Hamiltonian.

41. jV j = n 3: Suppose the theorem is false for some n and let G be a counterexample with jEj as large as possible. G is a subgraph of the Hamiltonian graph Kn: Adjoining to G an edge from Kn would give a graph which still satis es the degree condition, but has more than jEj edges. By choice of G, any such graph has a Hamiltonian cycle. This implies G has a Hamiltonian path with vertex sequence v1; v2; : : : ; vn: Since G is not Hamiltonian, (v1; vn) 62E: Therefore, by hypothesis, deg(v1) + deg(vn) n: Let

S1 = fij(v1; vi) 2 Eg and S2 = fij(vi 1; vn) 2 Eg

jS1j = deg(v1) and jS2j = deg(vn): Since jS1j + jS2j n and S1 [ S2 has at most n 1 elements, by the Pigeon Hole Principle S1 \ S2 6= ;: Let j 2 S1 \ S2:

v1 vj 1vnvn 1 vj+1vj v1

is a Hamiltonian cycle. This is a contradiction.

43.Let An = [a(inj)] be the nth power of the adjacency matrix of G. Prove that

(a)a(2)i j ; i 6= j; is the number of i j paths of length 2 in G

(b)a(2)i i = deg(i)

(c)(1/6)P a(3)i i is the number of 3-cycles in G

(d)For each graph given below by its adjacency matrix representation, verify parts (a) through (c). For each pair of vertices, determine how

many paths of length 3 are joining them. List all the 3-cycles in each of the graphs (3-cycle a b c is counted as being di erent from the 3-cycle a c b:)

 

 

 

 

 

 

 

Adjacency Matrix

 

Adjacency Matrix

 

 

1

2

3

4

5

6

 

1

2

3

4

 

1

0

0

0

1

1

1

1

0

1

0

1

2

0

0

0

1

1

1

2

1

0

1

1

3

0

0

0

1

1

1

3

0

1

0

0

4

1

1

1

0

0

0

4

1

1

0

0

5

1

1

1

0

0

0

 

 

 

 

 

6

1

1

1

0

0

0

43. (a) By Exercise 16 we know that this is the number of trails of length two from i to j: Since a trail of length two in a graph without loops cannot have any repeated vertices, each trail of length two must in fact be a trail.

(2)

n

43. (b) aii

= Pj=1 a(i; j)a(j; i): A term a(i; j)a(j; i) is nonzero if and

only if (i; j) is an edge in G: Therefore, a(2)ii is just the degree of i:

43. (c) A3

= AAA = A(AA): An entry of A3

has the form

j aij ajk(2):

(2)

is the jk-th entry of A2

(2)

 

n

P

where ajk

n

n P

: But ajk

=

l=1 ajlalk so

 

aij(2) =

(

ajlalk ) =

 

aij ajlalk

 

 

X X

 

X X

 

 

 

j

l

 

j=1 l=1

 

 

Now, a term aij ajl ali 6= 0 when (i; j); (j; l); and (l; i) 2 E; i.e., when there is a 3-cycle in G. Whenever aij ajlali 6= 0 it follows ailalj aji 6= 0 as well as aliaij ajl; alj ajiail, ajiailalj ; and ajlaliaij : Thus each 3-cycle is counted six times in this sum, twice in the entry for a(3)ii ; twice in a(3)jj ; And twice

in a(3)ll :

43. (d) The rst graph has 1 3-cycle. The number of paths of length 3 from 1-2 is 3 in number; from 1-3 is 1; from 1-4 is 3; from 2-3 is 3; from 2-4 is 4; from 3-4 is 1. The second graph has no 3-cycles as it is K3;3. The are no paths between 1 and 2;2 and 3; 3 and 1; 4 and 5; 5 and 6; 6 and 4. Between each of the pairs 1-4, 2-4, 3-4, 1-5, 2-5, 3-5; 1-6; 2-6; and 3-6 there are 9 paths of length 3.

 

 

 

 

 

 

 

Adjacency Matrix

 

Adjacency Matrix

 

 

 

2

3

4

5

6

 

 

1

 

 

2

3

4

 

 

 

 

 

 

 

 

 

1

1

0

0

0

9

9

9

1

2

4

1

3

2

0

0

0

9

9

9

2

3

2

3

4

3

0

0

0

9

9

9

3

1

3

0

1

4

9

9

9

0

0

0

4

3

4

1

2

5

9

9

9

0

0

0

 

 

 

 

 

6

9

9

9

0

0

0

 

 

 

 

 

 

 

 

 

 

 

 

 

6.9 Exercises

1.Construct connected graphs of the following sorts.

(a)All graphs of ve vertices with at least seven edges

(b)All cubic graphs with at most eight vertices

(c)One 4-regular graphs of six vertices

(d)Three 5-regular graphs of eight vertices

1. (a) The table indicates the number of graphs on ve vertices with 0, 1, 2, . . . , 10 edges. You can check your construction against these values to see if you have constructed all the graphs.

#edges #graphs

01

11

22

34

46

56

66

74

82

91

10 1

You really need only construct the graphs on zero through four edges and take complements to get the graphs on six through ten edges. A separate case for ve edges also must be dealt with. In the case of ve edges, some of the graphs can be isomorphic to their complement so it will not su ce to nd three graphs with ve edges.

1. (b) All cubic graphs with fewer than ten vertices:

SIX VERTICES:

(1,2),(1,3),(1,4),(2,3),(2,5),(3,6),(4,5),(4,6),(5,6)

(1,2),(1,3),(1,4),(2,5),(2,6),(3,5),(3,6),(4,5),(4,6)

EIGHT VERTICES:

(1,2),(1,3),(1,4),(2,3),(2,4),(3,5),(4,6),(5,7),(5,8),(6,7),(6,8),(7,8)

(1,2),(1,3),(1,4),(2,3),(2,5),(3,6),(4,5),(4,7),(5,8),(6,7),(6,8),(7,8)

(1,2),(1,3),(1,4),(2,3),(2,5),(3,6),(4,7),(4,8),(5,7),(5,8),(6,7),(6,8)

(1,2),(1,3),(1,4),(2,5),(2,6),(3,5),(3,7),(4,6),(4,7),(5,8),(6,8),(7,8)

(1,2),(1,3),(1,4),(2,5),(2,6),(3,5),(3,7),(4,6),(4,8),(5,8),(6,7),(7,8)

1. (c) A 4-regular graphs on 6 vertices:

K6 f(1; 4); (2; 5); (3; 6)g

1. (d) Three 5-regular graphs on 8 vertices:

K8 f(1; 2); (2; 3); (3; 4); (4; 5); (5; 6); (6; 7); (7; 8); (8; 1)g

K8 f(1; 2; (2; 3); (3; 4); (4; 1); (5; 6); (6; 7); (7; 8); (8; 5)g

K8 f(1; 2); (2; 3); (3; 1); (4; 5); (5; 6); (6; 7); (7; 8); (8; 4)g

3. Find a graph G such that G is not connected.

3. V (G) = f1; 2; 3; 4g; E(G) = f(1; 2); (1; 3); (1; 4)g

5. Let G = (V; E) be a connected graph with at least two vertices. Prove that if j V j > j E j, then G has a vertex of degree one.

5. Suppose deg(v) 2 for all v 2 V:

X

2 jV j deg(v) = 2jEj

v2V

Therefore, jEj jV j, which is a contradiction. Therefore, at least one vertex of G must have degree 1.

7.Let G be a connected graph with average degree greater than two. Prove that G contains at least two cycles.

7. Let G = (V; E).

P

v2V deg(v) > 2 j V j

But

X

deg(v) = 2j E j

v2V

Therefore, j E j > j V j: j E j j V j + 1: G is not a tree, so there is an edge e 2 E that is contained in a cycle. Now, the graph H = (V; E feg) is connected since it only di ers from G by the removal of an edge in a cycle. H has at least j V j edges so it is not a tree. Thus, there is a second cycle in H that is also a cycle in G.

9.Carry out a depth rst search on the graph in Figure 6-22 starting at the vertex e. Display the result of the search process as was done in Figure 6-22.

9.

 

 

 

Lists of

 

e

Vertices

 

Adjacencies

 

 

 

 

 

 

 

 

 

 

 

 

a

 

b c

 

c

 

b

 

a d g

 

 

 

c

 

a d e g

 

a

 

d

 

b c f

 

 

 

 

 

 

e

 

c f

 

 

 

f

 

d e

 

b

 

g

 

b c h

 

 

 

 

 

 

h

 

g

 

 

 

 

 

 

g

 

d

 

 

 

 

h

 

 

f

 

 

 

 

 

 

11.Carry out a breadth rst search on the graph in Figure 6-24 starting at the vertex g. Display the result of the search process as was done in Figure 6-24.

11.

Lists of

Vertices Adjacencies

ab c

ba d g

ca d e g

db c f

ec f

fd e

gb c h

hg

g

b

c

h

a d e

f

13.For each of the following graphs:

(a)Carry out a depth rst search starting at vertex b.

(b)Carry out a breadth rst search starting at vertex b.

(c)Repeat parts (a) and (b) using vertex g as the starting vertex.

a

 

b

a

c

 

 

 

 

b

 

 

d

 

c

 

 

e

 

f

 

d

 

 

h

 

 

 

 

f

 

g

e

i

 

 

 

 

g

 

 

 

j

 

h

 

 

 

 

 

 

i

 

 

 

 

In each case display the result of the search process as was done in Figures 6-21 through 6-23.

13. Relative the adjacency list representation:

 

 

 

Lists of

 

 

 

Lists of

Vertices

 

Adjacencies

Vertices

 

 

Adjacencies

a

 

b

e

c

a

 

b

e

 

 

b

 

d

a

 

b

 

a

d

i

 

c

 

a

f

e

c

 

e

 

 

 

d

 

b

e

g

d

 

b

f

g

h

e

 

d

a

c

e

 

a

c

g

j

f

 

c

h

 

f

 

d

 

 

 

g

 

d

i

 

g

 

i

d

e

h j

h

 

f

 

 

h

 

d

g

j

 

i

 

g

 

 

i

 

b

g

 

 

 

 

 

 

 

j

 

g

h

e

 

13. (a) (b, d), (d, g), (g, i), (d, e), (e, a), (a, c), (c, f), (f, h) form a dfs tree.

(b, a), (a, e), (e, c), (e, g), (g, i), (g, d), (d, f), (d, h), (h, j) form a dfs tree.

13. (b) (b, d), (b, a), (d, e), (d, g), (g, i), (a, c), (c, f), (f, h) form a bfs tree.

(b, a), (b, d), (b, i), (a, e), (d, f), (d, g), (d, h), (e, c), (e, j) form a bfs tree.

13. (c) (g, i), (g, d), (d, b), (b, a), (a, e), (e, c), (c, f), (f, h) form a dfs tree.

(g, i), (i, b), (b, a), (a, e), (e, c), (e, j), (j, h), (h, d), (d, f) form a dfs tree.

(g, d), (g, i), (d, b), (d, e), (d, a), (e, c), (c, f), (f, h) form a bfs tree.

(g, i), (g, d), (g, e), (g, h), (g, j), (i, b), (d, f), (e, a), (e, c) form a bfs tree.

b

 

b

 

 

b

 

 

 

 

d

e

a

d

a

e

g

a

e

 

 

 

 

 

 

g

 

c

i

c

c

g

 

 

 

f

i

i

 

f

 

d

 

 

 

h

f

h

 

h

 

 

 

 

 

 

j

 

 

b

 

 

 

 

g

g

 

 

 

 

 

a

d

i

i

d

i

e

 

b

b

f

g

h

 

 

 

a

a

c

j

e

e

 

 

 

 

 

 

c

c

j

 

 

 

 

 

 

f

 

h

 

 

 

 

 

 

h

 

d

 

 

 

 

f

15.Write an algorithm for nding a shortest path between any two vertices in a connected graph.

15.Simply start a breadth rst search at one vertex. The shortest path can be found remembering the edges traversed in reaching the second vertex for the rst time.

17.Let G = (V; E) be a graph. Prove that if j E j < j V j 1, then G is disconnected.

17.Starting with a graph consisting of j V j isolated vertices add one edge

at a time until j E j edges have been added. Each time an edge is added the number of connected components decreases by at most one. If there are fewer than j V j 1 edges you can reduce the number of components you started with at most j V j 2 times. Therefore, you must end up with at least two components and G is disconnected.

19.The Hall of Horrors at an amusement park challenges you to enter at the Start door and nd your way to the Escape door. After passing through a door, the door closes and locks. How many doors can you leave closed as you nd your way from the Start door to the Escape door? The layout

of the Hall of Horrors is shown below.

 

 

 

 

Start

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

A

 

 

 

 

 

 

 

 

 

C

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

B

 

 

 

 

 

D

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

G

 

 

 

 

 

F

 

 

 

 

 

 

E

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

H

 

 

 

 

 

I

 

 

 

 

 

 

J

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Q

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

O

 

N

 

 

 

K

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

R

P

 

M

L

Escape

19. Can you do any better than Start- A- G- I- H- Q- R- P- O- N- I- F- B - C- D- E- J- K- N- M- P- M- L- K- L- Escape

21. Find a tracing that minimizes the number of pen lifts for the graph shown.

 

 

12

13

 

14

1

2

3

4

6

7

 

 

 

 

 

 

 

 

 

 

 

 

 

5

15

 

 

 

 

 

 

 

11

 

 

8

 

 

10

9

 

 

 

 

 

21. There must be at least two since there are six vertices of odd degree: 1, 12, 13, 5, 6, and 10.

1-12-2-1-11-2-3-11-4-3-12-4-10-11-14-13-4-5-9-15-5-14-6-7-8-15-6 now lift to 8 and form 8-9-10 now lift to 12 and form 12-13

6.13 Exercises

1.Construct all trees on six or fewer vertices. Find an algorithm for constructing all possible trees on six vertices if you know all possible trees onve vertices.

1. The trees on six vertices are listed.

(1, 2), (2, 3), (3, 4), (4, 5), (5, 6)

(1, 2), (2, 3), (2, 4), (4, 5), (5, 6)

(1, 2), (2, 3), (3, 4), (3, 5), (5, 6)

(1, 2), (2, 3), (2, 4), (2, 5), (5, 6)

(1, 2), (2, 3), (2, 4), (4, 5), (4, 6)

(1, 2), (1, 3), (1, 4), (1, 5), (1, 6)

For any tree on 5 vertices choose a vertex and add an edge adjacent to a sixth new vertex. Repeat this for each vertex in the 5 vertex tree. Remove all duplicates from the list.

3.Let G be a tree with all vertices having odd degree. Prove that G contains an odd number of edges. Show that this is not true if G is not a tree.

3. Let T = (V; E) be a tree with all vertices of odd degree. Since all degrees are odd, there must be an even number of vertices. Since T is a tree, j E j = j V j 1, which is an odd number.

K4 is a counterexample if the graph is not a tree.

5.Use a graph to represent possible paths through the maze shown. Use the graph found to nd a path from A to N .

5.

 

D

H

 

 

 

 

F

I

 

 

 

 

K

 

C

 

N

L

 

 

 

 

 

 

 

 

 

E

 

 

 

 

G

J

M

 

 

 

 

 

 

 

A

B

 

 

 

 

M

K

I L

N

J

F

D

E

G

B

C A

Find a path from A to N.

This maze originates in ancient Greece and has been reproduced by King William of Orange in 1690 at Hampton Court. The description that follows was taken from Introductory Graph Theory by B. Andrasfai, Pergamon Press Inc., New York, 1977 ISBN 0-08-022043-6

The story goes as follows. The wife of Minos, the mythological king of Crete, was the mother of a strange monster, half-bull, half-man, called the Minotaur. A Greek engineer, Daedalus, constructed a maze, the famous Labyrinth, in which the monster could safely be enclosed. As part of a tribute, owed to Minos, boys and girls of Athens had to be sent to be devoured by the Minotaur. Theseus, the Prince of Athens, resolved to take the place of one of the victims and to kill the Minotaur. The king's daughter, Ariadne, took Theseus aside and gave him a ball of wool. \Fasten one end of this wool" she said, \inside the door of the Labyrinth and, as you go along, unwind the rest." Theseus killed the monster, found his way back again and took the beautiful Ariadne back with him to Greece. The story of the Labyrinth of Minos is told only on ancient coins, but the maze of King William of Orange (built in 1690) is still standing.

Taken from Introductory Graph Theory by B. Andrasfai, Pergamon Press Inc., New York, 1977 ISBN 0-08-022043-6

7.Prove that a tree with two or more vertices has at least two vertices of degree one.

7. If every vertex has degree greater than 1, P deg(vi) 2n: This implies the tree has at least n edges which is a contradiction. Therefore, there is at least one vertex of degree 1.

If there is exactly one vertex of degree 1, say v, then there is another odd vertex w with degree at least 3. Every other vertex has degree as least 2.

X

u2VX

deg(v)

deg(u) + deg(v) + deg(w) 2n:

v2V

fv;wg

Now jV j n which is a contradiction. Therefore, by Exercise 5 of Section 6.9 since G has at least one vertex of degree 1 and we have shown it cannot have exactly one vertex of degree 1, G has at least two vertices of degree 1.

9.Prove that a cycle and the complement of any spanning tree must have at least one edge in common.

9. If there is a cycle that has no common edge with the complement of a spanning tree, the cycle is contained in the spanning tree. This is impossible as a tree cannot contain a cycle.

Соседние файлы в папке Student Solutions Manual