4
2
V3
V2
V1
8
2
1
2
1
6
5
11
3
V6
V5
V4
8
4
5
7
9
1
8
6
3
V9
V8
V7
If Prim's algorithm is applied and V1 is visited first, provide the iterations of the algorithm (including
visit to V1), by filling the table provided below. After algorithm completion, provide the final minimum
spanning tree as the output. If you encounter a situation where there are multiple path options, always
select the lower vertex, e.g. if there is a choice between V4 and V5, you MUST pick V4.
Vertex
V1
V2
V3
V4
V5
V6
V7
V8
V9
Visited
Distance
Parent