directed Search
In a * algorithm loop, the open collection is used to hold all the searched nodes used to find the path. The directed search is a variant algorithm based on A * algorithm, which is set by restricting the open set size. When the set is too large, the node that is most unlikely to appear on the optimal path will be rejected. This has the disadvantage of having to maintain such a filter, so that the data structure types you can choose are limited.
Iterative deepening (iterative deepening)
Iterative deepening is a method used by many AI algorithms to start with an estimate and then iterate to make it more accurate. This name is derived from the early pre-sentencing of the next few operations in the game tree search (for example, in chess games). You can deepen the game tree by pre-contracting more actions ahead. Once your results do not change or improve a lot, you can think that you have got a very good result, even if it is more accurate, the results will not improve. In the iterative deepening A * (ida*) algorithm, "depth" is the current truncated value of the F-value. When the F value is too large, the node is not considered (that is, it is not added to the open set). In the first loop, only a very small number of nodes need to be processed. Each subsequent loop increases the number of nodes to be accessed. If the path is found to be optimized, continue to increase the current truncation value, otherwise end. For more details, see links.
Personally, I'm not optimistic about the application of ida* algorithm in game map pathfinding. Iterative deepening algorithms tend to increase computational time while reducing memory requirements. However, in a map pathfinding scenario, the nodes only contain coordinate information, which requires very little memory. So reducing this part of the memory overhead does not give you any advantage. Dynamic Weighting
In the dynamic weighting algorithm, you assume that it is more important to quickly reach (any) position at the beginning of the search, and it is more important to reach the target location at the end of the search.
| 1 |
F (P) = g (p) + W (P) * H (P) |
There is a weighted value (w >= 1) and the Heuristic Association. The weight value also decreases as you approach the target position. This reduces the importance of heuristic functions and increases the relative importance of the actual cost of the path. Bandwidth Search
Bandwidth search has two features that are considered to be very useful. This algorithm variant assumes that H is an overestimated value, but its estimated error will not exceed E. Under such conditions, the path cost and the optimal path cost of the search will not exceed the error of E. Once again, the better the heuristic is set, the better the result will be.
Another feature is to determine if you can delete some of the nodes in the Open collection. As long as the h+d is greater than the true cost of the path (for some d), you can discard any node that satisfies at least a large e+d of its F value than the optimal node F value in the open set. This is a very strange feature. You have the equivalent of getting an F-value bandwidth; all nodes that are unexpectedly in this bandwidth can be discarded because they are guaranteed not to appear in the optimal path.
Interestingly, the results can still be calculated by using different heuristic values for each of the two features. You can use an heuristic value to ensure that the path cost is not too large, and another heuristic value that determines which nodes in the open set are discarded. bidirectional Search
Unlike search from start to finish, you can also perform two simultaneous searches in parallel, one from the beginning to the end, and one from the end to the beginning. When they meet, you get an optimal path.
This idea is very useful in some cases. The main idea of a two-way search is that the search results form a tree that is fan-shaped on the map. A large tree is not as good as two small trees, so it is better to use two small search trees.
In-person variants link two search results together. The algorithm chooses a pair of nodes satisfying the best g (start,x) + h (x, y) + g (y,goal) instead of selecting the best Forward Search node G (start,x) + H (x,goal) or the best back search node g (y,goal) + H (start,y).
The redirect algorithm discards the simultaneous forward and back search methods. The algorithm first makes a brief forward search, and selects an optimal forward candidate node. Then go back to the search. At this point, the back-search is not toward the start node, but toward the newly-obtained forward candidate node. A back search will also select the best Forward Search node. Then next, run the forward search, from the current forward candidate node to the back candidate node. This process will be repeated until two of the selected nodes overlap. dynamic * and lifetime planning *
There are a * * variant algorithms that allow the map to change after the initial path is calculated. A dynamic * can be used to find the way to a situation where all the map information is not known. Without all the information, the calculation of a * algorithm can be an error, and the advantage of a dynamic * is that it can be quickly corrected without spending a lot of time. Lifetime Planning A * algorithm can be used to change the cost of the situation. When the map changes, a * calculation of the path may fail; a lifetime Plan A * can reuse a previous * calculation to generate a new path.
However, the dynamic * and lifetime planning a * all require a lot of space--it is necessary to keep its internal information (open/closed collection, Path tree, g value) when running a * algorithm. When the path changes, a dynamic * or lifetime Plan A * algorithm will tell you if you need to adjust your path according to the changes in the map.
For a game with a large number of sports units, it is usually not necessary to save all the information, so the dynamic d* and Lifetime Plan A * may not apply. The two algorithms are designed primarily for robotics. When there is only one robot, you do not need to reuse memory for the paths of other robots. If your game has only one or fewer units, you will want to study the dynamic A * or Lifetime Plan A * algorithm. d* Algorithm Overview d* article 1 d* article 2 lifetime planning algorithm overview Lifetime Planning algorithm paper (PDF) Lifetime Plan * Algorithm applet jumping point search
Most of the techniques to improve the computational speed of a * algorithm are the strategies to reduce the number of nodes. In a uniform cost grid, it is wasteful to search for a separate lattice space each time. One solution is to create a diagram of the key nodes (such as corners) to be used for pathfinding. However, no one wants to calculate a signpost in advance, so let's look at A * variant algorithm that can jump forward on a grid chart, jumping point search. Given that the child nodes of the current node are likely to appear in the Open collection, the hop search jumps directly to the distant nodes that can be seen from the current point. As the nodes in the open collection continue to decrease, the cost of each step will be higher, albeit high, but with fewer steps. For details, please refer to the link, this blog has a good visual interpretation, and Reddit on the pros and cons of the discussion can click on this link.
In addition, in the rectangular symmetry reduction, the map is analyzed and the image is embedded in the jump. Both of these technologies are used in grid diagrams. theta*
Sometimes the grid is used to find a way because the map is generated from a grid, not because it is really moving on the grid. A * algorithm can run faster and get a better path if a graph of a key point, such as a corner, is given instead of a grid. However, if you do not want to pre-calculate the corners of those graphs, you can use the variant of the * algorithm to theta* on the grid instead of strictly following the squares. When a father pointer is built, if there is an edge between the ancestor and the node, then the theta* algorithm directly points the pointer to that ancestor and ignores all intermediate nodes. Unlike path smoothing, where A * finds a path into a straight line, theta* can analyze those paths as part of a * algorithm process. This can be done in a way that allows for a shorter path than the subsequent processing of the square path to a path of arbitrary inclination. This article is a more reasonable introduction to the algorithm, in addition to refer to lazy theta*.
The idea of theta* may also be applied to the navigation grid.