Kruskal’s Algorithms generates optimal spanning tree

Let T: Sp.tree obtained by Kruskal’s algorithm T’: Optimal(min) spanning tree E(T) = E(T’) = n-1 Case1: C(T) = C(T’) Nothing to prove So assume E(T)  E(T’) Let e be a min cost edge such that e is in E(T) but not in E(T’) Add e to T’ A cycle is formed

Let e, e1, e2…. ek be this cycle. At least one of these ei is not in T ? Let ej be an edje of this cycle such that ej E(T) If C(ej) < C(e) then Kruskal’s algorithm must have included it as ….. So C(ej) >= C(e) consider the sp tree E(T’’)= E( T’) +{e)-{ej} C(T”)<= C(T’) that is C(T’)=C(T’’) Hence T’’ is also min spanning tree.

Sign up to vote on this title
UsefulNot useful