Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Applications of Kruskal and Prim's algorithms

Could anyone please give some applications of the two algorithms, where and which applications they can be used for?

like image 818
vini Avatar asked Sep 06 '11 13:09

vini


1 Answers

Minimum spanning trees were first studied for ways to lay out electrical networks in a way that minimizes the total cost of the wiring. In a minimum spanning tree, all the nodes (houses) would be connected to power by wires in a way that has minimum cost and redundancy (cutting any wire necessarily cuts the power grid into two pieces).

Since then, the problem has been well-studied and is often used as a subroutine in more complex algorithms. The Christofides algorithm for finding approximate solutions to the Traveling Salesman Problem uses it in a key step, as do some algorithms for finding Steiner trees.

Minimum spanning trees have also been used to generate mazes. Both Kruskal's and Prim's algorithm have been used this way, often creating high-quality mazes.

If you're interested in a full history of the minimum spanning tree problem, its applications, and its algorithms, there is a truly excellent paper available here that covers all of these. I'd strongly suggest giving it a read!

Hope this helps!

like image 199
templatetypedef Avatar answered Sep 29 '22 20:09

templatetypedef