Skip to content

Fix Dijkstra failure when goal is unreachable - #1418

Open
huxiaoyi-ovo wants to merge 2 commits into
AtsushiSakai:masterfrom
huxiaoyi-ovo:fix/dijkstra-unreachable-goal
Open

Fix Dijkstra failure when goal is unreachable#1418
huxiaoyi-ovo wants to merge 2 commits into
AtsushiSakai:masterfrom
huxiaoyi-ovo:fix/dijkstra-unreachable-goal

Conversation

@huxiaoyi-ovo

Copy link
Copy Markdown

Summary

  • handle an exhausted open set in the Dijkstra planner
  • return empty path lists instead of raising ValueError
  • add a regression test with a goal separated by a solid obstacle wall

Problem

When the goal is unreachable, Dijkstra eventually exhausts open_set. The next call to min(open_set, ...) then raises ValueError: min() arg is an empty sequence.

Other grid-search implementations in this repository already guard against an empty open set. This change adds equivalent handling to Dijkstra and returns ([], []) to make the no-path result explicit.

Tests

Added test_unreachable_goal in tests/test_dijkstra.py to verify that an unreachable goal returns empty path lists without throwing an exception.

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.

1 participant