Professional Documents
Culture Documents
ABSTRACT
A maze is a tour puzzle in the form of a complex branching passage through which the solver must find a route. The paper proposed the method for solving the by by using image processing application. It take the maze as a image and converts it into am graph which can be easily solved by using any graph processing algorithm. The algorithm is implemented and tested for sever different size of mazes.
KEYWORDS
Micromouse Maze, maze solving algorithm, Graph Theory.
1. INTRODUCTION
A maze is a tour puzzle in the form of a complex branching passage through which the solver must find a route. The result is a route to the target destination of the maze. [10]. There are a several automated methods for the solving of mazes. The section 2 of the paper describes few maze solving algorithms such as the random mouse, wall follower, and Trmauxs algorithms. These algorithms are designed to be used inside the maze by a traveler with no prior knowledge of the maze, whereas the other algorithm explained such as dead-end filling, Partitioned base maze solving, shortest path algorithms are designed to be used by a person or computer program that can see the whole maze at once. [7] [9]. Standard/perfect mazes do not contain loops and are equivalent to a tree in graph theory. Thus they can be made closely related to graph theory. Intuitively, if one pulled and stretched out the paths in the maze in the proper way, the result could be made to resemble a tree. The solution given in this paper is based on graph theory.
Figure 2:- LWF: Solvable and Unsolvable maze Step 1: Sense the left wall. Step 2: If left wall present then flagl=1, if not then flagl=0. Step 3: If flagl=1 then step 4 else turn left by 90 degrees. Step 4: Sense the front wall. Step 5: If front wall present then flagf=1, if not then flagf=0. Step 6: If flagf=0, move straight else turn right by 90 degrees.
Step 7: return to step1. Figure 2 shows the output of Left Wall Follower algorithm in which first maze is perfectly finds the solution but second maze dont have proper solution. This is one of the drawbacks of this logic. The algorithm is not efficient enough to solve the mazes of high complexities and the ones which have multiple paths leading to the centre.
Figure 3:- Shortest path using Trmauxs All passages will either be empty, meaning you haven't visited it yet, marked once, meaning you've gone down it exactly once, or marked twice, meaning you've gone down it and were forced to backtrack in the opposite direction. When you finally reach the solution, paths marked exactly once will indicate a direct way back to the start as shown in the Figure 3. If the Maze has no solution, you'll find yourself back at the start with all passages marked twice. [10]
path. For a given pair of vertices s and t in V, the algorithm finds the path from s to t with lowest cost (i.e. the shortest path).So now this fundamental nature of the algorithm can be used to find the graph. The stepwise functioning of the algorithm has been described as below. [7] STEP 1: Start ready set with start node Set start distance to 0, dist[s] =0; Others to infinite: dist[i] = (for i s); Set Ready = { }. STEP 2: Select node with shortest distance from the starting point that is not in Ready set Ready = Ready + {n}. STEP 3: Compute distances to all of its neighbours For each neighbour node m of n Check if dist[n] +edge (n, m) < dist[m] If yes then dist[m] = dist[n] +edge (n, m); STEP 4: Store path predecessors. pre[m] = n; STEP 5: Add current node to ready set. STEP 6: Check if any node is left, if yes goto step 2 STEP 7: End. Now the problem arises of how to generate the directed graph G of the. So for this problem need to get the Micro-mouse traverse the whole maze and generate the nodes! So the traversal function is defined as follows. [7] Traverse ( ): STEP 1: Move straight STEP 2: Check if any wall is present in front. If yes, then goto step 3 else goto step 1. STEP 3: Check if the current location is present in V, If no then add the location in the set V, calculate the distance between the previous and the present location. Store the value in the set E, else take 180 degree turn and traverse to the Previous entry of V. STEP 4: Check if wall is present on right. If present, take a 90 degree turn left if not then take a 90 degree turn right. STEP 5: Goto step 1 Repeat steps 1 to 5 till the entire maze is traversed. Calculation of distance between two consecutive nodes is done by adding a counter circuit at the base of the chassis near the wheels so as to count the number of cells between the destination and the source location. The solution using this method is as shown in the Figure 4.
2.5.1 Drawbacks of the algorithm There are, however, problems in using this algorithm, the major one being that the whole maze has to be traversed. For identifying the nodes, it is important to travel all the parts of the maze, irrespective of whether that portion of the maze contains the shortest path or not. Now, this is time consuming and also a lot of energy is wasted in the traversal. This solution also requires a lot of time for finding the shortest path as after the generation of the connected graph G, it has to check for all the connections that lead to the destination. This increases the execution time of the algorithm.
Figure 4:- Maze as solved by Djikstras algorithm Even for smaller mazes it will have to travel all the blocks before starting to find the shortest path. This problem would be solved if we can design a way where both the maze interpretation and path finding are done simultaneously. The other problem is that for counting the number of cells to generate the edge set E, an additional hardware is involved which includes a counter circuit that counts the rotation of the wheels and hence the distance between two consecutive locations. This adds to the complexity of the design and increases the probability of error in input data from the external environment. 2.6 Partitioned Based Maze Solving Partition-central Algorithm, which is used to find the shortest path in a Micro-Mouse competition maze. A standard 16*16 units maze is divided into 12 partitions in this algorithm. Depending on the absolute direction of the Micro-Mouse and the locations of each partition, exploring rules alter when the Micro-Mouse walks to optimize the maze exploring process. The maze is divided into 12 partitions besides the 4unit square end point, the 12 partitions division is an optimized scheme after many experiments. Moving direction is totally partition base for every partition different moving algorithm will be used. The available algorithms are Left-hand algorithm, Right-hand algorithm, Central-left algorithm and Central-right algorithm. By setting the Partitioncentral algorithm, one of the four algorithms is chosen for a Micro-Mouse to explore the shortest path. When the Micro-Mouse is located in one of the 4 partitions from partition 1 to partition 4, the algorithm selection rule is similar to the Centre-trend rule. Walking rules of other partitions are shown in Figure 5. Partition-central algorithm is more central-trend than other algorithms. [9] In Figure 5, the arrows points to the possible direction when the Micro-Mouse is in this partition unit. The letter represents the available rule for choosing.
Figure 5: - Maze partition division 2.6.1 Closed Looping Path Avoidance The optimized partition-central algorithm is more flexible than other classic algorithms. However, because of the special characteristic of centraltrend, after the partition division of the maze, if there is a T crossing or a + crossroad just between two or among three different adjacent partitions is encountered, different walk determine rules in different partitions would confuse the Micro-Mouse and then cause a process of exploring the partition border area repeatedly, thus the Micro-Mouse would be led to a searching closed looping path and making it impossible to reach the end point. 2.6.2 T crossing situation
2.7 Maze solving using Image Analysis It uses a very simple set of mathematical morphology filters to find the solution to simple mazes. [11] Step 1: Reading the image with the maze: Step 2: Next we convert it to a grey-value image and threshold it to obtain a binary image. The maze walls are true and shown in red: Step 3: label the binary image; we can clearly see two discrete, separate walls
Figure 7:- Image Processing Explanation Step 4: It is fairly easy to see the path from start to finish: its the path in between the two colours. To draw this path over the image we can follow this simple sequence of commands, its all mathematical morphology. We ignore everything except the first of the two walls:
Figure 8:- Image Processing Explanation Step 5: Then we dilate the walls by a few pixels, and fill all the holes:
Step 6: Then we erode by the same amount of pixels and take the difference:
Figure 9:- Image processing Explanation Above method is best for solving random maze. This method is image analysis based method where shortest path from starting point to end point is determined, in which maze is considered as one image on which by applying some image processing operation like erosion and dilation we can calculate the shortest path from given random maze. But this method is also having some disadvantages. We can not apply it for the complex maze as shown in Figure 7, 8, and Figure 9. If we use improper size for dilation in that case we may lost the proper shortest path. It can find only one path from given maze.
Figure 10:- Maze in to graph Once we convert the maze in to graph we can apply shortest path finding algorithm as shown in to the Figure 11 and Figure 12 we will get shortest path. By using image processing application we can directly reduce the work of complex circuitry to convert maze into the directed graph
EXPERIMENTAL RESULTS
Table 1: Experimental results Maze Maze 1 Maze 2 Maze 3 Maze 4 Number of Nodes 81 225 900 2500 Time in second 0.61 sec 0.71 sec 7.24 sec 138.5 sec
CONCLUSION
Above mentioned algorithms are used for solving the Micromouse maze. Every algorithm is having different efficiency of finding optimum path as solution to the given Micromouse maze. Above algorithms such as Dead End Filling, Maze solving based on image analysis, shortest path finding algorithm, Trmaux's algorithm and Wall Follower is having some advantages and disadvantages. Some disadvantages of one method can be overcome by method given in this paper. Some of the algorithms are use for maze having single path from start to end. For multi path maze we use shortest path algorithm to find shortest path. But using this algorithm is very complex procedure we have to use extra circuitry. For such multi path maze we can use imaging application to overcome the problem of complex circuitry used for conversion of maze into graph and then apply the shortest path algorithm to find optimum path amongst several paths.
REFERENCES
[1] MicroMouse, California State University at Northridge, hm //homepaw mac com/SBenkovic/MicroMouse/indehxt ml. [2] Babak Hosseini Kazerouni, Mona Behnam Moradi and Pooya Hosseini Kazerouni;Variable Priorities in Maze-Sloving Algorithms for Robots Movement, 2003. [3] Sung-Hee Lee, Junggon Kim, F.C.Park, Munsang Km, and James E.Bobrow;Newton-Type Algorithms for Dynamics- Based Robot Movement Optimization, Digital Object Identifier, 2004. [4] Manoj Sharma, Kaizen Robotics, Algorithms for Micro-mouse, 2009 International Conference on Future Computer and Communication. [5] Zhang xenia, A Micromouse Maze Solving Algorithm. MCU and Embeded System 2007.5: 84-85. [6] University of California, Berkeley, IEEE Student Branch (2006), http://ucsee.eecs.berkeley.edu/ [7] Swati Mishra, Pankaj Bande, Maze Solving Algorithms for Micro Mouse, 2008 IEEE International Conference on Signal Image Technology and Internet Based System [8] David M. Willardson. Analysis of Micromouse Maze Solving Algorithm [R].Learning from Data, spring 2001. [9] Jianping Cai, Xuting Wan, Meimei Huo, Jianzhong Wu.An Algorithm of Micro Mouse Maze solving. 10th IEEE International Conference on Computer and Information Technology (CIT 2010),2010 [10] http://www.micromouseonline.com. [11] file:///H:/Maze%20Solver/277.htm