a).
Refer to the network in textbook question 5.2 and assign " v = A " to the lowest node from priority queue "H". There are (A,B), (A,F), and (A,E) edges for " A " vertex. The prices for
, and are all the same. And find out the vertices with the lowest cost. The cost of is the cheapest. Assign the cost value to " ," .the previous value to " ," and the key value to "decrement." After then, the structure is as follows:

Assign " v = B " to the lowest node on prioritized queues " H ."
There really are (B,F) , (B,C), and (B,G) edges for the " B " vertex. The prices for (B,F) = 6, (B,C) = 2, and (B,G) = 6 are all the same. Look for the vertices (B,F) , (B,C), and (B,D) with the lowest cost (B, G) The cost of (B,C) = 2 is the cheapest. As a result, double the current cost by the prior value.
Assign the previous value as “ prev (z) = 3 ” and decrement the key value. and the minimum node from “ H ” as “ v = C ”.For “C” vertex, there are (C,D) and (C, G) edges. The cost for (C, D) = 3 and (C, G) = 2. Check for the minimum cost among the vertices The cost of is minimum. So, add the current cost with previous value.
Assign the previous value as “ ” and decrement the key value. Assign the minimum node from For “” vertex, there are edges, The cost for Check for the minimum cost among the vertices Take the cost of is minimum in priority manner.So, add the current cost with previous value.
After that assign the previous value as “ ” and decrement the key value. Now, take the cost of is minimum in priority manner. So, add the current cost with previous value.
Assign the previous value as “ prev (z) =7” and decrement the key value. Now, take the cost of (G,H) = 1 is minimum in priority manner. So, add the current cost with previous value.
Assign the previous value as “ prev(z)=8 ” and decrement the key value. Assign the minimum node from "H" as "v = D" For "D" vertex, there are (D,C) and (D,H) edges. So, ignore this vertex and there is no change in the structure. Again, assign the minimum node from "H" is "v = F" For “ F ” vertex, there are (F,E) is in the tree. So, ignore this vertex and there is no change in the structure. The minimum node from "H" is "v=E" . For “ E” vertex, there are (E,A) is not in the tree. Check whether the minimum cost from the vertices (E,A).
The cost for .
Take the cost of is minimum in priority. So, add the current cost with previous value.
Assign the previous value as “ prev(z) = 12 ” and decrement the key value. Assign the minimum node from "H" is "v=H" for “H” vertex, there are (H,D) is in the tree. So, ignore this vertex and there is no change in the structure. Then, the structure is shown below:

Thus, the minimum spanning tree using the Prim’s algorithm is shown below:
![]()

Table for cost Array:
Vertex in Graph | Edge in Graph | Cost |
A | | 0 |
B | (A,B) | 0+1=0 |
C | (B,C) | 1+2=3 |
D | (C,G) | 3+2=5 |
E | (G,D) | 5+1=6 |
F | (G,F) | 6+1=7 |
G | (G,H) | 7+1=8 |
H | (E,A) | 8+4=12 |
Therefore, the cost of the minimum spanning tree is “ 12 ”.