What does Prim’s algorithm do?
What does Kruskal’s algorithm do?
Sorts the list of edges by increasing weight
Puts each vertex in a disjoint set
Goes through each edge (in sorted order)
If the edge connects to a vertex that is already connected then union it.
Each node gets touched in the system with the least amount of total weights.
Must all the nodes connect individually?
Each node doesn’t need to be exclusively connected to each node, as long as the nodes are connected in the system. For example, if C is connected to F, and B is connected to C, you don’t have to go out of the way to connect B to F because they are already connected in the system.