Why do we always pick the vertex with minimum weight in each iteration in prims algorithm as we are updating all the vertex with it’s minimum weight?
I am really trying to understand since last 3 days someone please help me out
Why do we always pick the vertex with minimum weight in each iteration in prims algorithm as we are updating all the vertex with it’s minimum weight?
I am really trying to understand since last 3 days someone please help me out
It is simply because Prim’s algorithm is a greedy algorithm and you have to make a MST.
But why do we choose with minimum weight
I mean is it ok if we remove that loop?
bc it is mst (minimum spanning tree). A tree with minimum weight
What I am saying is everytime we are updating the vertex with minimum
What do you want to select then