Mathematics (Jul 2024)

Solving Mazes: A New Approach Based on Spectral Graph Theory

  • Marta Martín-Nieto,
  • Damián Castaño,
  • Sergio Horta Muñoz,
  • David Ruiz

DOI
https://doi.org/10.3390/math12152305
Journal volume & issue
Vol. 12, no. 15
p. 2305

Abstract

Read online

The use of graph theory for solving labyrinths and mazes is well known, understanding the possible paths as the connections between the nodes that represent the corners or bifurcations. This work presents a new idea: minimizing the length of the optimal path formulated as a topology optimization problem. The maze is mapped with finite elements, and then, through the eigenvalues of the Laplacian matrix of the graph, a constraint is imposed over the connectivity between the input and the output. Several 2D examples are provided to support this approach, allowing for unequivocally finding the shortest path in mazes with multiple connections between entrance and exit, resulting in an nonheuristic algorithm.

Keywords