Next Article in Journal
Research on Model Selection-Based Weighted Averaged One-Dependence Estimators
Next Article in Special Issue
Moran’s I for Multivariate Spatial Data
Previous Article in Journal
Spatial Durbin Model with Expansion Using Casetti’s Approach: A Case Study for Rainfall Prediction in Java Island, Indonesia
Previous Article in Special Issue
A Matrix Approach to Vertex-Degree-Based Topological Indices
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Solving Mazes: A New Approach Based on Spectral Graph Theory

by
Marta Martín-Nieto
1,2,
Damián Castaño
1,3,
Sergio Horta Muñoz
1,4 and
David Ruiz
1,5,*
1
Escuela de Ingeniería Industrial y Aeroespacial de Toledo, Universidad de Castilla-La Mancha, Av. Carlos III, Campus Fábrica de Armas, 45004 Toledo, Spain
2
CES Don Bosco, Universidad Complutense de Madrid, María Auxiliadora 9, 28040 Madrid, Spain
3
Geonum Group, Escuela de Ingeniería Industrial y Aeroespacial de Toledo, Universidad de Castilla-La Mancha, Av. Carlos III, Campus Fábrica de Armas, 45004 Toledo, Spain
4
Instituto de Investigación Aplicada a la Industria Aeronáutica, Escuela de Ingeniería Industrial y Aeroespacial de Toledo, Universidad de Castilla-La Mancha, Av. Carlos III, Campus Fábrica de Armas, 45004 Toledo, Spain
5
OMEVA Research Group, Escuela de Ingeniería Industrial y Aeroespacial de Toledo, Universidad de Castilla-La Mancha, Av. Carlos III, Campus Fábrica de Armas, 45004 Toledo, Spain
*
Author to whom correspondence should be addressed.
Mathematics 2024, 12(15), 2305; https://doi.org/10.3390/math12152305
Submission received: 21 May 2024 / Revised: 9 July 2024 / Accepted: 22 July 2024 / Published: 23 July 2024
(This article belongs to the Special Issue Graph Theory and Applications, 2nd Edition)

Abstract

:
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.

1. Introduction

A maze is a network of paths, typically designed as a puzzle or game, where the solution consists of reaching the destination point from the starting point, following the shortest route [1]. Techniques for solving mazes has been developed in scientific literature due to their versatile applications across diverse domains in real-world problems, such as autonomous navigation [2,3] or search and rescue using drones [4]. Efficient maze-solving skills have wide-ranging implications for problem solving, not only in physical environments but also in virtual ones. This can be analogized to the task of finding routes with weighted constraints, for instance, in logistics, optimization of road networks, or energetic issues [2,5].
In recent decades, advancements in graph theory and discrete mathematics have enabled the solution of labyrinths and mazes of different complexities and structures. A graph is basically a set of nodes, some (or possibly all) of which are connected by edges, also called links or lines. The way to proceed is to map the maze with nodes which have assigned a numerical value. Pathways are numerically represented as 1, whereas walls are denoted by 0. This leads to the maze being understood as a black and white design. The shortest path is understood as the one that uses fewer black squares. The concept involves converting the matrix of zeros and ones into an undirected simple graph [6], where an edge of weight 1 will connect nodes i and j if the value at position ( i , j ) of the matrix is 1.
Spectral theory of graphs studies its properties in relation to the eigenvalues or eigenvectors of matrices associated with them [6]. For instance, a graph is connected if there is a path linking any two of its vertices. In graph theory, there is a well-known result linking connectivity to an invariant within one of the matrices associated with a graph: the Laplacian matrix. M. Fiedler [7,8] showed that the multiplicity of zero eigenvalue of the Laplacian matrix is equal to the number of connected components in the graph. Then, a graph will be connected if and only if the second smallest Laplacian eigenvalue is positive. Based on this theory, the work of Steinenberger [9] proposes an algorithm for discovering one of the shortest paths in a simple, connected graph.
Previous works have already demonstrated the capabilities to solve shortest path problems through topology optimization. Works [10,11] employ a quite similar approach to find the optimal trajectory of the movement of a robot in the presence of different obstacles. Both works take advantage of the analogy between this trajectory problem and a heat transfer one, whereby manipulating the conductivity of materials—using insulators for obstacles and thermal conductors for free paths—the route with minimal thermal compliance between a heat source and a sink is found. Both articles also use mazes as benchmark examples for the developed methodologies. Other physics branches also offer solutions to shortest path problems, with many scholarly works focusing on fluid dynamics [12,13].
Some authors have showed interest in maximizing the weighted algebraic connectivity in different communications networks [14,15,16]. Several studies have focused on the constraints of algebraic connectivity in relation to other graph properties [17]. The Laplacian matrix and its associated eigenvalue (or Fiedler eigenvalue) have generated interest among several authors for it many applications, particularly in the partitioning of meshes for parallel computing [18,19].
The aim of this work is to propose a new method to find the shortest path inside a maze. This builds on prior research which integrates spectral graph theory and topological optimization [20,21], demonstrating the potential to manipulate physical connectivity in structural components.
The optimization problem is formulated in terms of a topology optimization problem. The maze is mapped with finite elements and a constraint is imposed over the connectivity between the input and the output through the eigenvalues of the Laplacian matrix of the graph. The minimum number of elements needed is determined when the shortest route that connects both ends of the maze is found.
The manuscript is organized as follows: in Section 2, concepts about algebraic connectivity of graphs are discussed. Section 3 relates graphs to mazes, detailing and solving the topological optimization problem. Numerical verification with different sizes of the maze and numbers of cells are shown in Section 4. Finally, the conclusions are summarized in Section 5.

