Both Prim's and Kruskal's algorithms can be used to find the minimum spanning tree (MST) of a weighted, undirected graph. Prim's algorithm grows the MST from an initial node by repeatedly adding the lowest-cost edge that connects to the MST. Kruskal's algorithm sorts the edges by weight and builds the MST by adding edges in order as long as they do not form cycles.