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

Add "cost to here" to predecessors and PathInfo? #12

Open
wylee opened this issue Oct 16, 2019 · 1 comment
Open

Add "cost to here" to predecessors and PathInfo? #12

wylee opened this issue Oct 16, 2019 · 1 comment
Assignees

Comments

@wylee
Copy link
Owner

wylee commented Oct 16, 2019

Change predecessors[v] = (u, e, cost_of_e) to predecessors[v] = (u, e, cost_of_e, cost_of_s_to_u_plus_cost_of_e) in single_source_shortest_paths(), add a corresponding field to PathInfo, and update extract_shortest_path_from_predecessor_list().

I'm not sure off the top of my head what the use cases for this might be, but I saw that someone created a fork to replace cost_of_e with cost_of_s_to_u_plus_cost_of_e, so it's worth considering.

@wylee wylee self-assigned this Oct 16, 2019
@wylee wylee changed the title Add cost from s to v to predecessors and PathInfo? Add "cost to here" to predecessors and PathInfo? Oct 24, 2019
@wylee
Copy link
Owner Author

wylee commented Oct 24, 2019

As this is just sum(info.costs[:i]), it doesn't seem super useful except as a convenience. It would change the API (the return value of find_path() in particular), so it would have to be added to v3. I'm thinking it doesn't seem worth the effort.

@wylee wylee added the v3 label Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant