Skip to content
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

Open
ricick opened this issue Jul 1, 2013 · 15 comments
Open

Adding non binary cost to A* #35

ricick opened this issue Jul 1, 2013 · 15 comments

Comments

@ricick
Copy link

ricick commented Jul 1, 2013

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.

@qiao
Copy link
Owner

qiao commented Jul 1, 2013

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.

@MasterScrat
Copy link

This fork adds cost support for A*: https://github.com/johnste/PathFinding.js

@dwabyick
Copy link

FYI - I was also looking for cost support ... Going to check out the fork. (Thank you for the great library Qiao!)

@rohan-deshpande
Copy link

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.

@imor
Copy link
Collaborator

imor commented Nov 27, 2014

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.

@tlhunter
Copy link
Contributor

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?

@imor
Copy link
Collaborator

imor commented Mar 26, 2015

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.

@rohan-deshpande
Copy link

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).

@tarlepp
Copy link

tarlepp commented Apr 1, 2015

+1 for this

@paulrobello
Copy link

I have added a fork with support for non uniform node cost
https://github.com/paulrobello/PathFinding.js
I have also added a pull request #100

@bentwonk
Copy link

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?

@PSeitz
Copy link

PSeitz commented Jul 27, 2015

+1

Shouldn't be a problem to throw an error if the cost parameter is used with an unsupported algorithm?

@rohan-deshpande
Copy link

@paulrobello thanks for your fork! Does this add cost to other algorithms other than the A*?

@rohan-deshpande
Copy link

Sorry just read the PR! Great stuff!

@pajtai
Copy link

pajtai commented Oct 18, 2019

@qiao any reason not to merge this? would be nice to get it into the npm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests