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

Calculate path weight by traversing from source to destination #109

Open
JesusTheHun opened this issue Feb 28, 2025 · 1 comment
Open

Calculate path weight by traversing from source to destination #109

JesusTheHun opened this issue Feb 28, 2025 · 1 comment

Comments

@JesusTheHun
Copy link
Contributor

In #106 and #107 the nextWeightFn was introduced.
The getPath function uses that function to calculate the weight of the path, but traverses it from destination to source. Then it reverses the node list before returning.

While traversing from destination to source is required (given the function input), calculating the weight of the path can be done after reversing the node list, leading to a much more natural understanding of the function's behavior.

I suggest we calculate the path's weight from source to destination using the node list, introduce a new parameter "nodes" which is the node list. The current "path" parameter is a more complex object. Maybe we should just change and give the node list for the "path" parameter.

Since the version is fresh I suggest we treat this as a bug fix.

@curran @ravann WDYT ?

@curran
Copy link
Member

curran commented Mar 3, 2025

Could be a nice clean up! Thanks for the idea.

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

2 participants