I think I got it

Instead of just checking the closets node for an edge in the last two
nodes, I have changed it to check for the closest node anywhere in the
graph. Need to throughly test and write report. I belive this to be the
correct implementation of the algorithm