Prim's algorithm is a greedy algorithm that finds a minimum spanning tree for a weighted undirected graph. It was proposed by Czech mathematician Vojtěch Jarník in 1930 and later independently discovered by American mathematician Robert C. Prim in 1957, for which it is more commonly known as Prim's algorithm. The algorithm works by building this tree one vertex at a time, from an arbitrary starting vertex, at each step adding the minimum weight edge that connects the spanning tree to another vertex, until all vertices are included.