Find the shortest path with least turns
Sometimes, the shortest path is not enough. It requires a shortest path with less turns. It is quite normal in the robot and maze problem. For example, the graph below is the shortest path found by A* algorithm with Manhattan distance.

If we consider turning is an issue here, the actual shortest path is that go down then turn left and go to the goal directly. This path is the same weight with the shortest path found above but with less turns.
PathFinding.js is a great searching library but I notice that PathFinding.js does not provide this feature directly. Is there anyway to add the feature in and is there any plan to support this feature by default?
Hi @imwithye You can take a look at https://github.com/qiao/PathFinding.js/pull/32. This PR was not merged because the changes were done in the wrong file. If you happen to make it work please consider opening a pull request.
Neither #32 nor #150 can find the best path with least turns. For example:
In this case, the result (yellow) is not the best path (red).