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
340 stars 60 forks source link

No issue just a question. #37

Open PodeCaradox opened 4 years ago

PodeCaradox commented 4 years ago

Hello,

first of all thanks for sharing your AStar implementation on github. Can you answer me why you also have a
IList Incoming { get; } in your INode interface, maybe i missing something in the Code? From your implementation of the AStar i see you only use the Outgoing List for the algorithm, which is self explained.

roy-t commented 4 years ago

Hey,

Good observation. the incoming list is not used when calculating the path. But it makes it a lot easier to increase the traversal time to reach a specific node. Otherwise you would need another lookup structure to find all edges going to a specific node.

I guess this technically means that it doesn't have to be part of the INode interface! (I could leave it on the concrete Node class that implements INode. Which I didn't realize before.

roy-t commented 4 years ago

I'll keep this question open for now, to potentially address it in potential v4, as its a breaking change to remove these members.

PodeCaradox commented 4 years ago

Yeah that's fine, i will use your implementations in a different way for my Grid. The MinHeap is really nice :)