Nora McDougall
Stolen Java
Many thanks to Papagelis Athanasios from Greece
for the following Java Applets. Click
here to go to his site.
These scripts show two examples of algorithms for finding the shortest
way to link all the nodes in a weighted connected graph. That might
not sound like a very important thing to figure out, but it has loads
of uses in traffic and network patterns.
Prim's Algorithm
This one takes more machine resources because it only finds the next
shortest path from nodes that are already connected. That means that
the program has to keep rechecking all the untaken links from all the
nodes that are linked every time you click Step.
Kruskal's Algorithm
This one takes less machine resources because it finds whichever connections
are the shortest if the nodes haven't been used yet.
|