The edges connected to A are (A,B) with weight 1, (A,C) with weight 5, (A,D) with weight 3.
The minimum weight edge is (A,B) with weight 1. Add this edge to the MST.
Now we have nodes A and B in the MST.
The edges connected to A or B are (A,C) with weight 5, (A,D)
Show more…