Skip to content

Calculate path weight by traversing from source to destination #109

@JesusTheHun

Description

@JesusTheHun

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions