Skip to content

Improve speed and readability of is_obstacle in DStarLite #1223

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sutatoruta
Copy link
Contributor

@sutatoruta sutatoruta commented May 25, 2025

Reference issue

resolves #817

What does this implement/fix?

Building on #817, this PR improves both performance and readability by using sets for obstacle management in DStarLite.

This change reduces the computational complexity of is_obstacle from O(n) to O(1) average with respect to the number of obstacles. On my local environment, test execution time was improved from 1.72 seconds to 0.82 seconds.
While the suggested improvement in the original issue used dictionaries, I opted for sets to achieve both greater efficiency and more concise code.

Additional information

CheckList

  • Did you add an unittest for your new example or defect fix?
  • Did you add documents for your new example?
  • All CIs are green? (You can check it after submitting)

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.

How to speed up DStarLite algorithm implementation (improvement)
1 participant