test generation: fixed non-optimal route generation

In some cases the test generator preferred already planned route even
though it found a shorter route with the same score.