Builds a minimum spanning tree by repeatedly adding the cheapest edge from the growing tree to a new node.
choose start node s; MST = {s}while MST does not contain all nodes:pick minimum-weight edge (u,v) with u in MST and v not in MSTadd v to MSTupdate candidate edges crossing MST → outsidereturn MST