-
Notifications
You must be signed in to change notification settings - Fork 37
feat: enhance pathfinding options with maxCost, maxNodes, and allowedCallback #47
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
base: master
Are you sure you want to change the base?
Conversation
albertorestifo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution! :)
Left a couple of notes, let me know what you think.
|
Ah also I see there are some errors from Prettier, can you please run it on the code? Thanks! |
|
@albertorestifo I fixed the lint issues (and also moved lint from the test script and explicitly run it in the workflow). |
|
|
||
| // Add the starting point to the frontier, it will be the first node visited | ||
| frontier.set(start, 0); | ||
| depth.set(start, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should depth start at 0 or 1 for the root node?
This pull request adds new constraints and customization options to the
Graphclass'spath()method, enhancing its flexibility for pathfinding. It introduces support for limiting the maximum cost and maximum number of nodes in a path, as well as a callback to control which edges are allowed during path expansion.Tests for new cases are added.
closes #46
Also includes types (from @types/node-dijkstra) with modifications untill #45 is merged.