2. Algebraic Connectivity of Graphs

Graph theory is a branch of mathematics concerned with networks of points connected by lines, also called nodes and edges, respectively [6]. The classical definition of a graph is a mathematical structure used to model pairwise relations between components. Graph theory provides a framework for analyzing and solving problems related with different applications: computer science, social systems, biological systems, etc.
There are many types of graphs, which allow for the creation of really complex structures able to model the applications commented in the previous paragraphs. This work is focused in graphs without loops and multiple lines, and undirected. The latter means that the connection between two nodes have no orientation. An example of an undirected graph is shown in Figure 1 (left). A numerical value, called weight, can be assigned to each link. This parameter may represent the distance between both nodes, the cost, the capacity of the line, or any variable depending of the edge. An example of a weighted graph is depicted in Figure 1 (right).
From a graph, several matrices can be obtained that provide useful information about its structure and properties. From now on, bold will be used to represent vectors and matrices. The most intuitive matrix is the adjacency matrix A , which stores the weighted (or not) connection between nodes. For the graph presented in Figure 1 (right), a number is assigned to each node (1 for a, 2 for b, …) to relate the rows and the columns. The adjacency matrix A is defined as:
A = 0 w a b 0 w a d 0 w a b 0 w b c 0 w b e 0 w b c 0 0 0 w a d 0 0 0 0 0 w b e 0 0 0 .
The next one is the degree matrix D . It stores in the diagonal the connections of each edge. D for the graph presented before is defined as follows:
D = w a b + w a d 0 0 0 0 0 w a b + w b c + w b e 0 0 0 0 0 w b c 0 0 0 0 0 w a d 0 0 0 0 0 w b e .
The last matrix used in this work is the Laplacian matrix L . This matrix is specially important in spectral graph theory. The eigenvalues of this matrix provide information about the global connectivity of the graph. L is computed as the difference between D and A :
L = D A = w a b + w a d w a b 0 w a d 0 w a b w a b + w b c + w b e w b c 0 w b e 0 w b c w b c 0 0 w a d 0 0 w a d 0 0 w b e 0 0 w b e ·
A graph is considered to be connected when a path can be found between any two of its nodes. There exists a classical result of spectral graph theory [6] that relates an invariant of the Laplacian matrix with its own connectivity. This result is presented in [7,8] for nonweighted and weighted graphs, respectively. The number of zero eigenvalues of L indicates how many disconnected parts exist in the graph. This means that for a connected graph, the second smallest eigenvalue of L (the Fiedler’s eigenvalue) is positive and this is called the algebraic connectivity of the graph. The introduction of this invariant as a constraint in an optimization problem is the main point of this work.

