|
1 | 1 | # Pathfinding_Visualization_Tool_Python
|
2 | | -It allows users to visualize the behavior of two popular pathfinding algorithms: A* (A-star) and BFS (Breadth-First Search). The tool features an intuitive graphical interface where users can interactively set up obstacles and start points, then watch in real-time as the algorithms calculate and display the shortest path. |
3 | 2 |
|
4 | | -#Features of the tool: |
| 3 | +## Description |
5 | 4 |
|
6 | | -- Implement Algorithms: Implement pathfinding algorithms like A*, Dijkstra's, and Breadth-First Search (BFS). |
7 | | -- Visualization: Visualize the algorithms in real-time using a graphical user interface. |
8 | | -- Interactive: Allow users to set start and end points, and obstacles on a grid. |
9 | | -- User Control: Provide options to step through the algorithm or run it in real-time. |
| 5 | +This Python tool allows users to visualize the behavior of two popular pathfinding algorithms: A* (A-star) and Breadth-First Search (BFS). It features an intuitive graphical interface where users can interactively set up obstacles, start, and end points on a grid. Users can then watch in real-time as the algorithms calculate and display the shortest path. This tool is excellent for understanding how these algorithms work and comparing their performance. |
10 | 6 |
|
11 | | -#Interacting with the Tool |
| 7 | +## Features |
12 | 8 |
|
13 | | -- Start Point: Click on a cell in the grid where you want to set the start point. The cell will turn green. |
14 | | -- End Point: Click on a cell in the grid where you want to set the end point. The cell will turn blue. |
15 | | -- Obstacles: Click on any cell to place an obstacle (wall). The cell will turn gray. |
16 | | -- Removing Points and Obstacles: |
17 | | -- Right Mouse Button: Click on a cell with the right mouse button to remove obstacles or clear the start and end points. The cell will return to the default color (black). |
| 9 | +* **Algorithm Implementations:** Implements A* (A-star) and Breadth-First Search (BFS) pathfinding algorithms. 🤖 |
18 | 10 |
|
19 | | -# Running the Algorithm: |
| 11 | +***Real-time Visualization:** Visualizes the search process of the algorithms in real-time using a graphical user interface. 👀 |
20 | 12 |
|
21 | | -- A Algorithm*: Press the SPACE key to run the A* pathfinding algorithm. The algorithm will search for a path from the start point to the end point and visualize the search process. |
22 | | -- BFS Algorithm: Press the B key to run the Breadth-First Search (BFS) algorithm. Similar to A*, it will search for a path and visualize the process. |
23 | | -Visual Feedback: |
| 13 | +* **Interactive Grid:** Users can interactively set start and end points, and place obstacles (walls) on the grid. 🧱 |
24 | 14 |
|
25 | | -- Open Cells: Cells being explored during the search will turn white. |
26 | | -- Closed Cells: Cells that have been fully explored and cannot be part of the path will turn gray. |
27 | | -- Path: Once the path is found, it will be highlighted in red. |
| 15 | +* **User Control:** Options to step through the algorithm or run it in real-time. ⏯️ |
| 16 | + |
| 17 | +* **Start/End Point Placement:** Click to set the start (green) and end (blue) points. 🟢🔵 |
| 18 | + |
| 19 | +* **Obstacle Placement:** Click to place obstacles (walls) on the grid (gray). 🚧 |
| 20 | + |
| 21 | +* **Removal:** Right-click to remove obstacles or clear start/end points (back to black). ⬛ |
| 22 | + |
| 23 | +* **A* Algorithm Execution:** Press SPACE to run the A* algorithm. ✨ |
| 24 | + |
| 25 | +* **BFS Algorithm Execution:** Press B to run the BFS algorithm. 🔍 |
| 26 | + |
| 27 | +* **Visual Feedback:** |
| 28 | + * **Open Cells (Explored):** Cells being explored turn white. ◻️ |
| 29 | + * **Closed Cells (Fully Explored):** Cells that have been fully explored turn gray. ⬛ |
| 30 | + * **Path:** The final shortest path is highlighted in red. 🟥 |
| 31 | + |
| 32 | +## Technologies Used |
| 33 | + |
| 34 | +* **Python:** The primary programming language. 🐍 |
| 35 | + |
| 36 | +* **Pygame (or similar GUI library):** For creating the graphical user interface. 🎮 |
| 37 | + |
| 38 | +## Ideal For |
| 39 | + |
| 40 | +* **Students:** Learning about pathfinding algorithms and data structures. 🧑🎓 |
| 41 | + |
| 42 | +* **Game Developers:** Visualizing pathfinding for game AI. 🎮 |
| 43 | + |
| 44 | +* **Algorithm Enthusiasts:** Exploring and comparing different search algorithms. 🤓 |
| 45 | + |
| 46 | +## How to Run |
| 47 | + |
| 48 | +1. **Clone the repository:** `git clone <repo url>` |
| 49 | + |
| 50 | +2. **Install Pygame:** `pip install pygame` (or `pip install -r requirements.txt` if you have one) |
| 51 | + |
| 52 | +3. **Run the program:** `python pathfinding_visualizer.py` (or `python3 pathfinding_visualizer.py`) |
| 53 | + |
| 54 | +## How to Use |
| 55 | + |
| 56 | +1. Click on the grid to set the start (green) and end (blue) points. |
| 57 | + |
| 58 | +2. Click on cells to create obstacles (walls - gray). |
| 59 | + |
| 60 | +3. Right-click to remove obstacles or clear start/end points. |
| 61 | + |
| 62 | +4. Press SPACE to run the A* algorithm. |
| 63 | + |
| 64 | +5. Press B to run the BFS algorithm. |
| 65 | + |
| 66 | +6. Observe the visualization of the search process and the final path (red). |
28 | 67 |
|
29 | 68 | # A* Algorithm
|
30 | 69 |
|
|
0 commit comments