Add Search Algorithm#1300
Conversation
|
Thanks for this, @UditNayak — animated search on a grid is a genuinely nice addition for #1155. A few things to address before it can be merged: (1) It currently crashes on modern matplotlib: ax.scatter(*transpose(...)) raises 'missing x and y' whenever the point set is empty - this happens on the very first step because the root node's solution() is [] (and also if obstacles is empty). Please guard empty sets before scatter. (2) obstacles=random_lines(...) as a default argument is evaluated once at import time and shared across instances - please use obstacles=None and generate them inside init. (3) import heapq is unused (the frontier uses utils.PriorityQueue). (4) straight_line_distance duplicates utils.euclidean_distance - please reuse it. (5) Minor: use triple-quoted docstrings to match the repo style. Once it runs end-to-end on current matplotlib, happy to re-review! |
Issue: #1155 - Add Animations for Search Algorithms
Context:
This PR introduces animations for search algorithms, enhancing the user experience by providing a visual understanding of the algorithm's progression.
Changes Introduced:
Animation Components:
AnimateProblemclass to handle animations for various search algorithms.Integration with Search Algorithms:
AnimateProblemclass with different search algorithms such as A*, Weighted A*, BFS, DFS, UCS, and Best-First Search.User Interface and Visualization:
Performance Optimizations: