Revisiting the Mars Surveyor Challenge Andrew Stubblebine, Student Researcher, College of Engineering of Applied Sciences, University of Cincinnati Tejas Deshpande, Student Researcher, College of Engineering and Applied Sciences, University of Cincinnati Elad Kivelevitch, Assistant Professor, College of Engineering and Applied Sciences, University of Cincinnati ABSTRACT The Mars Surveyor Challenge was introduced by MathWorks as a way to challenge the community of algorithm developers by asking them to come up with a solution to explore a set of given maps using five vehicles, called rovers. The challenge at hand is to find an optimal strategy using MATLAB to explore as much of a map as possible in a limited number of instructions, or ‘moves.’ This strategy can be used in designing search algorithms for UAV’s or other surveillance vehicles in order to perform searches more efficiently. INTRODUCTION In 1999, MathWorks, the company that develops MATLAB, created a competition for their algorithm developer community called the Mars Surveyor Challenge (MSC) [1]. The challenge was to develop the most efficient and effective solution that will guide a team of rovers to explore a set of given maps in a limited number of steps. The efficiency of the solution was defined by the time required to calculate the solution and efficacy was defined as the percentage of map that was covered by the rovers’ motion. The winning solution was a hard-coded solution [3], meaning that for each map there was a single set of predefined instructions. As a result, this solution was completely tailored to the maps given by MathWorks, but completely breaks down when required to work with different maps, different rover group sizes, or different map sizes. The competition began and opened for submissions of the solution in early June, 1999. It was a collaborative competition, meaning that every solution submitted up until certain checkpoints, were visible to all participants. This means that they could build upon previously submitted solutions. The competition ended in July with over 1000 solutions submitted. The top solutions were all hardcoded solutions that were obviously built on the same basic code structure. Some of the winning solutions can be seen in Table 1 below. The contest lasted over 6 weeks and had hundreds of people working towards a solution. In this work, we revisit the MSC, but we add the possibility of new, randomly generated maps, as well as maps of any size, any number of steps, and any number of rovers. Newly developed algorithms should perform nearly as well as the existing algorithms that were tailored to a given set of sample maps. The new algorithms should outperform existing algorithms on randomly generated maps. It should be scalable to any number of rovers, any size map, and any distribution of obstacles. In order to further analyze the performance of the chosen algorithms, four additional maps were designed and added to the original eight. These four maps use different distributions of obstacles from the original eight to increase to variability of the distribution and the versatility of the solution. The additional maps are denoted as maps 9-12 and are included in a separate table directly below the first (Table 2). Motivation In the last few years, the number of uses for autonomous vehicles has increased drastically. One of the main uses of autonomous vehicles is searching an area that is either unknown or can be covered faster by a vehicle. Sometimes, one vehicle is not enough to cover the area or will not do the job fast enough. That is why an important research topic is cooperative wide-area search. This uses multiple vehicles to cooperatively search an area faster than a single vehicle could. The most important aspect of this topic is how the vehicles perform together, ensuring that they not only just cover the area, but they do it with high efficiency. The purpose of this research is to explore different alternatives to the current methods of cooperative search algorithms. Application of this research to real life cooperative UAV search methods would greatly increase the efficiency for search. In addition, the solutions provided by this research take into consideration obstacle avoidance methods. The obstacles simulated in this research have many different distributions; they take into account random distribution of obstacles as well as designed placement of obstacles. Using both of these techniques for obstacle distribution will ensure the algorithm solutions will perform well for any type of distribution of obstacles. Literature Survey Many current methods for cooperative UAV search already exist. These methods are typically implemented for specific goals or tasks. Two popular methods discovered were a method known as flocking, as demonstrated by Crowther and Riviere [2], and sweeping, put forward by Vincent and Rubin [4]. Flocking is a bio-inspired behavioral model that uses a rule-based logic system to guide a group of rovers through maneuvers. There are five basic rules for deciding how the vehicles flock together: cohesion, alignment, separation, evasion, and migration. Most of these maneuvers relate to the combined center of mass of the flock of rovers or UAVs. The first rule, cohesion, uses a certain area around each rover to maintain relatively close proximity by aligning the vehicles towards a local mass center. Alignment keeps the velocity vectors of each rover pointed approximately in the direction of the average velocity vector. Separation ensures that the vehicles are not running into each other and keep a safe distance from each other and the center of mass of the rover grouping. Evasion makes sure the rovers can maneuver around obstacles. Finally, Migration sets a waypoint for the vehicles’ center of mass to which they will flock together. Logic based solutions are typically easily scalable, which is one of the goals of this research. This method would work well for most maps. The main problem with flocking, however, is that it would not be ideal for all maps, specifically a map with small, organized rows as shown in Figure 1. If flocking were to be implemented on this map, the rovers would attempt to go through the corridors between the walls. Even with the current number of five rovers, this presents a problem. There are five rovers and four spaces between the walls which means there will be one rover that is essentially useless. Anytime a rover is not in use decreases the efficiency of the solution and in this case there will always be at least one not in use. Moreover, for each rover that is added beyond five, the efficiency of the solution will drastically decrease. Figure 1: Map 7 Layout Sweeping is a tactic that uses similar concepts from flocking, such as cohesion and migration, but in a very structured manner. A depiction of their action can be seen below in Figure 2. The search vehicles will have the best efficiency using this method if they start in a corner of the map. The rovers move horizontally until they reach the boundary of the designed map area before turning to go down, then back the direction they came, but in a different plane. This maneuver is much more orderly than the flocking technique, which is not necessarily a good thing. This may force the vehicles to behave in a way that may not be most efficient by forcing too many rovers into a small location or if there are too many obstacles in a small section. In order for the vehicles to continue efficiently, they would have to break their formation. Figure 2 - Sweeping Motion Another approach explored was the use of Genetic Algorithms to reach an optimum solution. Genetic algorithms imitate nature in the form of natural selection and evolution to reach an optimum solution to the given problem. Each solution is encoded as a chromosome and a very large random population is generated at the beginning. This large population undergoes the processes of selection, crossovers and mutation over several generations or iterations and eventually we reach an optimum solution to the given problem. One advantage of Genetic Algorithms is that they are rather simple to conceptualize, but can be computationally inefficient. Algorithm Selection From investigating different methods currently used in cooperative UAV search, two methods were chosen for use in this research: a rule-based algorithm and a genetic algorithm. These two algorithms are vastly different and will provide two different approaches to the solution. The rule-based algorithm uses a bottom-up approach, looking at each individual decision as it is made by each vehicle and building the entire set of instruction one at a time. If built correctly, the rule-based approach will produce an emergent intelligent solution, akin to swarm intelligence. The genetic algorithm uses a top-down approach, taking a population of solutions and implementing different characteristics of genetic algorithms to converge on an efficient solution. This solution runs globally on the entire set of instructions, or, for computational reasons, large numbers of steps at a time. For rule-based algorithms, the two methods found during literature survey, flocking and sweeping, have their own advantages and disadvantages. Flocking is simple and easily scalable but has restrictions on its maneuverability. Sweeping is simple and methodological but has even more restrictions. The most optimal solution for cooperative vehicle search for the purpose of this research, however, would be one that implements portions of each of these methods. The current method being utilized is one that takes the idea of logical, rule-based decisions from the flocking technique and the order and starting from the outer edges from the sweeping technique. In addition to these concepts from the preexisting methods, the rovers will make their decisions independently but still communicate important information to each other. The basic structure of all Genetic Algorithms is the same. It includes an initial random population, a fitness indicator, a selection procedure, crossover procedure and a mutation procedure. The ways in which this has been implemented is explained in the next section. Specifications Rules Based Approach Four rules were selected to guide the rovers’ decision making. The first, and most significant, is to prioritize forward movement. There are four possible choices for instructions: a 1 denotes a forward movement of one cell, a 2 indicates a turn to the right, a 3 turns the rover to the left, and a 4 keeps the rover in place. Since the objective of the algorithm is to efficiently search an area, any move other than a 1 decreases the efficiency of the solution. Therefore, if the rover can move forward, it should. Second, when encountering the path of another rover, the rover should turn left or right and not continue through the path. Implementing this rule helps divide the map into sections that each rover can efficiently cover, typically moving circularly inward until the whole section is covered. An example of this is depicted in Figure 3. Each rover turns when encountering the path of another rover. Moreover, the turn made by each rover for this event creates sections for each rover, or sometimes two, that enables each rover to cover the area efficiently with minimized obstruction from other vehicles. Figure 3: Sectioning of map by each rover The third rule is to look beyond one square in all directions if a dead end is found. A dead end is an area surrounding the rover that is either full or mostly full of obstacles, or has been covered previously by another rover. Just because the closest undiscovered square is one cell away that does not mean that it is a better option than the open square 3 cells away. The undiscovered square 3 cells away may have many other undiscovered cells near it, while the closer option may have far fewer open and many more obstacles nearby. Moving to that area would further drop the efficiency of the vehicle’s path. When exploring the local areas around the rover for undiscovered spaces, the rover will start with a smaller field of vision. If it cannot make a good decision based on what it “sees,” then it must expand its field of vision until the rover can make a better decision. The fourth and final rule is to communicate dead ends and undiscovered areas to the other rovers. With this knowledge, the other rovers know that traveling towards a section with many discovered solutions would not be advantageous, while travelling towards an open area would be very advantageous. This means that if a rover passes by a field of multiple undiscovered squares, it should communicate this information to other rovers so they can potentially travel to it. Genetic Algorithm Approach Initial Population Generation: A population of 100 chromosomes is generated at startup. In order to make the execution of the code more efficient, the population is generated in for a ‘planning horizon’ of instructions. A ‘planning horizon’ is defined as a certain number of instructions that is less than the total number of instructions required for a complete solution. This ‘planning horizon based approach improves the solution fitness without drastically increasing computational time. As the script starts, an initial ‘horizon of instructions is randomly generated in the population. This population then undergoes selection and mutation for a certain number of generations. After this is completed, the best chromosome in the given population is selected, and it is chosen as the building block for the new population which will have a greater number of rover instructions. In this new population, the first ‘n’ instructions for each rover in every member of the population are fixed to the best result previously obtained by the GA. To this new population, a new planning horizon is appended. Therefore, in this new population, the initial ‘n’ instructions for each rover are identical in every member of the population, while the next horizon are randomly generated. While generating the population, certain steps are taken to ensure population diversity. The probability that the instruction 1 (i.e. go straight) will occur is initially set at the value of 0.9. The other instructions all have equal probability i.e. 0.05 each for turning left and right. However, as the first 20% of the target population is reached, the probability that the instruction 1 is selected decreases by 0.1. Consequently, the probability of turning left and right increases by 0.05 each. This is repeated every 20%. Fitness Indicator: The fitness indicator used is a modification of the survey program given by MATLAB for its competition. Instead of visualizing the solution, it just returns a number which indicates the number of squares left unexplored by the given instruction set. Selection Procedure: After running some initial tests, it was noticed that computational performance would be a rather critical factor. Based on that consideration, a simple truncation procedure is used where the top 5 members of the population are preserved and the remaining are all cleared. These cleared members of the population are then replaced by new members which are the result of crossovers between any two currently existing members selected by a random algorithm. Crossover procedure: Keeping in mind the importance of minimizing computational time, a simple two-point crossover is implemented. In this technique, a random number is selected such that it is less than the total number of instructions. Then a second random number is selected such that it is greater than the first random number but less than the total number of instructions. The instructions that occur in between these two are taken from parent two and the remaining are taken from parent one to form the child chromosome. Mutation Procedure: The procedure that is implemented chooses a random member of the chromosome. It then proceeds to identify a random instruction which it mutates with the following rule - add 1 to the number that represents the instruction. If it is represented by 3, make it 1. Based on simulations in which the algorithm is run with and without the mutation procedure, the mutation procedure resulted in reduction of as much as 200 from the not visited squares count. Results To compare the results of various algorithms in terms of their success to search a wide area, there is a need to develop a metric that is scalable to any size of map and any number of obstacles. The first step is to define how many possible grid cells require searching, this is denoted by ‘Number of Open Spaces’, which is calculated by: ππ’ππππ ππ ππππ ππππππ = [ππ’ππππ ππ π ππ€π ] × [ππ’ππππ ππ πΆπππ’πππ ] − [ππ’ππππ ππ πππ π‘πππππ ] Out of this number, the best solution is the one that missed the smallest number of spaces, which is the algorithm that won the original contest. We compare our result to that algorithm using the metric ‘solution strength’ defined by: ππππ’π‘πππ ππ‘πππππ‘β = [ππππππ πππ π ππ ππ¦ π΄ππππππ‘βπ] − [ππππππ πππ π ππ ππ¦ π΅ππ π‘ ππππ’π‘πππ] ππ’ππππ ππ ππππ ππππππ × 100 Since it is the difference between the solutions, a lower percentage is better. This equation evaluates the ability of the designed algorithm to find an efficient solution on each map. Map 1 Map 2 Map 3 Map 4 Map 5 Map 6 Map 7 Map 8 Map 1-8 Total Open Spaces 2500 1850 1972 2500 2188 1702 2227 1961 16900 Winning Solution Spaces Missed 106 0 24 239* 65 96 93 218 841 Rule-Based Algorithm Spaces Missed 250 3 462 315 120 369 435 763 2717 Rule-Based Algorithm Strength 5.76% .16% 22.21% 3.04% 2.51% 16.04% 15.36% 27.79% 11.1% Genetic Algorithm Spaces Missed 919 477 798 920 784 567 1078 811 6354 Genetic Algorithm Strength 32.52% 25.78% 39.25% 27.24% 32.86% 27.67% 44.23% 30.24% 32.62% Table 1: Solutions from each algorithm and their strength, based on the original contest solutions Map 9 Map 10 Map 11 Map 12 Map 9-12 Total Map 1-12 Total Open Spaces 2059 2306 2385 2155 8905 25805 Winning Solution Spaces Missed 1 749 439 470 1659 2500 Rule-Based Algorithm Spaces Missed 8 1362 462 502 2334 5051 Rule-Based Algorithm Strength 0.34% 26.58% 0.96% 1.48% 7.58% 9.89% Genetic Algorithm Spaces Missed 660 1589 1042 1100 4391 10745 Genetic Algorithm Strength 32.01% 36.43% 25.28% 29.23% 30.68% 31.95% Table 2: Solutions from each algorithm and their strength, for the 4 new maps and the total for all 12 maps Undiscovered Spaces Algorithm vs. Contest Solutions 1800 1600 1400 1200 1000 800 600 400 200 0 Rank #1 Soln Rank #20 Soln Rank #50 Soln Rank #100 Soln Rule-Based Soln GA - 100 1 2 3 4 5 6 7 8 9 10 11 12 GA - 300 Map # Figure 4: Number of undiscovered spaces for Genetic Algorithm compared to contest solutions and rule based algorithm To further analyze the performance of the rule-based solution, we compare it to a sample of the solutions submitted in the original contest, namely the solutions ranked #1, #20, #50, and #100. Figure 4depicts this comparison and shows that the solutions taken from the contest perform better than the designed algorithm, but as stated previously, the purpose of this research is not to outperform the solutions on these maps. The purpose is to outperform the contest solutions on new maps. Out of four maps, the rule-based algorithm is on par in three of the maps (#9, #11, #12) and does not perform as well as the other solutions on map #10. This behavior was found in the original eight maps as well, and there is a need to further investigate the reasons why the rule-based solution produces good results for some maps while it is underperforms on other maps. We suspect that the reasons have to do with its relatively local and near-sighted decisions, which may lead to some vehicles becoming stuck and inefficient. Based on the coded solution, it is apparent that given infinite computational power and time, an excellent if not perfect solution can be reached by the Genetic Algorithm. However, we have limited time and computational power and as a result, we have to set limits on the amount of computations that we will perform. The results using the GA in the table below have been obtained by running the GA on each map 20 times. Each time the GA was run, each ‘horizon’ of instructions went through 250 generations of crossovers and mutations. The results given below are the averages of the 20 runs performed. Looking at the data presented in Figure 4 one can see that the GA consistently performs almost as well as the Rule based algorithm on Map 8, which is significantly more difficult to define rules for. Further tests on Map 8 where the number of instructions in a ‘planning horizon’ was 10 and the number of generations was 250, the solutions produced left as little as 568 spaces unexplored. This however took close to 10 minutes to execute. We now compare the performance the Genetic Algorithm with different planning horizon values in Figure 5 and Figure 6. Performance of GA 1800 1600 1400 1200 1000 800 600 400 200 0 Map 1 Map 2 Map 3 Map 4 Map 5 Map 6 Map 7 Map 8 Map 9 Map 10 Map 11 Map 12 Instructions per 'horizon' : 100 Instructions per 'horizon' : 300 Figure 5: Comparison of fitness results using different ‘horizon’ values Comparison of processing times for different planning horizons 90 80 Time (sec) 70 60 50 40 30 20 10 0 Instructions per horizon : 100 Instructions per horizon : 300 Figure 6: Comparison of average time required for different ‘horizon’ sizes. Based on data collected thus far, it can be noted that reducing the number of steps in the planning horizon improves the strength of the solution, but at a significant computational cost. However, if one knows the amount of time given for the algorithm to run, it is possible to fit the planning horizon size accordingly to obtain the best results from the GA. Conclusions The MATLAB Mars Surveyor Contest was revisited and two algorithms were developed and evaluated using 8 original maps and 4 new maps. The developed algorithms represent the two ends of the spectrum of possible search algorithms: the Rule-Based Solution is a local, short-sighted, bottom-up approach, whereas the Genetic Algorithm Solution is a global, top-down and long planning horizon approach. The Rule-Based algorithm produced results that were nearly as good as the original competition solutions. As seen above, 7 out of the 12 total maps had a strength of around 5% or less, indicating that the performance of the rule-based algorithm produced results that were almost on par with the contest winners in the majority of the cases. Yet, in some maps, the rules-based algorithm underperforms significantly, possibly because of its myopic decision rules. Further investigation is required to see if there is a way to improve this performance. The GA solution is more computationally intensive. As a result, trying to maintain a reasonable execution time causes the GA to underperform in most maps, except for the hardest ones, where there is a clear need for the global and long-term decision making that the GA offers. Future Work As stated above, the competition solutions performed relatively well on the new maps, using a logic that seems to have similar characteristics of the designed, rulebased algorithm. Exploring the properties of the competition code and how it works for the new maps may uncover new rules to implement for the rule-based code. In addition, there is reason to believe that implementing fuzzy logic within the algorithm would be able to make the solution more robust and provide even better solutions, particularly by allowing a smooth combination of short term logic with longer term planning. After incorporating these new ideas into the current rule-based algorithm, it would be reasonable to expect the new algorithm to perform even closer to the existing competition winner for the original 8 maps and outperform the competition solution in the new maps. This would also produce even better results if scaled up to more than the original 5 rovers and/or larger maps. The implementation of these concepts should provide the best, universal solution and perform better than nearly any other solution of any kind. A possible approach to improve results of the GA would be to implement a computationally efficient guided mutation algorithm that will force the solution to change whenever the rover goes into obstacles and out of the map. After that, combining the rules based approach with the GA approach could be a possibility. One could run the rules based algorithm to generate possible high-quality solutions quickly, and add it to a large population of randomly generated solutions. GA could then be executed on this new population to improve the quality of the initial solution. Finally, GAs can be used to improve a fuzzy logic search algorithm, by tweaking the membership functions and the rules of the fuzzy inference system. References [1] (1999). “Mars Surveyor – Rules – A MATLAB Programming Contest.” MATLAB CENTRAL, <http://www.mathworks.com/matlabcentral/contest/contests/4/rules> (Aug. 28, 2013). [2] Crowther, W. J., and Riviere, X. (2003). “Flocking of Autonomous Unmanned Air Vehicles,” School of Engineering, University of Manchester, Manchester, United Kingdom. [3] Uribe, P. (1999). MATLAB Competition Code, <http://www.mathworks.com/matlabcentral/contest/contests/4/submissions/79 54> (Aug. 30, 2013). [4] Vincent, P. and Rubin, I. (2004). “A Framework and Analysis for Cooperative Search Using UAV Swarms,” 2004 ACM Symposium for Applied Computing, held at Nicosia, Cyprus, March 14-17. {5] "Genetic Algorithm Tutorial." Genetic Algorithm Tutorial. N.p., n.d. Web. 09 Oct. 2013. [6] Houck, Christopher R., Jeffery A. Joines, and Michael G. Kay. "A genetic algorithm for function optimization: a Matlab implementation." NCSU-IE TR95.09 (1995).