IJSRD - International Journal for Scientific Research & Development| Vol. 6, Issue 12, 2019 | ISSN (online): 2321-0613 All rights reserved by www.ijsrd.com 431 A Review of Various Maze Solving Algorithms Based on Graph Theory Navin Kumar 1 Sandeep Kaur 2 1 M. Tech Student 2 Assistant Professor 1,2 Department of Computer Science Engineering 1,2 Sri Sai College of Engineering & Technology, Manawala, India AbstractSolving a maze using computers is a complex though enticing task as one needs to come up with an algorithm that is effective in terms of time withal space for finding the shortest path. There is an ample number of graph algorithms to solve this problem, each one surpasses the other in performance aspects. This paper reviews different graph algorithms for maze solving along with their performance. The image of the maze is first processed by using GD library[1] functions in PHP[2], eventually, converting it into a graph data structure. A particular graph search algorithm is subsequently applied to find the shortest path between the start and the end node which is then mapped back to the image highlighting the solution. An “8X8” maze is used here for studying the performance of all graph based algorithms. Key words: Maze Solving, Graph Search Algorithms, Artificial Intelligence, Image Processing I. INTRODUCTION The maze solving problem is defined as finding a path from starting point to the ending point in a way that the path so found must be the shortest one. Figure 1 exhibit the solution for the given maze in the red line. The left one is the input maze image while the right one is the solution image of the maze reckoned by the computer program. The crucial thing to note here is that there exist multiple paths in this maze however the algorithm will give the one with minimum path length i.e. number of edges, therefore, discarding any other solution which is of greater path length. Fig. 1: A. Conversion from Image to the graph data structure The prime focus of this paper is to ponder on the performance of the graph algorithms hence the image of maze studied is an uncomplicated 8X8 maze where each building block is of 100x100 pixels. This will make image processing effortless as it is only needed to consider the pixel intensity of the centre of each block to indicate whether it corresponds to a path or not. This needs to be done for all 64 blocks by using the GD Library function imagecolorat ($image, $x, $y) where $x is the horizontal distance from the origin of the image, $y is the vertical distance and the $image is a reference variable for the image in the memory. The pixel intensities which are close to white will be treated as nodes of the graph while the black ones are considered as a block. The next task is to find the adjacency list of nodes for each vertex which implies the edges in the graph as formed. There are only four nodes which can be adjacent to any vertex i.e. north, south, east and west, just as indicated in figure 2. The thin green lines are edges signifying the adjacent nodes. Fig. 2: B. Discovering the solution using graph search Algorithms The image processing work consequently reduces the problem to an undirected graph for which several graph search algorithms are available nevertheless for any algorithm ensued result will fall into following three groups i.e. 1) There exist no path For this case, the algorithm will terminate after some time thereafter implying the nonexistence of any possible path. In such a situation, the whole search space will be explored, hence the time taken will supposedly be more. 2) There exist only one path Since here only one solution to the problem exists so there will not be any notion of minimum length, consequently, after exploration of the entire maze, it will map the path so found it back to the image. 3) There exist multiple paths This is a little complicated as there will be multiple solutions possible to the maze. This can be a point of concern when using an algorithm such as depth-first search because it will take one direction and go deep down until it hits a dead end or the goal node. If it gets the goal node, it will return it as a solution, undoubtedly, it will be a solution but is not guaranteed to be of the minimum length. II. LITERATURE SURVEY This section covers the study of the related work which is presently done in the area of maze solving a problem or some other domains analogous to the maze problem. M.O.A. Aqel et al. (2017) [3] has proposed the algorithm of breadth-first search to find the solution to the maze problem. It follows the approach which is quite similar to flood fill where it will expand nodes of the graph in such a fashion that it divides the node into different levels. The nodes which are at level one are queued first and are visited in a FIFO manner. This approach works great where the maze size is limited hence making the search space limited. The time taken will be proportional to the number of nodes in a graph thus with increasing maze size performance will take a downturn.