feat(bfs.py): implement bfs algorithm and appropriate tests#42
Merged
ChronoInferna merged 1 commit intomainfrom Nov 4, 2025
Merged
feat(bfs.py): implement bfs algorithm and appropriate tests#42ChronoInferna merged 1 commit intomainfrom
ChronoInferna merged 1 commit intomainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a breadth-first search (BFS) algorithm implementation and removes the placeholder for the unimplemented A* algorithm. The BFS algorithm is now integrated into the test suite and the package's public API. Test cases have been updated to account for BFS's characteristics, such as ignoring edge weights, and to remove references to A*.
Algorithm implementation:
bfsalgorithm inwaypoint/algorithms/bfs.py, which finds a path in a graph using breadth-first search and returns aPathobject.a_starfunction and its filewaypoint/algorithms/a_star.py.API and test updates:
waypoint/algorithms/__init__.pyto exportbfsinstead ofa_star.tests/test_algorithms.pyto import and testbfsinstead ofa_star, and adjusted test logic to account for BFS's path selection (e.g., not considering weights). [1] [2] [3] [4]Minor improvements:
Path.from_listmethod signature inwaypoint/path.pyto require thetimeargument, ensuring consistency with its usage in the new BFS implementation.