Thursday, September 8, 2016

Second best mst (using Kruskal)

Sometimes we are asked to find Second best mst in some problems. We can do this with brute force.
At first we will find the mst and all the edges of mst. From all the edges of mst we will remove every edge once and and will create a new mst. In this way the minimum of all newly created mst is the Second best mst

mst:


yellow edges are edges of mst

sum of all weights is 110.














Second best mst:




yellow edges are edges of second best mst

sum of all weights is 121.












Implementation:


4 comments:

Football Player Transfer Prediction

Football Player Transfer Prediction Using Different Classifiers Project Report :  Football Player Transfer Prediction Report ...