Abstract
Algorithms have been developed for a long time with many of them undergoing a long process to reach where they are today. The A* algorithm has found its wide use in artificial intelligence. This is because it has been found to be effective in looking for the shortest path to getting something. Many search algorithms are dynamic in nature. A* can be regarded as static in the way it does its search. There are other versions that have been developed to overcome the limitation that is brought by this algorithm. Even though this is a major limitation in carrying out search, A* is still regarded as the best in the way it will always be in search of the shortest distance to the target. This paper will look at the features of this algorithm and how the performance defeats the other algorithms that undertake the same function.
Introduction
AStar algorithm is an algorithm that is used to find the shortest distance between two places. Started in the year 1968, this algorithm works much like the Edsger Dijkstra’s 1959 algorithm. It has found its wide use in traversing graphs and efficiently used to plot path in between two points. It is also commonly known to be used in path finding. It has been found to be better in performance when time is considered a factor.
It is used to find the shortest distance between two nodes. It makes use of a best-search and finds the path with the least cost from a given initial node to the target node. The function that this algorithm makes use of is distance-plus cost heuristic which is normally denoted as f(x); this function is used to determine the order in which the search will visit the nodes that are found in the tree. This function is a sum that is achieved by summing up two functions, g(x) and h(x). The function g(x) is the cost from the starting point to current node while h(x) is the heuristic estimate of the distance that is found to the target goal. In this essence, the h(x) and f(x) should be heuristic admissible, that is, shall not at any time overestimate the distance to the goal. As an example, in routing, therefore, the h(x) might be taken to be the straight line between the original nodes to the target nodes since this is the shortest distance between any two given points.
In the function, if heuristic h meets the additional condition h(x)<=d(x,y)+h(y) for every edge x,y of the given graph, then h is referred to as a monotone/consistent. When this is the case, then A* will be implemented more efficiently. Basically, there is no need which will need to be processed more than once. In this situation, it will be equivalent to running Dijkstra’s algorithm with the cost which is reduce d’(x,y):=d(x,y)-h(x)+(hy).
Performance compared to other algorithms
In regard to performance, A* algorithm is regarded to be optimal and exhaustive when compared to other algorithms. It is cost effective in that A* algorithm will try as much as possible to find the path with a lower cost. This is not the case with other algorithms. This is can be illustrated by using another algorithm that also is used to look for the shortest path. Given another algorithm D, this algorithm (D) will terminate its search if it finds a path whose cost is not less than the estimated cost of a path via an open node. Using the method of heuristic approach, Algorithm D cannot ignore that there could be a possibility that a path via that node is lower in cost. In this case, the performance of A* is said to be better than that of D because A* considers the least nodes of any algorithm that is regarded to be admissible.
In terms of resource usage, A* is known to solve minimal search problem, in fact it solves only one. This saves on resources. In incremental heuristic search algorithms, there is a guarantee that fewer nodes will be expanded.
Other algorithms
There are algorithms which can be used instead of the A* algorithm. There are variations for this algorithm in the static environments and also other variations in the dynamic environments. A* algorithm is static. In the static environment, there are variations that are associated with this algorithm.
One of the variations is that of PHA* (Felner et al., 2004) which is used in robotics; in this application, a robot will move in an unknown environment or partially unknown environment and effort will be required to check the fitness of a node which has not been explored and which is not necessarily linear. In this case, an agent will have to traverse the distance to the spot and explore the surrounding nodes from that given location. The way in which an A* algorithm is expanded would mean that the robot will also move forth and back from one side of the frontier to the other. As mentioned somewhere in this paper, any algorithm that is looking for the shortest path will have to expand as many nodes as A* does. The challenge that would be added here is visiting all the nodes that are required while making sure that the distance is minimized. In the process of expanding the node, the algorithm will consider if it is in order to take a slight detour in the process to investigate another fit node in the open list or if it is worth travelling across the space of the search for the node that will be considered fit or explore the open two nodes on the open list which are found to be closest to the robot’s current location.
Another baseline is IDA* (Korf, 1985) which is employed in large maps or on devices which have limited storage capacity. For the nodes on the open list to be limited, each iteration will set an upper bound on the value of the nodes that will be expanded. The iterations that follow this will relax the upper bound so that they may have a wider view of the graph thus being able to achieve a linear storage as opposed to exponential view which is employed in the A* algorithm.
Another baseline is HPA* (Botea et al., 2004) which make use of hierarchical partitioning of the map which has been mentioned before. The map is subdivided into smaller units which are referred to as clusters and a limited set of portals are defined for every cluster which shows the positions where the agent can exit the current cluster. The portals are determined by use if pre-processing step which is followed by looking for the shortest path that exists within a cluster and then building a connection between the clusters. In this case, when an agent asks for the shortest path between given two points, the problem will be simplified into looking for the shortest path to the closest portal within their clusters because every other path segment in between is pre-computed. It does not bring about the optimal path but given the short time it achieves the task, it can be said that it is effective because of the time saved in the computation process.
How the algorithm is tested
The testing of the algorithm can be achieved by making use of VTune software which is used for gaming. In general, A* algorithm is used in Artificial Intelligence. It is therefore mostly tested using software that is developed for this industry. The software that will be used to test this algorithm is VTune. The things that one will look at include making sure that there are no bottlenecks for OPEN and CLOSED lists for a new node. There will be also the issue of management of the new nodes.
Another way to test the algorithm would be by use of binary search. When this is the case, the tester will want to test the node which has a logarithmic time. The process of finding the lowest cost of a node will be taken to be constant because it is either the first or the last element of the list depending on the process of implementation. However, if there will be the need to shift each element after removal, the linear time will be degraded. This method will always need logarithmic time so that insertion point will be achieved. The structures will also depend on other factors.
When testing the algorithm, it has been known that the shortest path will always be returned if there is one that exists.
The observations that will need to be noted include the nodes that the algorithm will choose to traverse. The nodes that will be chosen will determine the optimality of the algorithm. The observations that will be ,made therefore will include the insertion points that will be chosen by the algorithm and the distance it achieves in the end. It will be interesting to note the nodes that will be chosen and the distance that would have been covered then.
Variables of A* algorithm
The variables that are valid for this algorithm is h and the function GVAL. These variables change when there is a change in direction. The GVAL function is used in AI functions and is used to estimate the distance between the current node and the AI agent, while h is used to get the known distance from the goal to the current node.
Each and every node will maintain a k value that represents the optimal cost that is found to that node from the goal position from the time the node was discovered. The k variable is used to classify nodes as being either RAISED or LOWER. Nodes which have Lower value are those that have h and k matching. These are the nods which have no obstacle between them and the target node. On the other hand, a raised node is the node which will require a detour will be required in order to reach the target node. The obstacles in this case are experienced due to the presence of dynamic obstacles.
Statistics that can be applied
There will be also be statistics that will be worth taking. It will be necessary to note the nodes that will OPEN and those that will be CLOSED. This statistics will be interesting as they serve to show the criteria that the algorithm will make use of. With the development of the Artificial Intelligence industry, it will be important to take note of the search criteria and the nodes that are chosen by the A* algorithm in search of a shorter path.
Conclusion
The experiment that has been taken has some limitations. One of the limits is that the shortest path cannot be conclusively arrived at. Given the fact that A* algorithm is static, it is difficult to compare with other protocols which are known to be dynamic. It was therefore hard analyzing the features of this algorithm.
References
Botea, A., Muller, M., & Schaeffer, J. (2004). Near optimal hierarchical pathfinding. Journal of Game Development , 1 (1), 7-28.
Cain, T. (2002). Practical optimizations for A* path generation. AI Game Programming Wisdom , 146-152.
Felner, A., Stern, R., Ben-Yair, A., Kraus, S., & Netanyau, N. (2004). PHA*: Finding the shortest path with A* in an unknown physical environment. Journal of Artificial Intelligence Research , 21, 631-670.
Korf, R. (1985). Depth-first iterative-depeening: An optimal admissible tree search. Artificial Intelligence archiv , 27 (1), 97-109.