 I am Vinit Thribuwan from CAC department WIT Solapur and today we shall be continuing with our lectures on minimum spanning tree. In today's lecture we will see how to find out minimum spanning tree using Kruskal's algorithm. So these are the learning outcomes of today's video lecture after the end of this session you will be able to demonstrate familiarity with Kruskal's algorithm and you will also be able to apply Kruskal's algorithm to find minimum spanning tree for a given graph. These are the contents of today's video lecture. We will start with the recap of minimum spanning tree followed with Kruskal's algorithm, the analysis and the algorithm of Kruskal to find MST and followed with a working example. So what is a minimum spanning tree? As we saw earlier a minimum spanning tree for a weighted undirected graph is a spanning tree with minimum weight. So for this given graph on the left side you can see that this is an undirected graph having the edges which are weighted. So if we find a minimum spanning tree that is a tree connected to all the nodes having minimum weights we find the minimum spanning tree of the graph. MST is a subset of graph G such that it forms a cyclic subset that means no cycle should be formed when two or more nodes are connected. It connects all the vertices available in set V of the graph G that means all the vertices of the graph have to be included in the spanning tree. The summation of weights of edges should be minimum that means the summation or the edges which are included in the MST should be such that the inclusion of the edges should give a minimum weight. So since T that is the tree is a cyclic and connects all the vertices it must form a tree which is called a spanning tree as it spans the graph G or it covers all the nodes of the graph G. We call this problem as the minimum spanning tree problem. So reflect on this question the question is in the previous lecture on Prims algorithm we studied about the Prims method to find minimum spanning tree. Now according to this lecture what is the running time of that algorithm. Pause the video and answer this question. So the running time of Prims algorithm to find a minimum spanning tree is big O of E log V where E stands for the number of edges in the graph and V stands for number of vertices. So these are the steps to find out the MST of a given graph using Kruskal's algorithm. First to begin the Kruskal's algorithm we sort the edges of the graph in increasing order of its weight. Since the graph given is a weighted graph so we sort all the edges according to their increasing order of weight. We select the one edge E of having the minimum weight or the least weighted edge E and we add its nodes U and V which are connected by E to a visited nodes list. The third step is while all the nodes have not been traversed that means till the set G or the set V of vertices is not completely covered we select the next least weighted edge and we include that edge which does not create a cycle the edge and its corresponding two nodes in the particular MST to form a MST of the graph. So this is the algorithm for Kruskal's according to Kruskal to find the MST. As we can see the algorithm the complexity for step one is big O of one. The complexity for sorting according to line number four is big O of E log V and the block starting from line five to line eight takes the time of big O of V plus E constant alpha and V. So the total running time of Kruskal's algorithm is big O of E log E or also big O of E log V which is similar to Prim's algorithm. So this is an example of finding MST of a given graph using Kruskal's algorithm. As we see there is an undirected weighted graph given and step by step we shall find out the MST using Kruskal's algorithm. So as we have seen in the steps we sort all the edges according to the increasing order and we select the minimum weighted edge first. So as we can see so I have selected edge one which connects H to G and I have included H G in my set A and weight of one has been added up to my MST and my MST now stands two nodes which are H and G. Next edge to be added is of weight two which connects I and C in the MST. So now my MST has two edges H and G, I and C and its weight is one plus two. In the third step I include one more edge that is next edge in the sorted order that is edge connecting from G to F so G and F is also included here in the visited node or in the set A and its weight is added in the MST. Next we add edge A to B having weight four so its four is also added in the MST and simultaneously we also add the two nodes A and B in set A. Now continuing in this fashion we select the next edge after the previous visited edge is C to F having a weight four. So we add that particular edge as well as those particular two nodes in set A. If those two nodes were already added we need not to add those two nodes but the weight is added in the particular MST. Next we add the weight of seven and add C to D edge in the MST. In the end we add edge D to E in the MST having weight nine. So when we are adding one edge after the other in the MST we have to take care that if the inclusion of a particular edge creates a cycle we drop that edge and we consider the next edge in the increasing which is in the increasing order available in the list. So after all the edges have or we can say that all the nodes have been traversed that is spanned. We come to the conclusion that our minimum spanning tree has the weight of 37 which has all the nodes. So as you can see that we have spanned all the nodes here and the minimum weight of the spanning tree is 37. So this was the reference for today's video lecture. The complete example has been solved and is available for your reference in this book. Thank you.