Prims Algo for minimum spanning tree - Greedy Method
Hey Guys, Follow my another youtube channel: Creator Ashish Chhabra https://www.youtube.com/channel/UCDaoJyC-E3eWx96OseLZeIA Watch more videos: Earn money through Linkedin : https://www.youtube.com/watch?v=HQGAJk2ervk Bench Period in Service Based Companies : https://www.youtube.com/watch?v=z9-knPXe3Lw How to answer tell me about yourself interview question : https://youtu.be/awV_XXWsviw Placement preparation for CSE | IT Companies | 4-8 LPA🤑 : https://youtu.be/YNxWaou66Yw Can we consider YOUTUBE as a Startup??🤔 : https://youtu.be/onP4a5Bt4cM Buying & Selling Charges on Groww App | Hidden Charges?🤔 : https://youtu.be/hKM6kw6ynns We have discussed Kruskal’s algorithm for Minimum Spanning Tree. Like Kruskal’s algorithm, Prim’s algorithm is also a Greedy algorithm. It starts with an empty spanning tree. The idea is to maintain two sets of vertices. The first set contains the vertices already included in the MST, the other set contains the vertices not yet included. At every step, it considers all the edges that connect the two sets, and picks the minimum weight edge from these edges. After picking the edge, it moves the other endpoint of the edge to the set containing MST. A group of edges that connects two set of vertices in a graph is called cut in graph theory. So, at every step of Prim’s algorithm, we find a cut (of two sets, one contains the vertices already included in MST and other contains rest of the verices), pick the minimum weight edge from the cut and include this vertex to MST Set (the set that contains already included vertices). #prim's #primsalgo
Download
1 formatsVideo Formats
Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.