Visualization Tools for Real-time Search Algorithms

Search methods are common mechanisms in problem solving. In many AI applications, they are used with heuristic functions to prune the search space and improve performance. In last three decades, much effort has been directed toward research on such heuristic functions and search methods by AI community. As it is very hard to build theoretical models for heuristic functions to predict their behavior, we can often only check their performance experimentally. In practical applications, it is important to understand the search space and behavior of heuristic functions, otherwise, we cannot figure out what's going on in actual applications and cannot control them. These issues are critical, especially in the field of real-time problem solving, in which applications have time constraints and are required to finish processing within the given time interval. In this report, visualization methods are introduced as tools to understand the search spaces and behavior of heuristic functions. As examples of the usefulness of visualization methods, A* and IDA* algorithms are represented in various forms. They can be used to debug practical applications that use heuristic functions. 1 NTT Data Communications Systems, Development Section 1. Why Visualizations are Important in AI Looking back on the history of science, observation tools often played a very important role in scientific discovery. In the ages before the invention of the telescope, for example, we could not observe planets in detail. We didn't even know of the existence of planets. Telescopes made it possible to measure accurate positions of the planets, and that made it possible to find Kepler's law, Newton's laws and so forth. The same story is told in other areas of science. The microscope, X-ray, spectrum analyzer and other observation tools all contributed to the progress of science. In other words, the history of science is also the history of the engineering of observation tools. The story is the same in computer science. Today, computers are used to simulate a variety of problems in computer science; for example, computer simulations of the execution queue of an operating system. Queuing theory provides some guidance but the optimal queue length is often determined experimentally with computer simulations. In this example, computers are used as tools to study theories in computer science and they are also the target of study in computer science. When we develop theories of computer science, we also need to develop observation tools for them. Again, we cannot develop theories without observing phenomena. In computer science, especially in artificial intelligence, the development of observation tools seems not to have been very focused. This paper describes a collection of visualization tools for search algorithms, because search algorithms are very common. To apply search mechanisms for problem solving, the problem space must be defined as a set of states, including an initial state and goal states, and a set of operators to move from one state to the other states. A solution corresponds to a series of operations moving from the initial state to a goal state. We can analyze search algorithms theoretically or empirically. Theoretical analyses are sometimes better than experimental ones, because we don't need to collect data, and because the results are often more general. However, we usually need to rely on heuristic functions to solve big and complex problems in realistic time. Heuristic functions make analysis harder as they often don't have theoretical underpinning. In the case of chess, for example, thousands of suggestions exist in the books, but they don't have theoretical explanations. Instead, they came from humans' experiences and inspirations. In such cases, we need to rely on experimental analysis of the heuristics. By applying visualization tools to search algorithms, we can observe phenomena caused by heuristic functions. These tools are also useful for debugging, verification and validation. Search spaces are described in section 2 of this paper. Conventional techniques such as search tree representations and depth-number of node representations, and their advantages and disadvantages as visualizations are discussed in section 3. In section 4, visualizations of heuristic function are described with examples from the Visualization Tools for Real-time Search Algorithms Kuwata & Cohen 2 Eight Puzzle. Time series and frequency analysis of search algorithms are discussed with examples in section 5. Visualization Tools for Real-time Search Algorithms Kuwata & Cohen 3 2. Objects to Visualize in Search 2.1 Search Space The most important thing in problem solving by search is to understand search spaces themselves. They vary from problem to problem. For example, backgammon has 10 states in its search space and chess has a much bigger state space. The structure of search spaces is also completely different in various problems. In chess, large numbers of actions are possible in the first stage of the game but actions are limited in the endgame. On the other hand, in shogi, which is a two-player game similar to chess that allows reuse of dead pieces, the movements in the last stage aren't limited as in chess.2 Therefore, the search spaces for the two games would be different, even though these games look similar. The simplest way to represent a search space is to count the number of states in it. For example, we can compare two problems A and B, which have ten million states and one million states, respectively. We expect to take 10 times longer to solve problem A than to solve problem B. This is because we assumed problem A and B are equally difficult; i.e., they have the same search space structure. But it is possible to define a problem which has a bigger search space but is simpler to solve. Thus simple search state count alone is not sufficient to characterize a search problem. Which problem is bigger ?