Skip to main content
  1. Posts/

Kruskal v. Prim, to the death!

This semester I have an Algorithms course, and it’s actually turning out to be one of my favorites. So for our second project we were instructed to implement a Java applet which generated a set of nodes on a graph and the edges (or some subset of) between them, and then used Kruskal’s or Prim’s algorithm to find the minimal spanning tree , animating the process. And even though it’s Java, and even though it’s an applet, I’ve been oddly fixated by it lately. So you can check out my second implementation , which lets you pick which algorithm to use and then sit back and watch the pretty nodes. Oooooh.