Skip to content

fix: handle unreachable paths in DijkstraPathPlanning - #161

Merged
shima004 merged 1 commit into
adf-python:mainfrom
ToB213:fix/dijkstra-shortest-path
Sep 27, 2026
Merged

shima004 merged 1 commit into
adf-python:mainfrom
ToB213:fix/dijkstra-shortest-path

Conversation

@ToB213

@ToB213 ToB213 commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix DijkstraPathPlanning so unreachable destinations do not produce a destination-only path or a zero distance.

Changes

  • Return an empty path and float("inf") for unreachable destinations.
  • Use a shared weighted shortest-path search for single and multiple destinations.
  • Select the destination with the shortest total distance, rather than the fewest edges, when multiple destinations are given.

Fixes #160

…thPlanning

Return an empty path and infinite distance when a destination is unreachable. Use weighted shortest paths when selecting among multiple destinations.
@shima004
shima004 self-requested a review September 27, 2026 06:59
@shima004

Copy link
Copy Markdown
Member

LGTM👍️

@shima004
shima004 merged commit 0ab215a into adf-python:main Sep 27, 2026
4 checks passed
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

Successfully merging this pull request may close these issues.

DijkstraPathPlanning returns a destination-only path when no path exists

2 participants