-
Notifications
You must be signed in to change notification settings - Fork 52
Description
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.