2025-09-22 10:15:02 +02:00
2025-09-20 17:35:40 +02:00
2025-09-22 10:13:06 +02:00

Pathfinding demo

This is a demo of pathfinding on a 2D grid. It consists of 2 main parts:

  • python notes and implementation
    • jupyter notebook file
    • standalone python script
  • C++ demo - work in progress

Python

Standalone script

Run python pathfinding_demo.py. Requires numpy and matplotlib to be installed.

Jupyter notebook

Contains the same demo as the standalone script and some notes. Since Github supports Jupyter Notebooks now, you can go directly to the file.

Alternatively (or if you want to edit the file), you can use the Jupyeter Lab on the official website:

  • click the icon "Upload files" (on the top of left sidebar)
  • select pathfinding_demo.ipynb
  • file should be now visible in the left sidebar. Double-click it and confirm default kernel selection
  • run all the cells one by one (play button on the top) or run all of at once using menu "Run -> Run All Cells"

TODO

  • python
    • get jupyter lab running
    • drawing utility
    • interface for pathfinding
    • research methods
    • implement methods
      • DFS
      • BFS
      • Dijsktra
      • GBFS
      • A*
    • performance measurement: time/visited nodes
    • finalize the script and copy back to the jupyter notebook
    • finish text on the page
    • create a dedicated python script
  • C++
    • re-use 2D game engine
    • add tiles (with cost) to map
      • conversion functions from tile coords to world coords
      • drawing tiles
      • add "terrain tiles" with different costs
    • add mouse-click action
    • add direct movement (through mouse click action, no pathfinding)
    • implement pathfinding
    • windows build?
Description
Python and C++ implementation of selected pathfinding algorithms
Readme 817 KiB
Languages
C++ 48.3%
Jupyter Notebook 42.4%
Python 8.7%
Makefile 0.6%