Tutorial 6
Tutorial 6
Graphs
Question 1
Construct the corresponding adjacency matrix and adjacency list for each of the graphs
given below:
a)
B G C
E F A D
b)
A
B M
C Y R G
c)
B 20
10
D
A
30
18
Algorithmics Page 1 of 2
Question 2
Let G be the graph whose vertices are the integers from 1 to 7, and let the adjacent
vertices of each vertex be as follows:
1: 2, 3, 4
2: 1, 4, 5
3: 1, 4, 6
4: 1, 2, 3, 5, 6, 7
5: 2, 4, 7
6: 3, 4, 7
7: 4, 5, 6
Question 3
Let H be the graph whose vertices are the integers from 1 to 9, and let the adjacent
vertices of each vertex be as follows:
1: 2, 3
2: 1, 3
3: 1, 2, 6, 9
4: 5, 6
5: 4, 6
6: 3, 4, 5, 9
7: 8, 9
8: 7, 9
9: 3, 6, 7, 8
Algorithmics Page 2 of 2