Skip to content

jontran1/python-path-finding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Readme

A remake of my first path finding project using python and pygame.

Here is a link to the JavaScript version.

https://jontran1.github.io/graph-search-pathfinding-visualization/

Why? To reteach myself python. I mostly used python for machine learning and data-science related projects and wanted to get back into python. Its a wonderful language.

Right now, only A* shortest path is in. But I will be adding more algorithms soon.

Thanks to this video for getting me started. https://www.youtube.com/watch?v=JtiK0DOeI4A

How To Run:

  • Clone this repo.
  • Open up terminal
  • CD into python-path-finding
  • Run this command 'python app.py'.

How To Use It:

  • Left clicking the first time will set the start node.
  • Left clicking the second time will set the end node.
  • Left clicking after the start and end nodes are set will build walks.
  • Right click to remove nodes from the grid.
  • Algorithms won't work without start and end node being set.
  • Press c to clear grid.

How To Run Algorithms:

number_pad

  • I'm not very good at GUIs so for now. Algorithms are set to the key number pad. Press 0-4 numbers to activate any of the algorithms. It will stay like this until I figure something else out.
  • 0 - A* Shortest Path Algorithm.
  • 1 - Dijkstra's Shortest Path Algorithm.
  • 2 - Bi-Directional Search Path Algorithm.
  • 3 - Breadth First Search Algorithm.
  • 4 - Depth First Search Algorithm.

Heuristic

  • Right now the algorithms only use Manhattan distance, which is good enough for this project.

A* Shortest Path

a-starr

Dijkstra's Shortest Path

diklstra

Bi-Directional Search Path

bi-directional

Breadth First Search

bfs

Depth First Search

dfs

Releases

No releases published

Packages

No packages published

Languages