A C++ SFML application for visualizing and benchmarking various pathfinding algorithms. This project was created for the CICR team to optimize robot navigation logic.
- A* (Euclidean heuristic)
- Dijkstra's Algorithm
- Breadth-First Search (BFS)
- Depth-First Search (DFS)
- Greedy Best-First Search
- Jump Point Search (JPS)
- Interactive maze editor
- Real-time algorithm visualization
- Performance metrics display
- Algorithm selection dropdown
- Benchmark comparison tool
- ASCII maze files (0=path, 1=wall, S=start, G=goal)
- PNG image mazes (black=wall, white=path, green=start, red=goal)
- CMake 3.10 or higher
- SFML 2.5 or higher
- C++17 compatible compiler
- Install SFML:
vcpkg install sfml:x64-windows
- Create build directory and build:
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=[path to vcpkg]/scripts/buildsystems/vcpkg.cmake ..
cmake --build . --config Release
- Install SFML:
sudo apt-get install libsfml-dev
- Create build directory and build:
mkdir build
cd build
cmake ..
make
# From build directory
./PathfindingBenchmark
# From build directory
./PathfindingBenchmark_test
- Left Mouse Button: Draw/erase walls
- Right Mouse Button: Place start/goal points
- Mouse Drag: Continue drawing/erasing
- Space: Run current algorithm
- Tab: Switch between algorithms
- Dropdown Menu: Select specific algorithm
- R: Generate random maze
- C: Clear maze
- Ctrl+L: Load maze from file
- Ctrl+O: Save maze to file
- W: Wall drawing mode
- S: Start point mode
- G: Goal point mode
- P: Path (eraser) mode
S0110000001
0100111110
0100000010
0111111010
0000000010
0111111110
0100000000
0101111111
0100000001
0111111G01
- Black pixels (RGB: 0,0,0): Walls
- White pixels (RGB: 255,255,255): Paths
- Green pixels (RGB: 0,255,0): Start point
- Red pixels (RGB: 255,0,0): Goal point
The application includes a comprehensive benchmarking system that compares:
- Execution time
- Memory usage
- Nodes explored
- Path length
- Success rate
Results are exported to:
- CSV file for data analysis
- Markdown file for documentation
.
├── include/
│ ├── Maze.hpp
│ ├── GUI.hpp
│ ├── Benchmark.hpp
│ └── pathfinders/
│ ├── Pathfinder.hpp
│ ├── AStar.hpp
│ ├── Dijkstra.hpp
│ ├── BFS.hpp
│ ├── DFS.hpp
│ ├── GreedyBestFirst.hpp
│ └── JPS.hpp
├── src/
│ ├── main.cpp
│ ├── Maze.cpp
│ ├── GUI.cpp
│ └── Benchmark.cpp
├── tests/
│ └── TestRunner.cpp
├── resources/
│ └── arial.ttf
├── CMakeLists.txt
└── README.md
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- SFML team for the graphics library
- CICR Robo-Soccer team for the project requirements
- Various algorithm implementations referenced from academic papers