https://github.com/liraymond04/olc-dijkstra
GUI implementation of Dijkstra's shortest path algorithm in the olcPixelGameEngine.
https://github.com/liraymond04/olc-dijkstra
algorithm algorithms-and-data-structures c-plus-plus cpp dijkstra dijkstra-algorithm dijkstra-shortest-path gui olc olcpixelgameengine pge
Last synced: 3 months ago
JSON representation
GUI implementation of Dijkstra's shortest path algorithm in the olcPixelGameEngine.
- Host: GitHub
- URL: https://github.com/liraymond04/olc-dijkstra
- Owner: liraymond04
- License: other
- Created: 2022-03-02T21:17:43.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2025-05-14T19:38:45.000Z (7 months ago)
- Last Synced: 2025-09-06T21:54:33.001Z (3 months ago)
- Topics: algorithm, algorithms-and-data-structures, c-plus-plus, cpp, dijkstra, dijkstra-algorithm, dijkstra-shortest-path, gui, olc, olcpixelgameengine, pge
- Language: C++
- Homepage:
- Size: 64.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# olc-dijkstra
GUI implementation of Dijkstra's shortest path algorithm in the olcPixelGameEngine.

## Controls
| Button | Action |
| ----------- | ----------- |
| Esc | Quit |
| Shift + Left click | Create node |
| Ctrl + Left click | Move node |
| Left click | Create edge |
| = | Increase edge weight |
| - | Decrease edge weight |
| D + Left click | Delete node/edge |
| S + Left click | Select start node |
| E + Left click | Select end node |
| Enter | Play shortest path |
## Building
Building is based on Moros1138's [pge-template-project](https://github.com/Moros1138/pge-template-project) CMake files
### Arch Linux
Install the required packages with the following command
`sudo pacman -Sy base-devel cmake git libpng mesa`
Generate project makefiles and build with CMake
```bash
# Use the -d flag to build for debugging
./build.sh
```
You can run the application using the built executable
```bash
./build/olc-dijkstra
```
### Windows
Install a C++ compiler like [MinGW](https://sourceforge.net/projects/mingw/)
Generate project makefiles with CMake
`cmake . -G "MinGW Makefiles"`
And build the project
`mingw32-make`
### Web build with Emscripten
Web builds use [Emscripten](https://github.com/emscripten-core/emscripten), and need the following additional packages:
```bash
sudo pacman -S --needed emscripten
```
Build by passing in a new target flag to the build script
```bash
## Optionally pass the -d flag to build for debug
./build.sh -t web
```
You can run the application by opening a local web server with emrun
```bash
emrun build/olc-dijkstra.html
```