Using a Genetic Algorithm approach to solve this problem. ...I will take any excuse to work with QGraphicsView.