Skip to content

Feature: Bidirectional A*#40

Merged
ShisatoYano merged 5 commits into
ShisatoYano:mainfrom
guilyx:feature/bidirectional-astar
Jan 29, 2026
Merged

Feature: Bidirectional A*#40
ShisatoYano merged 5 commits into
ShisatoYano:mainfrom
guilyx:feature/bidirectional-astar

Conversation

@guilyx
Copy link
Copy Markdown
Contributor

@guilyx guilyx commented Jan 27, 2026

Overview

This PR adds a bidirectional A* path planning algorithm that simultaneously searches from both the start and goal positions. This approach can be more efficient than standard A* as it explores fewer nodes in many scenarios.

Changes

  • New path planner: src/components/plan/astar_bidirectional/astar_bidirectional_path_planner.py

    • Implements bidirectional A* algorithm with forward and backward searches
    • Detects when searches meet and combines paths
    • Supports 8-connected neighbors with proper diagonal movement costs
    • Includes visualization and path saving functionality
  • Test: test/test_astar_bidirectional_path_planning.py

    • Unit test for the bidirectional A* simulation
  • Simulation: src/simulations/path_planning/astar_bidirectional_path_planning/

    • Complete simulation script with map file support
    • Generates search and navigation GIFs
  • Documentation: Updated README.md

    • Added bidirectional A* to Path Planning section
    • Added entry in Table of Contents

Benefits

  • More efficient pathfinding in many scenarios
  • Follows existing codebase patterns and conventions
  • Includes comprehensive tests and documentation

Testing

  • All tests pass successfully
  • Simulation runs correctly with map file support

@ShisatoYano ShisatoYano self-requested a review January 27, 2026 12:33
@ShisatoYano ShisatoYano added the enhancement New feature or request label Jan 27, 2026
@guilyx
Copy link
Copy Markdown
Contributor Author

guilyx commented Jan 27, 2026

@ShisatoYano I can generate a gif for an environment where Bidir A* actually performs better if needed. The sim here was a bad scenario for it

Also, any rule on maps ? do you want to use the same map for all planners ?

@ShisatoYano
Copy link
Copy Markdown
Owner

@guilyx Wow, thank you for this fantastic PR! Bidirectional A* is a great addition to this project.

Yes, I wanna ask you to generate a gif for an environment where Bidir A* actually performs better. Can you improve the current scenario?

We don’t have any rules for map. You can change the location of obstacles to show the better performance of Bidir A*.

@ShisatoYano
Copy link
Copy Markdown
Owner

Hi @guilyx, your PR is LGTM and was merged successfully. I want to announce your PR was merged on X and LinkedIn. Could you tell me those accounts if you have?

@ShisatoYano ShisatoYano merged commit 79ca3fe into ShisatoYano:main Jan 29, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants