T7 - Graphs Trees
T7 - 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)
8. Determine whether the given graph has a Hamilton circuit. If it does, find such a
circuit.
(a) (b)
10. Which of the following graphs are trees? If it is not tree, explain why.
A B C
D E F
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.
b c d
e f g h i
j k l m
Answers:
Additional Questions:
b c
d e f g
h i j k l
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.
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.
1.
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