Improved node placement algorithm

It will now attempt to select nodes in an order such that their
connectted nodes have already been placed.