-
Notifications
You must be signed in to change notification settings - Fork 320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I don't get the shortest path #32
Comments
Hm after toying with it, the number of nodes is constant, so it's most likely because of the weighting of the diagonal moves (making this issue a duplicate of #10) |
Are you using the diagonal heuristic? I think this might actually be due to missing documentation / not assuming diagonal heuristic with a diagonal grid. Can you try adding |
I've edited your library now so I think I broke things, but yeah, from what I understand, applying the diagonal heuristic would have worked; however, it is not documented and I expected it to be applied automatically when I chose a diagonal pathing. |
Sorry about that, I've added a note to the README about the heuristic. |
Here is my initial grid, startpoint, endpoint and astar path:
However, if I add an obstacle (4 blocks of the graph are turned to 0s), this is the path I get:
It is obviously a sub-optimal path (it shouldn't go all the way down before the obstacle), however A* is supposed to return the optimal path and I don't get how/why it fails there.
Tell me if you need more data.
The text was updated successfully, but these errors were encountered: