-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Adding non binary cost to A* #35
Comments
This feature could be implemented for A*. However, some other algorithms in this library such as the Breadth-First-Search and the Jump-Point-Search can not use non-uniform cost. Therefore, this behavior may lead to inconsistencies between the APIs. |
This fork adds cost support for A*: https://github.com/johnste/PathFinding.js |
FYI - I was also looking for cost support ... Going to check out the fork. (Thank you for the great library Qiao!) |
Hey has anyone used this Fork and can share a bit about how it is implemented? I think this should really be part of the A* constructor, it really is necessary for more complex path finding. |
I was thinking about adding support for this as this is quite a common scenario for A*. But as pointed out by @qiao will have to think about which other finders is it relevant for. |
Any updates on merging the https://github.com/johnste/PathFinding.js fork into pathfinding? It's two years behind and probably has a lot of merge conflicts by now... If someone were to go through the effort of cleaning it and making another PR would it get accepted? |
johnste's fork only adds support for A*. If anyone is interested in doing this please keep in mind that it needs to be done for other finders as well (wherever it makes sense). Before jumping in though, a discussion about the intended plan would be useful in this thread. |
I don't really have time but I think this is a necessary feature for an A* pathfinder. I think it would be awesome if it was made part of the official repo and offered as an option for the A* algorithm (if possible). |
+1 for this |
I have added a fork with support for non uniform node cost |
I like you addition paulrebello. I note that trace has been removed as being the same as bestfirst, but in my application trace consistently outperforms bestfirst by 5-10%, what is the difference? |
+1 Shouldn't be a problem to throw an error if the cost parameter is used with an unsupported algorithm? |
@paulrobello thanks for your fork! Does this add cost to other algorithms other than the A*? |
Sorry just read the PR! Great stuff! |
@qiao any reason not to merge this? would be nice to get it into the npm |
Would it be possible to add a non binary cost (e.g. 0.5) to matrices, so cells can be counted as walkable but costing more, to allow taking terrain speed into account for example.
The text was updated successfully, but these errors were encountered: