Prim's Algorithm for MST B 26(9) Step 1:V=(A),E= 21(4) 42 Step 2:Select the nearest 36 34 25(1) 29 22 neighbor of V,u,add the 33 16(7) 18(2) 21(8) edge connecting u and 21(5) 25(6) some vertex in Vinto E 28 17(3) Step 3:Repeat step 2 until E 53 contains n-1 edges End of AlgorithmPrim’s Algorithm for MST 27 26(9) 42 21(4) 21(8) 53 25(6) 33 28 36 18(2) 17(3) 34 29 22 A I H J C E B G F D 16(7) 21(5) 25(1) Step 1: V={A}, E={} Step 2: Select the nearest neighbor of V, u, add the edge connecting u and some vertex in V into E Step 3: Repeat step 2 until E contains n-1 edges End of Algorithm