Prim's Algorithm for finding Minimum Spanning Tree (Coding approach using Adjacency Matrix)

preview_player
Показать описание
In this tutorial you will learn about Prim's Algorithm for finding minimum spanning tree with c++ implementation/approach.
|--------------------------------------------------

Useful Related Videos:-

|--------------------------------------------------

Created for best Learning Experience:

|--------------------------------------------------

Social Links(Support):

|--------------------------------------------------

Please Subscribe and share this video :)

#algorithms #spanningtree #prim
Рекомендации по теме
Комментарии
Автор

Very good explanation of the algorithm, now am able to code the whole program 🙂

yuvraj_bedi
Автор

14 of your minutes are worth 6 hours from my professor. Ty ty ty this video helped me so much !

daxor
Автор

Thx bro
It was really very helpful ☺️
Thank u sooo much
I hope u would upload more such videos

kartiksaini
Автор

Is this algo correct?


Remove all self-loops
Remove all parallel edges between two vertex except the one with least weight

Create a table where row and column will be exactly equal to the number of vertex.
Put the value of edges on the table. All diagonal elements will be 0. If no edge is exited between any two vertex, put ∞ .

Select a column as a starting node, and delete its row and indicate the node as finished.

Find the minimum weight from the column of the deleted nodes’ column.
Delete the row of the new node and indicate as the node as finished.
Repeat the process from 6-7 until finished.

Max-zq
Автор

Thx bro but what do we do when we have a directed graph ? It'd be very helpful if you reply

tm
Автор

And what if we start at vertex 3? 3 to 4, then 4 to 0 and then the greedy solution would be 0 to 1 since 3 is already visited. How do we account for this?

christianfranklin
Автор

How will you detect cycle in a graph??

DeviDevi-yrsv
Автор

You could have explained it better, some sort of confusion

praveennv
join shbcf.ru