Question 1
Fig. 1 shows a network. The weights on the arcs are distances.
Apply Dijkstra’s algorithm to the copy of the network in the Printed Answer Booklet to find the shortest path from A to H.
State each of the following.
• the shortest path
• its length
[6]
Answer
A problem requires a spanning tree that must include the arcs AD and GH.
The arcs AD and GH are chosen first. Apply Kruskal’s algorithm to the ordered list of arcs in the
Printed Answer Booklet to complete the tree. You should draw your tree and give its total length.
[4]
Answer
How could you modify the network in Fig. 1 so that Prim’s algorithm would find a spanning tree that
includes arcs AD and GH?
[1]
Answer