UTSAVS26 / PySnippets

Collection of reusable Python code snippets for all.
https://sites.google.com/view/pysnippets/
MIT License
27 stars 74 forks source link

[Bug]: Incorrect path returned by `bidirectional_search` in `algorithms/bidirectional_bfs.py` #465

Closed Panda8Bamboo closed 1 week ago

Panda8Bamboo commented 2 weeks ago

Is there an existing issue for this?

What happened?

Description: Currently the def bidirectional_search in algorithms/bidirectional_bfs.py does not return correct (i.e. shortest) path from start to target. The code itself runs but produces an incorrect result, pointing to an issue in the implementation of the algorithm itself.

Steps to Reproduce: Step 1: Navigate to Tests/algorithms/test_bidirectional_bfs.py Step 2: Run def test_path Step 3: Notice test fails as expected output (path) does not match actual path.

Expected Behavior: The test_path test should not fail and the shortest path should be returned.

Actual Behavior: The test_path test fails as the expected vs actual outputs do not match.

Suggestion to fix: My suggestion is re-implement the code bidirectional search with an earlier version that I wrote (PR: #322 ). The code passed the test_path test, returning the shortest path. Since then a new pull request was made ( #431 ) that broke the code.

Add ScreenShots

Current test_path test behaviour: proof_tst_fail

What browsers are you seeing the problem on?

No response

Record

Full Name

Amber

Participant Role

GSOC

github-actions[bot] commented 2 weeks ago

🙌 Thank you for bringing this issue to our attention! We appreciate your input and will investigate it as soon as possible.

Feel free to join our community on Discord to discuss more!

github-actions[bot] commented 1 week ago

✅ This issue has been closed. Thank you for your contribution! If you have any further questions or issues, feel free to join our community on Discord to discuss more!