Demo - End product will be better than shown above.
Pathfinding Visualization with Dijkstra's and A* Algorithms (New add: DFS and BFS) This Python program provides a visual representation of Dijkstra's and A* pathfinding algorithms using the Pygame library. The application allows users to interactively set starting and ending points on a grid, draw obstacles, and visualize the process of finding the shortest path from the starting point to the endpoint while avoiding obstacles.
Simultaneous Pathfinding: Run Dijkstra's and A* algorithms(Added DFS and BFS) simultaneously to compare their performance. User Interaction: Set the starting and ending points by clicking on cells. Draw obstacles by holding the left mouse button. Algorithm Visualization: See the algorithms in action with real-time visualization. Observe the exploration of cells and the final pathfinding result. Execution Timing: Measure and display the execution time of Dijkstra's and A* algorithms.
Run the program and interact with the grid using the mouse. Set the starting and ending points, draw obstacles, and press the space bar to execute Dijkstra's and A* algorithms (Additions DFS and BFS). Press 'c' to clear the grid and reset points. 'ESC' button opens the algorithm selection menu. A check box has been added for 'maze' generation, checking it auto creates obstacles for the tile map.
Left click adds obstacles. Right click removes obstacles.
Improve user interface for better clarity and guidance. Implement more pathfinding algorithms for comparison. Allow customization of grid size and cell size. Enhance algorithm visualization with step-by-step details. Add obstacle generation (maze)
Pygame: Install it using pip install pygame. Feel free to contribute, report issues, or suggest improvements! Happy pathfinding!
#Added BFS (breadth first search) and DFS (depth first search) to the algorithm mix! #Added Algorithm selection #Added random obstacle (maze) generation. #Added hotkeys to select a algorithm- 1-A*,2-DIJKSTRA,3-BFS,4-DFS without clearing the grid #Added some error handling #Added a slider for visualization delay(slows the visualization process). #Added the ability to exit visualization with 'Esc' #Changes to colors of Algorithms #Added the ability to pause visualization with 'P' (pressing 'p' again will resume the visualization process) #Graphical enhancements for Visualization process #Ability to resize Grid with a slider #New hotkeys to save the visualization process by pressing 's', '+' to increase speed, '-' to decrease speed and 'm'to generate maze('0' and '9' affects delay speed for smooth transitions). PS: I made alot of similar programs/codes(that don't work/ are bad) feel free to ping me for my previous codes(this is the most polished version of my code and it works! :) Thanks! Limitations: This project uses grid based map tile for pathfinding algorithms to work on which may or may not limit the algorithm's capabilities.(I may change the map tile versions in the future)
This project is going to be around 1000 lines of code. I may keep making making updates after reaching that goal The assests I use in the future will be copyright-free