摘录a算法(astar)(Excerpt a algorithm (astar)).docVIP

  • 1
  • 0
  • 约9.46千字
  • 约 7页
  • 2017-10-07 发布于河南
  • 举报

摘录a算法(astar)(Excerpt a algorithm (astar)).doc

摘录a算法(astar)(Excerpt a algorithm (astar))

摘录a算法(astar)(Excerpt a algorithm (astar)) In the A* algorithm, the first mention of the breadth first search, breadth first search is the current state of each development strategy may be carried out step by step, such as a map, the object is allowed to move in four directions, then it will point to the object, on each step, the four state are stored in memory, and then point to four directions to move from the four of... (of course here can move, such as eliminating the unreasonable are not allowed to move back) in fact, the entire search like a round open outward, until you reach the destination. Obviously, this algorithm can find the optimal solution, but the number of nodes is deployed and distance increasing, really used in the game, game player will complain memory 128M is not enough to be increased with the ^_^ and processing nodes, processing speed will be slowed down rapidly... It can be said that this algorithm is not practical. A* algorithm is a heuristic search, called heuristic search, is to use a valuation function to evaluate each decision value, decided to first try what kind of program, this can greatly optimizing the breadth first search. Generally speaking, from the starting point (A) to (B) the shortest distance is fixed, we can write a function (judge) estimation of the shortest distance from A to B, if the program has already tried from the starting point A along a route to move to C, so we think this the A B between the estimated distance of A to C is walking distance with H plus judge (C) to estimate the distance of B. So, regardless of our search procedure where the next step will be to calculate the evaluation value, every decision, will evaluate the value and wait for the treatment with sorting, each program and then pick out the most likely is the shortest route as part of the solution to the next step. Has been circulating to move the object to the destination, or all solutions are tried but failed to find a path to the destination path

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档