Is it possible to change A * to return the shortest path with the least number of revolutions ?
One complication: the nodes can no longer differ only in their location, because their parent node is important in determining future turns, so they must also have a direction associated with them.
But the main problem that I encountered is how to work the number of turns in the partial cost of the path (g). If you multiply g by the number of turns taken (t), strange things happen: a long way with N turns closer to the end is preferable to a shorter way with N turns at the beginning.
Another less optimal solution that I am considering is the following: after calculating the shortest path, I could start the second iteration A * (with a different formula for the path cost), this time limited in the x / y range of the shortest path, and return the path with the lowest speed . Any other ideas?
source share