3. Discretization of the Maze and Problem Formulation

The idea of finding the shortest path using graph theory has been studied widely in the literature [1,2,22,23,24]. Most of the proposed methods have an heuristic nature. The novelty of this paper is the use of the spectral properties of the Laplacian matrix L of the graph associated to the maze to achieve the goal of finding the optimal route.
The idea has been implemented with good results within a mechanical [20] and electrode design [21] context.
The first step is the discretization of the maze, since the graph can be considered a discrete structure. The walls and the pathways are divided into square elements, as shown in Figure 2.
A maze is solved when there exists a path between the entrance (cyan color) and the exit (magenta color). For this simple case, the solution is shown in Figure 3 (left). The different squares that form this route can be considered as a connected graph as represented in Figure 3 (right).
The Laplacian matrix of this graph ( L M 10 × 10 ) is computed with Equation (1). The squares are ordered alphabetically: the first row and column are related with the square A, the second pair with B, and so on, for all the nodes:
L = 1 1 0 0 1 2 1 0 0 1 2 0 0 0 0 0 1 .
The two first eigenvalues of L are λ 1 = 0 and λ 2 = 0.1 , meaning that the graph is made up of a single joined element. All the weights w i j are set to 1. The example shown in Figure 2 and Figure 3 highlights that if the maze is understood as a graph, Fiedler’s eigenvalue of the solution is positive.
Once the solution is found, it can be interpreted as a connected graph whose Laplacian matrix has the second eigenvalue positive. The point here is how to obtain the path from all the possibilities when the maze is not solved. A new example is presented in Figure 4 discretized with a mesh of 11 × 11 elements. The entrance and exit are cyan and magenta, respectively, and the adjacent squares to both of them are orange.
A new variable φ { 0 , 1 } is assigned to each square, representing whether this node belongs to the path ( φ i = 1 ) or not ( φ i = 0 ). The nodes are numbered by columns (including the walls), from left to right, and then φ 2 = 1 and φ 120 = 1 . Wall squares cannot be included in the solution path. Naming S the set of nodes fixed as walls, it implies φ | S = 0 .
In order to determine if two adjacent nodes belong to the path, the weight of the link between both of them can be defined as
w i j = φ i φ j ,
an expression that measures connectivity between squares. The idea of the method is to determine the set of squares P that connects the entrance with the exit of the maze.
A trivial solution can be found by fixing the variable to φ i = 1 in all the elements. The way to find the optimal path is through an optimization problem, where the amount of squares with φ i = 1 is minimized (the shortest path), while λ 2 is positive (a unique connected path). The problem can be formulated as follows [20,21]:
min φ { 0 , 1 } : 1 T φ s . t . : ( L ( φ ) λ k M ( φ ) ) Φ k = 0 , k = 1 , , m ( auxiliary eigenproblem ) Φ k T M ( φ ) Φ k = 1 ( M orthonormalization ) λ 2 > 0 ( connectivity constraint ) ,
where 1 T is a vector of ones and L and M stand, respectively, for the Laplacian matrix and global (lumped) mass matrix that stores in its diagonal the value of the design variable φ . λ k and Φ k are the eigenvalues and the associated eigenvectors, respectively, of the eigenproblem proposed: ( L ( φ ) λ k M ( φ ) ) Φ k = 0 . The number of eigenvalues computed, m, needs to be large enough due to the algebraic multiplicity of the second eigenvalue. It is important to remark that for this example, the L and M M 121 × 121 . This is because both matrices include all the elements in which the maze has been discretized, including the walls, unlike the previous case.
The initial optimization problem is formulated in terms of the integer variable φ . With the aim of writing Equation (2) within the framework of the topology optimization method [25], φ { 0 , 1 } is relaxed into the density variable ρ [ 0 , 1 ] . The conic filter [26,27,28] with the Heaviside projection [29,30] is used to avoid the appearance of gray areas, resulting in the next formulation of the problem:
min ρ [ 0 , 1 ] : 1 T ρ ¯ s . t . : ( L ( ρ ¯ ) λ k M ( ρ ¯ ) ) Φ k = 0 , k = 1 , , m ( auxiliary eigenproblem ) Φ k T M ( ρ ¯ ) Φ k = 1 ( M orthonormalization ) λ 2 > 0 ( connectivity constraint ) ,
where the projected density ρ ¯ is computed as follows:
ρ ¯ e = tanh ( β η ) + tanh ( β ( ρ ˜ e η ) ) tanh ( β η ) + tanh ( β ( 1 η ) ,
where the parameters β and η define the sharpness and the threshold of the projection. The filtered density ρ ˜ is obtained from the initial variable ρ :
ρ ˜ e = i n e d e ( x i ) ρ i i n e d e ( x i ) .
The weighting function d is given by the cone-shape function:
d e ( x i ) = max { R f x i x e , 0 } ,
where R f is the filter radius and x i is the centroid of each finite element. The filtered density ρ ˜ takes the value of the weighted average of ρ in the neighborhood defined by the filter radius. The Figure 5 shows a representation of the density filter, in such a way that only the elements whose centroid are within the circle of radius R f are considered.
The filtering technique together with the projection approach ensure mesh independence [25] and 0-1 designs [29]. During the optimization process, intermediate densities may appear. The next interpolation scheme is used for computing the weights of the Laplacian matrix:
w i j = ( ρ i ρ j ) p + w m i n ,
where p is the penalization exponent and w m i n is the minimum value of the weight, imposed to avoid singularities. Note that the difference with Equation (3) is the use of the power law. When the variable only takes two values, the weight clearly indicates if both nodes are linked or not. This connection is not clear for intermediate densities, and then, with a value of p = 6 , only squares with ρ close to 1 are considered to be connected.
The optimization problem is solved by using the method of moving asymptotes (MMA) [31]. This algorithm needs the objective function values and the constraints, and the derivatives of both of them. The differentiation of the problem is straightforward, and it has not been included here for the sake of brevity. The interested reader is referred to [32,33].
A summary of the process is shown in Table 1.

4. Examples of Mazes

This section is devoted to the resolution of several mazes with different meshes and configurations.

4.1. Coarse Mesh with Single Solution

For the first example, a maze with only one solution is generated with [34]. The maze is discretized with a regular mesh of 21 × 21 square elements as shown in Figure 6. The cyan and magenta lines represent the entrance and the exit, respectively, whose squares are painted in orange. They are introduced in the problem as passive areas with ρ i = 1 .
The parameters of the filter and the projection are set to R f = 1.1 elements, η = 0.5 and β = 2 at the beginning of the iterative process (it doubles its value each 50 iterations up to β m a x = 16 ). The maximum number of iterations is 1000. The minimum weight of the connections of the graph is w m i n = 10 5 . The walls are introduced in the optimization problem as passive areas with ρ i = 0 . This means that a path cannot go through the wall, because the squares cannot be connected. For this first maze, the solution is presented in Figure 7.
This maze has only one path that connects, in an efficient way, the entrance and the exit, and this is the solution obtained. The second eigenvalue of the problem is close to 0, but positive: λ 2 = 0.05 . The value of the objective function is not interesting in this problem, but it can be computed as the number of orange squares.
The evolution of the objective function is shown in Figure 8.

4.2. Fine Mesh with Single Solution

The same maze is proposed for the second example. In this case, the domain is discretized with a mesh of 105 × 105 square elements. The main difference with the previous example is that the width of every path and wall is more than one element, as shown in Figure 9.
Only the filter radius changes for this example, which is set to R f = 5.6 elements, the rest of the parameters remain constants. The solution for this case study is depicted in Figure 10, where the color orange symbolizes the optimal path.
It is interesting to remark that, in this case, the path is narrower than the corridors. Every time the solution turns a corner, it takes the inside part of the turn, since the length of the path is being minimized. This parameter, the width of the optimal route, can be partially controlled with the conic filter and the projection. For a total control of the minimum length scale, the robust approach presented in [30] can be implemented.

4.3. Fine Mesh with Various Solutions

The previous examples show the solution of a maze when only one path can connect the entrance with the exit. For the following example, a maze with more than one solution is proposed. In Figure 11 (left) is presented the new example, and two possible solutions are painted with the orange line in Figure 11 (right). It is important to remark that when moving in a straight line, both paths have the same length. It is easy to find more solutions with a longer connection.
Keeping all parameters constant, including the mesh, the optimal solution is plotted with orange in Figure 12.
Even when both paths seem to have the same length, the one that has more corners is shorter. The optimal path obtained has 14 corners, while the other shown in Figure 11 (right) has only 10. This is due to the objective function, that minimizes the number of orange squares that link the entrance with the exit. Just as happened in the other examples, the second eigenvalue of the problem is positive.

4.4. Forcing the Path

In this case study, the same maze is solved again, but forcing the solution through a new point. The new conditions for the maze are shown in Figure 13 (left), where the optimal path is forced to pass through a point that was not included in the shortest path. The solution is represented in Figure 13 (right).

4.5. Three-Dimensional Maze with Single Solution

For this example, we have created a 3D maze by using a hypermatrix. The maze is discretized with a regular mesh of 14 × 14 × 14 elements, as shown in Figure 14 (left). The cyan and magenta squares denote the entrance and the exit, respectively. This maze has a single path that efficiently connects the entrance and exit, and this is the obtained solution. The optimal solution is plotted in orange in Figure 14 (right).

5. Conclusions

In this work, the resolution of a maze is proposed from a mathematical point of view that involves the use of spectral graph theory. The strategy used consists of studying the connectivity between the entrance and the exit. The second eigenvalue of the Laplacian matrix of the graph is imposed to be positive, while the length of the path is minimized. Several examples with different meshes thoroughly corroborates the results. Furthermore, this method also allows for an optimal solution (the shortest way) to be found, even when multiple paths linking the entrance with the exit are present. An extension of the approach is also presented, where the optimal path is forced to pass through one point.
The results are shown qualitatively since the value of the objective function is not representative of the optimal path. Regarding the constraint, it is enough that the second eigenvalue is positive. This work can be extended to labyrinths, a particular case of a maze, without loss of generality.
The objective function has been defined as the sum of the design variables, but it can be adapted to problems of different nature. The increase in computing time is justified by the flexibility of the algorithm. With this approach, the connectivity of the graph and the objective function are completely independent, allowing to model problems of different nature. In addition, this approach may include as design parameter the width of the path, which can be useful to design trajectories. The approach is focused in the two-dimensional and three-dimensional cases.

Author Contributions

Conceptualization, D.R.; methodology, M.M.-N., D.C., S.H.M. and D.R.; software, D.C. and S.H.M.; validation, M.M.-N., D.C. and S.H.M.; formal analysis, D.C. and D.R.; investigation, M.M.-N., D.C., S.H.M. and D.R.; resources, D.R., M.M.-N. and D.C.; data curation, D.R. and D.C.; writing—original draft preparation, M.M.-N., D.C., S.H.M. and D.R.; writing—review and editing, M.M.-N., D.C., S.H.M. and D.R.; visualization, D.C., S.H.M. and D.R.; supervision, M.M.-N., D.C., S.H.M. and D.R.; project administration, M.M.-N., D.C., S.H.M. and D.R.; funding acquisition, D.C., S.H.M. and D.R. All authors have read and agreed to the published version of the manuscript.

Funding

This publication is part of the grant PID2020-116207GB-I00, the grant PID2019-109652GB-I00 and the grant PID2022-137387OB-I00 funded by MICIU/AEI/10.13039/501100011033 and “ERDF UE A way of making Europe”, and 2023-GRIN-34320 provided by the University of Castilla-La Mancha.

Data Availability Statement

Data will be made available on request to the corresponding author.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Kumar, N.; Kaur, S. A Review of Various Maze Solving Algorithms Based on Graph Theory. Int. J. Sci. Res. Dev. 2019, 6, 431–434. [Google Scholar]
  2. Avila-Sánchez, L.A.; Sánchez-López, C.; Ochoa-Montiel, R.; Montalvo-Galicia, F.; Sánchez-Gaspariano, L.A.; Hernández-Mejía, C.; González-Hernández, H.G. Maze Solving Mobile Robot Based on Image Processing and Graph Theory. Technologies 2023, 11, 171. [Google Scholar] [CrossRef]
  3. Aqel, M.O.A.; Issa, A.; Khdair, M.; ElHabbash, M.; AbuBaker, M.; Massoud, M. Intelligent Maze Solving Robot Based on Image Processing and Graph Theory Algorithms. In Proceedings of the 2017 International Conference on Promising Electronic Technologies (ICPET), Deir El-Balah, Palestine, 16 November 2017; pp. 48–53. [Google Scholar] [CrossRef]
  4. Husain, Z.; Al Zaabi, A.; Hildmann, H.; Saffre, F.; Ruta, D.; Isakovic, A.F. Search and Rescue in a Maze-like Environment with Ant and Dijkstra Algorithms. Drones 2022, 6, 273. [Google Scholar] [CrossRef]
  5. Sakai, O.; Karasaki, T.; Ito, T.; Murakami, T.; Tanaka, M.; Kambara, M.; Hirayama, S. Maze-solving in a plasma system based on functional analogies to reinforcement-learning model. PLoS ONE 2024, 19, e0300842. [Google Scholar] [CrossRef]
  6. Chung, F.R.K. Spectral Graph Theory; American Mathematical Society: Providence, RI, USA, 1997. [Google Scholar]
  7. Fiedler, M. Algebraic connectivity of graphs. Czechoslov. Math. J. 1973, 23, 298–305. [Google Scholar] [CrossRef]
  8. Fiedler, M. Laplacian of graphs and algebraic connectivity. Banach Cent. Publ. 1989, 25, 57–70. [Google Scholar] [CrossRef]
  9. Steinerberger, S. A spectral approach to the shortest path problem. Linear Algebra Appl. 2021, 620, 182–200. [Google Scholar] [CrossRef]
  10. Ryu, J.C.; Park, F.C.; Kim, Y.Y. Mobile robot path planning algorithm by equivalent conduction heat flow topology optimization. Struct. Multidiscip. Optim. 2012, 45, 703–715. [Google Scholar] [CrossRef]
  11. Li, B.; Liu, H.; Su, W. Topology optimization techniques for mobile robot path planning. Appl. Soft Comput. 2019, 78, 528–544. [Google Scholar] [CrossRef]
  12. Venkata, P.P.K.; Bose, S.K.; Sarode, D.M.; Shete, P.P.; Apte, A.; Shaik, K. Automated maze solving using fluid mechanics based numerical approach. In Proceedings of the 2011 International Conference on Image Information Processing, Waknaghat, India, 3–5 November 2011; pp. 1–6. [Google Scholar] [CrossRef]
  13. Ivorra, B. Application of the Laminar Navier–Stokes Equations for Solving 2D and 3D Pathfinding Problems with Static and Dynamic Spatial Constraints: Implementation and Validation in Comsol Multiphysics. J. Sci. Comput. 2018, 74, 1163–1187. [Google Scholar] [CrossRef]
  14. Zhang, H. Political connections and antidumping investigations: Evidence from China. China Econ. Rev. 2018, 50, 34–41. [Google Scholar] [CrossRef]
  15. Zheng, Y.; Zhao, S.; Liu, Y.; Li, Y.; Tan, Q.; Xin, N. Weighted Algebraic Connectivity Maximization for Optical Satellite Networks. IEEE Access 2017, 5, 6885–6893. [Google Scholar] [CrossRef]
  16. Nagarajan, H.; Rathinam, S.; Darbha, S.; Rajagopal, K.R. Synthesizing robust communication networks for UAVs. In Proceedings of the 2012 American Control Conference (ACC), Montreal, QC, Canada, 27–29 June 2012; pp. 3730–3735. [Google Scholar] [CrossRef]
  17. de Abreu, N.M.M. Old and new results on algebraic connectivity of graphs. Linear Algebra Appl. 2007, 423, 53–73. [Google Scholar] [CrossRef]
  18. Simon, H. Partitioning of unstructured problems for parallel processing. Comput. Syst. Eng. 1991, 2, 135–148. [Google Scholar] [CrossRef]
  19. Spielman, D.; Teng, S.H. Spectral partitioning works: Planar graphs and finite element meshes. Linear Algebra Appl. 2007, 421, 284–305. [Google Scholar] [CrossRef]
  20. Donoso, A.; Aranda, E.; Ruiz, D. A new approach based on spectral graph theory to avoiding enclosed holes in topology optimization. Comput. Methods Appl. Mech. Eng. 2022, 393, 114769. [Google Scholar] [CrossRef]
  21. Donoso, A.; Aranda, E.; Ruiz, D. A new method for designing piezo transducers with connected two-phase electrode. Comput. Struct. 2023, 275, 106936. [Google Scholar] [CrossRef]
  22. Dijkstra, E.W. A note on two problems in connexion with graphs. Numer. Math. 1959, 1, 269–271. [Google Scholar] [CrossRef]
  23. Sadik, A.M.; Dhali, M.A.; Farid, H.M.; Rashid, T.U.; Syeed, A. A Comprehensive and Comparative Study of Maze-Solving Techniques by Implementing Graph Theory. In Proceedings of the 2010 International Conference on Artificial Intelligence and Computational Intelligence, Sanya, China, 23–24 October 2010; Volume 1, pp. 52–56. [Google Scholar] [CrossRef]
  24. Murata, Y.; Mitani, Y. A Fast and Shorter Path Finding Method for Maze Images by Image Processing Techniques and Graph Theory. J. Image Graph. 2014, 2, 89–93. [Google Scholar] [CrossRef]
  25. Bendsøe, M.P.; Sigmund, O. Topology Optimization: Theory, Methods and Applications, 2nd ed.; Springer: Berlin/Heidelberg, Germany, 2003. [Google Scholar]
  26. Bourdin, B. Filters in topology optimization. Int. J. Numer. Methods Eng. 2001, 50, 2143–2158. [Google Scholar] [CrossRef]
  27. Sigmund, O. Morphology-based black and white filters for topology optimization. Struct. Multidiscip. Optim. 2007, 33, 401–424. [Google Scholar] [CrossRef]
  28. Lazarov, B.S.; Sigmund, O. Filters in topology optimization based on Helmholtz-type differential equations. Int. J. Numer. Methods Eng. 2011, 86, 765–781. [Google Scholar] [CrossRef]
  29. Guest, J.K.; Prévost, J.H.; Belytschko, T. Achieving minimum length scale in topology optimization using nodal design variables and projection functions. Int. J. Numer. Methods Eng. 2004, 61, 238–254. [Google Scholar] [CrossRef]
  30. Wang, F.; Lazarov, B.S.; Sigmund, O. On projection methods, convergence and robust formulations in topology optimization. Struct. Multidiscip. Optim. 2011, 43, 767–784. [Google Scholar] [CrossRef]
  31. Svanberg, K. The method of moving asymptotes-a new method for structural optimization. Int. J. Numer. Methods Eng. 1987, 24, 359–373. [Google Scholar] [CrossRef]
  32. Dailey, R.L. Eigenvector derivatives with repeated eigenvalues. AIAA J. 1989, 27, 486–491. [Google Scholar] [CrossRef]
  33. Lee, I.W.; Jung, G.H.; Lee, J.W. Numerical method for sensitivity analysis of eigensystems with non-repeated and repeated eigenvalues. J. Sound Vib. 1996, 195, 17–32. [Google Scholar] [CrossRef]
  34. Meijer, K. Maze Generator. Available online: https://keesiemeijer.github.io/maze-generator/ (accessed on 6 May 2024).
Figure 1. Example of a simple graph (left) and a simple weighted graph (right).
Figure 1. Example of a simple graph (left) and a simple weighted graph (right).
Mathematics 12 02305 g001
Figure 2. Discretization of a maze.
Figure 2. Discretization of a maze.
Mathematics 12 02305 g002
Figure 3. Solution of the maze (left) and graph of the solution path (right).
Figure 3. Solution of the maze (left) and graph of the solution path (right).
Mathematics 12 02305 g003
Figure 4. Discretized unsolved maze.
Figure 4. Discretized unsolved maze.
Mathematics 12 02305 g004
Figure 5. Density filter.
Figure 5. Density filter.
Mathematics 12 02305 g005
Figure 6. The maze (left) and the mesh discretization (right).
Figure 6. The maze (left) and the mesh discretization (right).
Mathematics 12 02305 g006
Figure 7. Solution of the first maze.
Figure 7. Solution of the first maze.
Mathematics 12 02305 g007
Figure 8. Convergence history.
Figure 8. Convergence history.
Mathematics 12 02305 g008
Figure 9. Fine discretization of the maze.
Figure 9. Fine discretization of the maze.
Mathematics 12 02305 g009
Figure 10. Solution of the first maze discretized with a fine mesh.
Figure 10. Solution of the first maze discretized with a fine mesh.
Mathematics 12 02305 g010
Figure 11. Maze proposed (left) and two admissible solutions (right).
Figure 11. Maze proposed (left) and two admissible solutions (right).
Mathematics 12 02305 g011
Figure 12. Solution to the second maze.
Figure 12. Solution to the second maze.
Mathematics 12 02305 g012
Figure 13. Configuration of the maze (left) and optimal solution (right).
Figure 13. Configuration of the maze (left) and optimal solution (right).
Mathematics 12 02305 g013
Figure 14. Three-dimensional maze proposed (left) and optimal solution (right).
Figure 14. Three-dimensional maze proposed (left) and optimal solution (right).
Mathematics 12 02305 g014
Table 1. Algorithm and computational implementation.
Table 1. Algorithm and computational implementation.
Mathematics 12 02305 i001
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Martín-Nieto, M.; Castaño, D.; Horta Muñoz, S.; Ruiz, D. Solving Mazes: A New Approach Based on Spectral Graph Theory. Mathematics 2024, 12, 2305. https://doi.org/10.3390/math12152305

AMA Style

Martín-Nieto M, Castaño D, Horta Muñoz S, Ruiz D. Solving Mazes: A New Approach Based on Spectral Graph Theory. Mathematics. 2024; 12(15):2305. https://doi.org/10.3390/math12152305

Chicago/Turabian Style

Martín-Nieto, Marta, Damián Castaño, Sergio Horta Muñoz, and David Ruiz. 2024. "Solving Mazes: A New Approach Based on Spectral Graph Theory" Mathematics 12, no. 15: 2305. https://doi.org/10.3390/math12152305

APA Style

Martín-Nieto, M., Castaño, D., Horta Muñoz, S., & Ruiz, D. (2024). Solving Mazes: A New Approach Based on Spectral Graph Theory. Mathematics, 12(15), 2305. https://doi.org/10.3390/math12152305

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop