This sketch will generate twenty random points and use Prim's algorithm to find the shortest distance to connect them all up.
Click to generate new points! Drag an existing point to move it! Click the reset button to generate a new set of random points!