Josephbakulikira / Astar-visualization-python

Astar Visualization with pygame python

Home Page:https://www.youtube.com/c/Auctux

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Astar-visualization-python

Subscribe to Auctux

Requirements

pygame : pip install pygame


Run

In The terminal:
    python main.py
    
- Press "Space" To start The simulation

Controls (Commands)

  • S -> To show node details(costs) text
  • W -> To Toggle Drawing walls
  • Left Mouse Button -> To Remove Walls
  • Right Mouse Button -> To Add Walls
  • Space -> To pause and Resume
  • R -> To reset
  • Enter(Return) or P -> To toggle setting Panel
  • Esc -> To quit (close the window)

bugs- Unsolved issues

This code need a lot of refactoring , and the ui implementation is poorly done and can affect the performance


About

    Astar algorithm in python using the pygame library, 
    A* is a graph traversal and path search algorithm, 
    which is often used in many fields of computer science due to its completeness, 
    optimality, and optimal efficiency. One major practical drawback is its O(b^d) 
    space complexity, as it stores all generated nodes in memory.

Screenshot (233) Screenshot (234) Screenshot (218) Screenshot (216) Screenshot (220) Screenshot (219)