Learn Kruskals Algorithm! Step-By-Step Example

preview_player
Показать описание
What is up guys welcome back to ONeill Code! Today we are going to be talking about Kruskals algorithm and how it works.

So Kruskals algorithm is a greedy algorithm in graph theory that finds a minimum spanning tree for a connected weighted graph. This just means it connects all vertices together without cycles and with the minimum possible total edge weight.

It is used in things like a network cable and telephone wires that need to be laid down, GPS’s and computer networking.

Cable companies will use an algorithm like this to ensure they keep their cost down when laying the wires. It will ensure that in the neighborhoods which can be represented in the graph we are building, have no overused paths. If there are things like cycles occurring, to much wire has been placed down and they lose money.
Рекомендации по теме