0% found this document useful (0 votes)
16 views

T7 - Graphs Trees

Uploaded by

kahwinson
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

T7 - Graphs Trees

Uploaded by

kahwinson
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Discrete Mathematics AAQS007-4-1 Graphs & Trees

1. Find the number of vertices, the number of edges and the degree of each vertex in the
given undirected graph.
(a) (b)

2. Determine the number of vertices and edges and find the in-degree and out-degree of
each vertex for the given directed multigraph.
(a) (b)

3. Use the adjacency list and adjacency matrix to represent the graphs of question 1(b)
and 2(b).

4. Draw a simple undirected graph for each of the degree sequence below.
(a) (1, 1, 2, 2, 4)
(b) (0, 0, 1, 1)
(c) (1, 1, 1, 2, 3, 4)

5. How many edges are there in a graph with nine vertices each of degree four?

6. Does there exist a simple graph with five vertices of the degrees given below? If it
does, draw such a graph.
(a) 1, 2, 3, 4, 5
(b) 3, 3, 3, 3, 2
(c) 0, 1, 2, 2, 3
(d) 3, 4, 3, 4, 3

7. Determine whether the given graph has a Euler path or Euler circuit. Construct such a
path or circuit when one exists.
(a) (b)

Diploma Asia Pacific University of Technology & Innovation Page 1 of 6


Discrete Mathematics AAQS007-4-1 Graphs & Trees

8. Determine whether the given graph has a Hamilton circuit. If it does, find such a
circuit.
(a) (b)

9. Find the chromatic number of the given graph.


(a) (b)

10. Which of the following graphs are trees? If it is not tree, explain why.

A B C

D E F

Diploma Asia Pacific University of Technology & Innovation Page 2 of 6


Discrete Mathematics AAQS007-4-1 Graphs & Trees

11. The figure below is a binary tree T. List down the order of the vertices of the tree if it
follows
(a) Preorder traversal
(b) Inorder traversal
(c) Postorder traversal
A

D E

H I F C G
K
J
L M
12. Construct the binary tree whose preorder traversal is a, b, c, e, f, d, k, g, h, i, j; where
a, b, c, d and h has two children, and all other vertices are leaves.

13. The figure below is a tree T.


a

b c d

e f g h i

j k l m

(a) Find the height of the tree T.


(b) Find the number of leaves of the tree T.
(c) List all the internal vertices of the tree T.
(d) List all the siblings of b.
(e) List all the descendants of c.

Answers:

1. (a) 6 vertices, 6 edges, degrees: 2, 4, 1, 0, 2, 3


(b) 5 vertices, 13 edges, degrees: 6, 6, 6, 5, 3
2. (a) 4 vertices, 7 edges, in-degrees: 3, 1, 2, 1; out-degrees: 1, 2, 1, 3
(b) 4 vertices, 8 edges, in-degrees: 2, 3, 2, 1; out-degrees: 2, 4, 1, 1
3. (Will be discussed)
4. Simple graphs (will be discussed)
5. 18
6. (a) & (d) exist

Diploma Asia Pacific University of Technology & Innovation Page 3 of 6


Discrete Mathematics AAQS007-4-1 Graphs & Trees

7. (a) No Euler Path & no Euler Circuit


(b) No Euler Circuit, Euler Path exists e.g. acecdeabebd
8. (a) Yes, e.g. abcdea (b) No
9. (a) 3 (b) 2
10. C is not a tree
11. (a) ABDHIJKECFLMG (b) HDJIKBEALFMCG (c) HJKIDEBLMFGCA
12. A tree diagram (will be discussed)
13. (a) 3 (b) 7 (c) a, b, c, d, e, h (d) c, d (e) g, h, l, m
14. (a) & (b) will be discussed.

Additional Questions:

1. Draw a simple graph which the degree sequence is (3, 2, 2, 2, 1).

2. Given a directed graph as follows:

(a) Find the out degrees of the vertices a and b.


(b) Find a circuit with the length of 3.
(c) Represent the directed graph by using adjacency matrix.

3. Given a rooted tree as follows.


a

b c

d e f g

h i j k l

(a) What are the vertices at level 2?


(b) What is the parent of f and g?
(c) How many leaves are there of the rooted tree above?
(d) List all the ancestors of j.
(e) What is the sibling of e?
(f) List the order of the vertices of the tree if it follows
(i) preorder traversal
(ii) postorder traversal

Diploma Asia Pacific University of Technology & Innovation Page 4 of 6


Discrete Mathematics AAQS007-4-1 Graphs & Trees

4. Given an undirected graph as follows:

(a) How many vertices and edges of the graph above?


(b) State a Hamilton circuit.

5. (a) Draw an undirected graph based on the set of vertices, V and set of edges, E given
below.
V = {a, b, c, d}
E = {{a, b}, {a, c}, {b, d}, {b, c}, {c, d}}
(b) Find the degree of all vertices.
(c) Give reason why Euler circuit does not exist.

6. Given a directed graph as follows:


a b

d c
(a) Represent the directed graph above using adjacency list.
(b) Find the in-degree of all the vertices.
(c) Find a simple circuit with length of 4.

Answers of Additional Questions:

1.

2. (a) deg+(a) = 0, deg+(b) = 3 (b) c, d, b, c or b, c, d, b or d, b, c, d.


0 0 0 0 0 
1 0 1 0 1
 
(c) 0 0 0 1 0
 
0 1 0 0 0 
1 0 0 0 0
3. (a) d, e, f, g (b) c (c) 5 (d) a, b, e (e) d
(f) (i) a, b, d, h, e, i, j, c, f, k, g, l. (ii) h, d, i, j, e, b, k, f, l, g, c, a.

Diploma Asia Pacific University of Technology & Innovation Page 5 of 6


Discrete Mathematics AAQS007-4-1 Graphs & Trees

4. (a) 5, 7 (b) Suggested answers: a, b, c, d, e, a. or b, c, d, e, a, b. etc.


5. (a) a b

d c
(b) deg(a) = 2, deg b = 3, deg(c) = 3, deg (d) = 2.
(c) Euler circuit does not exist because not all the degrees of the vertices are even.
6. (a)
Vertex Adjacency Vertices
a b
b b, c, d
c b, d
d a, b
(b) deg-(a) = 1, deg-(b) = 4, deg-(c) = 1, deg-(d) = 2.
(c) Sugges

Diploma Asia Pacific University of Technology & Innovation Page 6 of 6

You might also like