Wait for it... this is hard.




Prim's algorithm courtesy of Mike Bostock & D3