https://github.com/haydend100/mazesolver
This program randomly generates a maze and then solves that maze using A* pathfinding algorithm
https://github.com/haydend100/mazesolver
astar astar-algorithm astar-pathfinding astar-search astar-search-algorithm cpp maze maze-algorithms maze-generation-algorithms maze-generator maze-solver prims-algorithm prims-implementation randomized-prim-algorithm
Last synced: 4 months ago
JSON representation
This program randomly generates a maze and then solves that maze using A* pathfinding algorithm
- Host: GitHub
- URL: https://github.com/haydend100/mazesolver
- Owner: HaydenD100
- Created: 2024-04-06T19:12:43.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-01-08T19:17:52.000Z (5 months ago)
- Last Synced: 2025-01-08T20:32:01.007Z (5 months ago)
- Topics: astar, astar-algorithm, astar-pathfinding, astar-search, astar-search-algorithm, cpp, maze, maze-algorithms, maze-generation-algorithms, maze-generator, maze-solver, prims-algorithm, prims-implementation, randomized-prim-algorithm
- Language: C++
- Homepage:
- Size: 181 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Maze Generator and solver
This project is a combination of two algorithms that I had recently implemented: Randomized Prim's which is an algorithm that randomly generates mazes, The algorithm starts by picking a given node in the graph, with which it begins the MST. It then finds the shortest edge from the MST to a node that is not in the MST, and adds that node. You can read more on Randomized Prim's algoirthm at: https://en.wikipedia.org/wiki/Maze_generation_algorithmThe Second algorithm is A*. A* is a path finding algorithm invented by Peter Hart. A* finds the shortest path to a destination using a cost function F = G + H H is how far the tile is from the end destination and G is how far a tile is from the starting destination. The algorithm moves by picking the lowest F cost and then calculating all the costs of the tiles surrounding it adding it to a list of all the calculate tiles (this is shown in blue in my implementation) and then picking the lowest cost from those tiles. You can read more about the A star Algorithm at: https://en.wikipedia.org/wiki/A*_search_algorithm#:~:text=A*%20is%20an%20informed%20search,shortest%20time%2C%20etc
Using these two algorithms this program generates a random maze and then solves it by finding the shortest path from the start tile(light blue) to the end tile (light green)
# GIF's of the program

# Development
Coded in c++ with SDL2 for rendering.