All mazes below are 25 x 25, generated with seed = 42
and with start and end pinned to opposite corners
(set_endpoints(strategy = "corners")). Each card shows the
generation algorithm carving the maze and then A-star finding the
shortest path.
One algorithm at a time
algorithm = “dfs”
Generation
A*
solve
algorithm = “prim”
Generation
A*
solve
algorithm = “kruskal”
Generation
A*
solve
algorithm = “wilson”
Generation
A*
solve
algorithm = “eller”
Generation
A*
solve
algorithm =
“division”
Generation
A*
solve
algorithm =
“aldous_broder”
Generation
A*
solve
algorithm = “hunt_kill”
Generation
A*
solve
algorithm = “binary_tree”
Generation
A*
solve
algorithm = “sidewinder”
Generation
A*
solve
algorithm =
“growing_tree”, selection = “newest”
Generation
A*
solve
algorithm =
“growing_tree”, selection = “random”
Generation
A*
solve
algorithm =
“growing_tree”, selection = “oldest”
Generation
A*
solve
algorithm =
“growing_tree”, selection = “mixed”
Generation
A*
solve
Reproduce it
The images come from scripts/generate_mazes2.R in the GitHub repository. A
single maze and its animations take a few lines:
library(mazegenerator)
maze <- generate_maze(25, 25, algorithm = "wilson", seed = 42)
maze <- set_endpoints(maze, strategy = "corners")
animate_maze(maze, output_file = "generation.gif")
path <- solve_maze(maze, algorithm = "astar", trace = TRUE)
animate_solution(maze, solution = path, output_file = "solve.gif")