-
Notifications
You must be signed in to change notification settings - Fork 58
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
Discussion on algorithms #50
Comments
Hey! Thanks for your comments. This is weird, in your example yellow is indeed not the shortest path (32 steps) and I can easily draw a path going south first that is shorter. I haven't seen this show up in test cases. I do intend for this library to give you the truly shortest path. What did you mean by: "the cost function of the AStar algorithm calculates the sum of the distances between the starting point and the target point preferentially" Did you spot that in the code? |
I have created a unit test that, I think, mimics the picture you are showing: #51 But I can't reproduce the problem you have. In both directions the path finder finds the correct 25 step path, not the longer 32 step path. Are the coordinates I used the same as you used? Are you also sure that you are using the latest version? |
I'm using the latest version, I think maybe I made some adjustments on the parameters or I changed something that caused it, I'm checking it out, thanks for your support! |
Ah, that makes sense! Thanks for sharing that! Got me scared that I messed something up that only shows up in rare cases! |
Hello, thank you very much for the code, the current algorithm is exceptionally fast to compute, but after referring to it I realized that the algorithm has some differences from the actual AStar algorithm. For example, the cost function of the AStar algorithm calculates the sum of the distances between the starting point and the target point preferentially, which is indeed fine without considering obstacles, but if obstacles are added, it is more similar to the (Greedy Best First Search) algorithm if you use the minimum heap, here is my actual test, is it designed this way on purpose?
The text was updated successfully, but these errors were encountered: