We have accidentally discovered a pretty serious bug in the Routing Algorithm: it makes U-turns.
The images below are numbered 1xxx, 2yyy, 3zzz, and 4
The intial route takes a right turn that we delete from the index, as shown if 1DeletedRightTurnSegment.jpg, for the purpose of testing the program. The route should avoid this turn, which it originally took.
Image 2Route.jpg is the new route. Initially we thought we had a bug in the program. We thought that the segment had not been deleted, because the route is still taking the turn. We also noticed the extra segment in the upper right-hand corner of the route.
We found that: the segment had indeed been deleted. The new route went past this intersection, made a U turn, then a left turn.
We tested the assumption by deleting the left turn for the U-turn segment. This is shown in 3DeletedLeftTurnSegment.jpg.
The last image, 4 Route.jpg shows the new route. Now there is no left turn on the U turn segment, so and the route properly follows the rules and goes around.
But obviously no U turns should be allowed.
The problem can easily be reproduced.
Can you tell me if this bug can be fixed?
UTurnRouting.zip (234 KB)