roy-t / AStar

A fast 2D path finding library based on the A* algorithm. Works with both grids and graphs. Supports any .NET variant that supports .NETStandard 2.0 or higher. This library has no external dependencies. The library is licensed under the MIT license.
http://roy-t.nl
MIT License
338 stars 60 forks source link

No closed collection? #20

Closed MorganMoon closed 5 years ago

MorganMoon commented 5 years ago

I am probably not fully understanding how this is working, but why is there not a closed list of some sort? For example, on a grid that is 32x32 from close to each corners with only a few high weighted positions but is mostly empty, the iteration count is getting to 1800+ before finding the path? It's running super quick, however shouldn't it only evaluate each position only once?

roy-t commented 5 years ago

Hey MorganMoon,

It should consider each tile only once, but can update the cost to an already reached cell. Are you really seeing 1800+ iterations. That must be a bug. Can you share the exact make-up of your grid?

Note that all standard cells should have a cost of 1 for the path finding to work best, so I',m not sure what you mean by weighted here.

roy-t commented 5 years ago

I've looked at the code again, just to make sure I do not work twice. All seems good. I'm closing this issue until there is more feedback.

MorganMoon commented 5 years ago

Yeah, sorry for the long delayed response. I am having issues re-creating it. Sorry, I will update this when I have more time to look into this again, sorry