什么湖什么海| 舌苔白厚是什么原因| 什么情况下必须做胃镜| 奶嚼口是什么| 木是什么颜色| 肚子疼喝什么药| 日月星辰是什么意思| 宫内孕和宫外孕有什么区别| 东方蝾螈吃什么| 天雨粟鬼夜哭什么意思| 2月10号是什么星座| 带状疱疹能吃什么食物| 容易口腔溃疡什么原因| 湿热会引起什么症状| psp是什么意思| 考试穿什么颜色最吉利| 礼成是什么意思| 小腿疼痛挂什么科| 失恋什么意思| 眼镜片什么材质的好| 麝香是什么味道| 场面是什么意思| 茼蒿不能和什么一起吃| 什么是慰安妇| 安是什么意思| 拉肚子为什么憋不住| 讲解是什么意思| 吃什么容易发胖| 1938年中国发生了什么| 弧度是什么意思| 小孩子睡觉流口水是什么原因| 刘封为什么不救关羽| 皮肤黑穿什么颜色好看| 什么是心梗| labs是什么意思| 为什么会缺乏维生素d| 冷暴力是什么| 欧芹在中国叫什么| revive是什么意思| 什么人容易得心理疾病| 袋鼠喜欢吃什么食物| 舍我其谁是什么意思| 什么药降肌酐最有效| 丁未五行属什么| 右肺下叶纤维化灶是什么意思| c表示什么| 红细胞数目偏高是什么意思| 人乳头瘤病毒hpv是什么意思| 为什么闭眼单脚站不稳| 吃什么对脾胃有好处| 青岛啤酒节是什么时候| 日本料理都有什么菜| 高锰酸钾在药店叫什么| 身上总是痒是什么原因| 早晨起来口干口苦是什么原因| 泔水是什么意思| 有眼袋是什么原因| 王大治与董洁什么关系| 韧带是什么样子图片| 梦见大便是什么预兆| 踏空是什么意思| 为什么打牌老输| 左金丸治什么病最好| 查幽门螺杆菌挂什么科| 痛风是什么原因引起的| 健康证明需要检查什么| 小鸡啄米什么意思| 什么是亲子鉴定| 毅力是什么意思| 地米是什么药| 肾的功能是什么| 枕头底下放剪刀有什么说法| 女人白虎是什么意思| 低血糖的人吃什么东西最好| 占卜是什么意思| 开化龙顶属于什么茶| 七月出生的是什么星座| 什么鸟一生只有一个伴侣| 吃什么丰胸最好| 越南人说什么语言| 喉咙有白痰是什么原因| 陈醋与香醋有什么区别| 为什么一来月经就拉肚子| 身上长白色的斑点是什么原因| 生孩子需要准备什么东西| 还替身是什么意思| 什么是室性早搏| 手上起小水泡是什么原因| 沁是什么意思| 李逵的绰号是什么| 生脉饮适合什么人群| 11月27是什么星座| 抗体是什么意思| 推辞是什么意思| 脊椎痛什么原因| 什么是山海经| 凉面是用什么面做的| 云朵像什么| 吃什么能降尿蛋白| 荨麻疹什么症状| 小蜜蜂是什么牌子| 鼻窦炎是什么样子的| 睾丸炎有什么症状| 涛字五行属什么| 属虎的是什么命| 扫兴什么意思| 努尔哈赤是什么意思| 九十岁老人称什么| 阴骘是什么意思| 关节疼痛挂什么科| 剑客是什么意思| 乳糖不耐受吃什么奶粉| 吃槟榔有什么好处| 什么是靶向药| 麻婆豆腐是什么菜系| hpv去医院挂什么科| 吉可以加什么偏旁| 保释是什么意思| 病毒性感染是什么原因| 低钾血症吃什么药| 古惑仔为什么不拍了| 植物纤维是什么面料| fb是什么意思| 咽峡炎吃什么药| 肌酸激酶高是什么意思| 奥利司他是什么药| 早搏吃什么药最好| mdt是什么| 单亲家庭是指什么| 逃出生天什么意思| 缺维生素b吃什么食物| 泽泻是什么| 来大姨妈肚子疼是什么原因| 梦见鱼是什么预兆| lotus是什么牌子| elaine是什么意思| 药店为什么不让卖高锰酸钾| 零八年属什么生肖| 18k黄金是什么意思| 功课是什么意思| 拉肚子吃什么药最好| 双鱼座上升星座是什么| 梦见钓鱼是什么意思周公解梦| 护照办理需要什么材料| 花椒水泡脚有什么好处| 头孢长什么样| 湿气重的人吃什么好| 子宫内膜薄有什么影响| 呕心沥血是什么意思| jennie什么意思| 羽字属于五行属什么| 滴虫性阴炎用什么药效果最好| 孕妇适合吃什么零食| st是什么意思| 神经大条是什么意思| 墙头是什么意思| 夜宵是什么意思| 什么什么什么花的成语| 乳腺增生的前兆是什么| 苦瓜不能和什么一起吃| 罗非鱼吃什么食物| 导语是什么意思| 血糖高能吃什么主食| 白细胞偏高是什么原因引起的| 线索细胞阳性是什么意思| 三叉神经是什么病| 青少年手抖是什么原因| 怀孕什么时候吃鹅蛋最好| 什么叫粳米| 糖类抗原什么意思| 副主任医师是什么级别| 属羊的守护神是什么菩萨| 吃什么可以增强硬度| 脑供血不足检查什么项目| 话梅泡水喝有什么好处和坏处| 5月30号是什么星座| 大什么针| 稻花鱼是什么鱼| 血管变窄吃什么能改善| 梦到女鬼是什么意思| 射手座和什么星座最配| 朱雀玄武是什么意思| 烂脚丫用什么药最好| 黄大仙是保佑什么的| 甲状腺球蛋白抗体低说明什么| 卵巢囊肿术后吃什么食物好| videos是什么意思| 蚂蚁的天敌是什么| 贫血吃什么补得快| 卧室放什么花最好健康| 叉烧炒什么菜好吃| 料酒是什么酒| 大脑供血不足头晕吃什么药最好| 7.28是什么星座| 低压偏低是什么原因| 苏州立夏吃什么| 6月16日是什么日子| 宝宝蛋白质过敏喝什么奶粉| 区委常委是什么级别| 魏丑夫和芈月什么关系| 日不落是什么意思| 什么是医疗器械| 腺肌症是什么症状| 12月10号是什么星座| 心房扑动是什么意思| 卑劣是什么意思| 肌酐是检查什么的| 雷击木有什么作用| 什么时候做nt| 我还能做什么| 奋不顾身的顾是什么意思| 4月1号是什么星座| 彼此彼此是什么意思| 欲生欲死是什么意思| 梦到死人是什么预兆| c60是什么| 梦见盗墓是什么意思| 办身份证穿什么颜色衣服| 跑步后头晕是什么原因| 橡皮擦是什么材料做的| 什么是断掌| 除湿气喝什么茶| 急性胃肠炎吃什么药| 锌补多了有什么症状| 独立户口需要什么条件办理| 高湛为什么帮梅长苏| 2021属什么生肖| 一什么玉米| 眼睛下面有痣代表什么| 改编是什么意思| 嘴巴长疱疹用什么药| 增生性贫血是什么意思| 荷兰猪吃什么| 狗摇尾巴是什么意思| 晚上睡觉流口水是什么原因| 什么叫疝气| 腰间盘突出压迫神经腿疼吃什么药| 肺心病是什么原因引起的| 荨麻疹忌口什么食物| 芈怎么读什么意思| 四月九号是什么星座| 什么是菩提心| 阴阳什么意思| 右脸突然肿了是什么原因| 私生是什么意思| 今天的日子适合做什么| 尖嘴猴腮是什么生肖| 甘草片不能和什么药一起吃| 车间管理人员工资计入什么科目| 小孩查微量元素挂什么科| 降钙素原高说明什么| 肝气不舒有什么症状| 偏头疼是什么原因| 爱情和面包是什么意思| 红豆吃多了有什么坏处| 核磁共振什么时候出结果| 什么是五险一金| 鲽鱼是什么鱼| 精索静脉曲张是什么意思| 病退需要什么条件| 什么是龟头炎| 诗情画意的意思是什么| 什么是自由度| 木棉是什么面料| 百度

搜狐会员账号共享 2017.4.17搜狐vip帐号分享

百度 随着志在打造30分钟生活圈的饿了么一旦加入阿里巴巴新零售,这一优势和新生活体验将持续扩大。

A* (pronounced "A-star") is a graph traversal and pathfinding algorithm that is used in many fields of computer science due to its completeness, optimality, and optimal efficiency.[1] Given a weighted graph, a source node and a goal node, the algorithm finds the shortest path (with respect to the given weights) from source to goal.

ClassSearch algorithm
Data structureGraph
Worst-case performance
Worst-case space complexity

One major practical drawback is its space complexity where d is the depth of the shallowest solution (the length of the shortest path from the source node to any given goal node) and b is the branching factor (the maximum number of successors for any given state), as it stores all generated nodes in memory. Thus, in practical travel-routing systems, it is generally outperformed by algorithms that can pre-process the graph to attain better performance,[2] as well as by memory-bounded approaches; however, A* is still the best solution in many cases.[3]

Peter Hart, Nils Nilsson and Bertram Raphael of Stanford Research Institute (now SRI International) first published the algorithm in 1968.[4] It can be seen as an extension of Dijkstra's algorithm. A* achieves better performance by using heuristics to guide its search.

Compared to Dijkstra's algorithm, the A* algorithm only finds the shortest path from a specified source to a specified goal, and not the shortest-path tree from a specified source to all possible goals. This is a necessary trade-off for using a specific-goal-directed heuristic. For Dijkstra's algorithm, since the entire shortest-path tree is generated, every node is a goal, and there can be no specific-goal-directed heuristic.

History

edit
 
A* was invented by researchers working on Shakey the Robot's path planning.

A* was created as part of the Shakey project, which had the aim of building a mobile robot that could plan its own actions. Nils Nilsson originally proposed using the Graph Traverser algorithm[5] for Shakey's path planning.[6] Graph Traverser is guided by a heuristic function h(n), the estimated distance from node n to the goal node: it entirely ignores g(n), the distance from the start node to n. Bertram Raphael suggested using the sum, g(n) + h(n).[7] Peter Hart invented the concepts we now call admissibility and consistency of heuristic functions. A* was originally designed for finding least-cost paths when the cost of a path is the sum of its costs, but it has been shown that A* can be used to find optimal paths for any problem satisfying the conditions of a cost algebra.[8]

The original 1968 A* paper[4] contained a theorem stating that no A*-like algorithm[a] could expand fewer nodes than A* if the heuristic function is consistent and A*'s tie-breaking rule is suitably chosen. A "correction" was published a few years later[9] claiming that consistency was not required, but this was shown to be false in 1985 in Dechter and Pearl's definitive study of A*'s optimality (now called optimal efficiency), which gave an example of A* with a heuristic that was admissible but not consistent expanding arbitrarily more nodes than an alternative A*-like algorithm.[10]

Description

edit
 
A* pathfinding algorithm navigating around a randomly-generated maze
Illustration of A* search for finding a path between two points on a graph. From left to right, a heuristic that prefers points closer to the goal is used increasingly.

A* is an informed search algorithm, or a best-first search, meaning that it is formulated in terms of weighted graphs: starting from a specific starting node of a graph, it aims to find a path to the given goal node having the smallest cost (least distance travelled, shortest time, etc.). It does this by maintaining a tree of paths originating at the start node and extending those paths one edge at a time until the goal node is reached.

At each iteration of its main loop, A* needs to determine which of its paths to extend. It does so based on the cost of the path and an estimate of the cost required to extend the path all the way to the goal. Specifically, A* selects the path that minimizes

 

where n is the next node on the path, g(n) is the cost of the path from the start node to n, and h(n) is a heuristic function that estimates the cost of the cheapest path from n to the goal. The heuristic function is problem-specific. If the heuristic function is admissible – meaning that it never overestimates the actual cost to get to the goal – A* is guaranteed to return a least-cost path from start to goal.

Typical implementations of A* use a priority queue to perform the repeated selection of minimum (estimated) cost nodes to expand. This priority queue is known as the open set, fringe or frontier. At each step of the algorithm, the node with the lowest f(x) value is removed from the queue, the f and g values of its neighbors are updated accordingly, and these neighbors are added to the queue. The algorithm continues until a removed node (thus the node with the lowest f value out of all fringe nodes) is a goal node.[b] The f value of that goal is then also the cost of the shortest path, since h at the goal is zero in an admissible heuristic.

The algorithm described so far only gives the length of the shortest path. To find the actual sequence of steps, the algorithm can be easily revised so that each node on the path keeps track of its predecessor. After this algorithm is run, the ending node will point to its predecessor, and so on, until some node's predecessor is the start node.

As an example, when searching for the shortest route on a map, h(x) might represent the straight-line distance to the goal, since that is physically the smallest possible distance between any two points. For a grid map from a video game, using the Taxicab distance or the Chebyshev distance becomes better depending on the set of movements available (4-way or 8-way).

If the heuristic h satisfies the additional condition h(x) ≤ d(x, y) + h(y) for every edge (x, y) of the graph (where d denotes the length of that edge), then h is called monotone, or consistent. With a consistent heuristic, A* is guaranteed to find an optimal path without processing any node more than once and A* is equivalent to running Dijkstra's algorithm with the reduced cost d'(x, y) = d(x, y) + h(y) ? h(x).[11]

Pseudocode

edit

The following pseudocode describes the algorithm:

function reconstruct_path(cameFrom, current)
    total_path := {current}
    while current in cameFrom.Keys:
        current := cameFrom[current]
        total_path.prepend(current)
    return total_path

// A* finds a path from start to goal.
// h is the heuristic function. h(n) estimates the cost to reach goal from node n.
function A_Star(start, goal, h)
    // The set of discovered nodes that may need to be (re-)expanded.
    // Initially, only the start node is known.
    // This is usually implemented as a min-heap or priority queue rather than a hash-set.
    openSet := {start}

    // For node n, cameFrom[n] is the node immediately preceding it on the cheapest path from the start
    // to n currently known.
    cameFrom := an empty map

    // For node n, gScore[n] is the currently known cost of the cheapest path from start to n.
    gScore := map with default value of Infinity
    gScore[start] := 0

    // For node n, fScore[n] := gScore[n] + h(n). fScore[n] represents our current best guess as to
    // how cheap a path could be from start to finish if it goes through n.
    fScore := map with default value of Infinity
    fScore[start] := h(start)

    while openSet is not empty
        // This operation can occur in O(Log(N)) time if openSet is a min-heap or a priority queue
        current := the node in openSet having the lowest fScore[] value
        if current = goal
            return reconstruct_path(cameFrom, current)

        openSet.Remove(current)
        for each neighbor of current
            // d(current,neighbor) is the weight of the edge from current to neighbor
            // tentative_gScore is the distance from start to the neighbor through current
            tentative_gScore := gScore[current] + d(current, neighbor)
            if tentative_gScore < gScore[neighbor]
                // This path to neighbor is better than any previous one. Record it!
                cameFrom[neighbor] := current
                gScore[neighbor] := tentative_gScore
                fScore[neighbor] := tentative_gScore + h(neighbor)
                if neighbor not in openSet
                    openSet.add(neighbor)

    // Open set is empty but goal was never reached
    return failure

Remark: In this pseudocode, if a node is reached by one path, removed from openSet, and subsequently reached by a cheaper path, it will be added to openSet again. This is essential to guarantee that the path returned is optimal if the heuristic function is admissible but not consistent. If the heuristic is consistent, when a node is removed from openSet the path to it is guaranteed to be optimal so the test ‘tentative_gScore < gScore[neighbor]’ will always fail if the node is reached again. The pseudocode implemented here is sometimes called the graph-search version of A*.[12] This is in contrast with the version without the ‘tentative_gScore < gScore[neighbor]’ test to add nodes back to openSet, which is sometimes called the tree-search version of A* and require a consistent heuristic to guarantee optimality.

 
Illustration of A* search for finding path from a start node to a goal node in a robot motion planning problem. The empty circles represent the nodes in the open set, i.e., those that remain to be explored, and the filled ones are in the closed set. Color on each closed node indicates the distance from the goal: the greener, the closer. One can first see the A* moving in a straight line in the direction of the goal, then when hitting the obstacle, it explores alternative routes through the nodes from the open set.

Example

edit

An example of an A* algorithm in action where nodes are cities connected with roads and h(x) is the straight-line distance to the target point:

 

Key: green: start; blue: goal; orange: visited

The A* algorithm has real-world applications. In this example, edges are railroads and h(x) is the great-circle distance (the shortest possible distance on a sphere) to the target. The algorithm is searching for a path between Washington, D.C., and Los Angeles.

 

Implementation details

edit

There are a number of simple optimizations or implementation details that can significantly affect the performance of an A* implementation. The first detail to note is that the way the priority queue handles ties can have a significant effect on performance in some situations. If ties are broken so the queue behaves in a LIFO manner, A* will behave like depth-first search among equal cost paths (avoiding exploring more than one equally optimal solution).

When a path is required at the end of the search, it is common to keep with each node a reference to that node's parent. At the end of the search, these references can be used to recover the optimal path. If these references are being kept then it can be important that the same node doesn't appear in the priority queue more than once (each entry corresponding to a different path to the node, and each with a different cost). A standard approach here is to check if a node about to be added already appears in the priority queue. If it does, then the priority and parent pointers are changed to correspond to the lower-cost path. A standard binary heap based priority queue does not directly support the operation of searching for one of its elements, but it can be augmented with a hash table that maps elements to their position in the heap, allowing this decrease-priority operation to be performed in logarithmic time. Alternatively, a Fibonacci heap can perform the same decrease-priority operations in constant amortized time.

Special cases

edit

Dijkstra's algorithm, as another example of a uniform-cost search algorithm, can be viewed as a special case of A* where ? ? for all x.[13][14] General depth-first search can be implemented using A* by considering that there is a global counter C initialized with a very large value. Every time we process a node we assign C to all of its newly discovered neighbors. After every single assignment, we decrease the counter C by one. Thus the earlier a node is discovered, the higher its ? ? value. Both Dijkstra's algorithm and depth-first search can be implemented more efficiently without including an ? ? value at each node.

Properties

edit

Termination and completeness

edit

On finite graphs with non-negative edge weights A* is guaranteed to terminate and is complete, i.e. it will always find a solution (a path from start to goal) if one exists. On infinite graphs with a finite branching factor and edge costs that are bounded away from zero (  for some fixed  ), A* is guaranteed to terminate only if there exists a solution.[1]

Admissibility

edit

A search algorithm is said to be admissible if it is guaranteed to return an optimal solution. If the heuristic function used by A* is admissible, then A* is admissible. An intuitive "proof" of this is as follows:

Call a node closed if it has been visited and is not in the open set. We close a node when we remove it from the open set. A basic property of the A* algorithm, which we'll sketch a proof of below, is that when ? ? is closed, ? ? is an optimistic estimate (lower bound) of the true distance from the start to the goal. So when the goal node, ? ?, is closed, ? ? is no more than the true distance. On the other hand, it is no less than the true distance, since it is the length of a path to the goal plus a heuristic term.

Now we'll see that whenever a node ? ? is closed, ? ? is an optimistic estimate. It is enough to see that whenever the open set is not empty, it has at least one node ? ? on an optimal path to the goal for which ? ? is the true distance from start, since in that case ? ? + ? ? underestimates the distance to goal, and therefore so does the smaller value chosen for the closed vertex. Let ? ? be an optimal path from the start to the goal. Let ? ? be the last closed node on ? ? for which ? ? is the true distance from the start to the goal (the start is one such vertex). The next node in ? ? has the correct ? ? value, since it was updated when ? ? was closed, and it is open since it is not closed.

Optimality and consistency

edit

Algorithm A is optimally efficient with respect to a set of alternative algorithms Alts on a set of problems P if for every problem P in P and every algorithm A′ in Alts, the set of nodes expanded by A in solving P is a subset (possibly equal) of the set of nodes expanded by A′ in solving P. The definitive study of the optimal efficiency of A* is due to Rina Dechter and Judea Pearl.[10] They considered a variety of definitions of Alts and P in combination with A*'s heuristic being merely admissible or being both consistent and admissible. The most interesting positive result they proved is that A*, with a consistent heuristic, is optimally efficient with respect to all admissible A*-like search algorithms on all "non-pathological" search problems. Roughly speaking, their notion of the non-pathological problem is what we now mean by "up to tie-breaking". This result does not hold if A*'s heuristic is admissible but not consistent. In that case, Dechter and Pearl showed there exist admissible A*-like algorithms that can expand arbitrarily fewer nodes than A* on some non-pathological problems.

Optimal efficiency is about the set of nodes expanded, not the number of node expansions (the number of iterations of A*'s main loop). When the heuristic being used is admissible but not consistent, it is possible for a node to be expanded by A* many times, an exponential number of times in the worst case.[15] In such circumstances, Dijkstra's algorithm could outperform A* by a large margin. However, more recent research found that this pathological case only occurs in certain contrived situations where the edge weight of the search graph is exponential in the size of the graph and that certain inconsistent (but admissible) heuristics can lead to a reduced number of node expansions in A* searches.[16][17]

Bounded relaxation

edit
 
A* search that uses a heuristic that is 5.0(=ε) times a consistent heuristic, and obtains a suboptimal path

While the admissibility criterion guarantees an optimal solution path, it also means that A* must examine all equally meritorious paths to find the optimal path. To compute approximate shortest paths, it is possible to speed up the search at the expense of optimality by relaxing the admissibility criterion. Oftentimes we want to bound this relaxation, so that we can guarantee that the solution path is no worse than (1 + ε) times the optimal solution path. This new guarantee is referred to as ε-admissible.

There are a number of ε-admissible algorithms:

  • Weighted A*/Static Weighting's.[18] If ha(n) is an admissible heuristic function, in the weighted version of the A* search one uses hw(n) = ε ha(n), ε > 1 as the heuristic function, and perform the A* search as usual (which eventually happens faster than using ha since fewer nodes are expanded). The path hence found by the search algorithm can have a cost of at most ε times that of the least cost path in the graph.[19]
  • Convex Upward/Downward Parabola (XUP/XDP). [20] Modification to the cost function in weighted A* to push optimality toward the start or goal. XDP gives paths which are near optimal close to the start, and XUP paths are near-optimal close to the goal. Both yield  -optimal paths overall.
     .
     .
  • Piecewise Upward/Downward Curve (pwXU/pwXD).[21] Similar to XUP/XDP but with piecewise functions instead of parabola. Solution paths are also  -optimal.
     
     
  • Dynamic Weighting[22] uses the cost function ? ?, where  , and where ? ? is the depth of the search and N is the anticipated length of the solution path.
  • Sampled Dynamic Weighting[23] uses sampling of nodes to better estimate and debias the heuristic error.
  •  .[24] uses two heuristic functions. The first is the FOCAL list, which is used to select candidate nodes, and the second hF is used to select the most promising node from the FOCAL list.
  • Aε[25] selects nodes with the function ? ?, where A and B are constants. If no nodes can be selected, the algorithm will backtrack with the function ? ?, where C and D are constants.
  • AlphA*[26] attempts to promote depth-first exploitation by preferring recently expanded nodes. AlphA* uses the cost function  , where  , where λ and Λ are constants with  , π(n) is the parent of n, and ? is the most recently expanded node.

Complexity

edit

As a heuristic search algorithm, the performance of A* is heavily influenced by the quality of the heuristic function  . If the heuristic closely approximates the true cost to the goal, A* can significantly reduce the number of node expansions. On the other hand, a poor heuristic can lead to many unnecessary expansions.

Worst-Case Scenario

edit

In the worst case, A* expands all nodes   for which  , where   is the cost of the optimal goal node.

Why can’t it be worse

edit

Suppose there is a node   in the open list with  , and it's the next node to be expanded. Since the goal node has  , and  , the goal node will have a lower f-value and will be expanded before  . Therefore, A* never expands nodes with  .

Why can’t it be better

edit

Assume there exists an optimal algorithm that expands fewer nodes than   in the worst case using the same heuristic. That means there must be some node   such that  , yet the algorithm chooses not to expand it.

Now consider a modified graph where a new edge of cost   (with  ) is added from   to the goal. If  , then the new optimal path goes through  . However, since the algorithm still avoids expanding  , it will miss the new optimal path, violating its optimality.

Therefore, no optimal algorithm including A* could expand fewer nodes than   in the worst case.

Mathematical Notation

edit

The worst-case complexity of A* is often described as  , where   is the branching factor and   is the depth of the shallowest goal. While this gives a rough intuition, it does not precisely capture the actual behavior of A*.

A more accurate bound considers the number of nodes with  . If   is the smallest possible difference in  -cost between distinct nodes, then A* may expand up to:

 

This represents both the time and space complexity in the worst case.

Space Complexity

edit

The space complexity of A* is roughly the same as that of all other graph search algorithms, as it keeps all generated nodes in memory.[1] In practice, this turns out to be the biggest drawback of the A* search, leading to the development of memory-bounded heuristic searches, such as Iterative deepening A*, memory-bounded A*, and SMA*.

Applications

edit

A* is often used for the common pathfinding problem in applications such as video games, but was originally designed as a general graph traversal algorithm.[4] It finds applications in diverse problems, including the problem of parsing using stochastic grammars in NLP.[27] Other cases include an Informational search with online learning.[28]

Relations to other algorithms

edit

What sets A* apart from a greedy best-first search algorithm is that it takes the cost/distance already traveled, g(n), into account.

Some common variants of Dijkstra's algorithm can be viewed as a special case of A* where the heuristic   for all nodes;[13][14] in turn, both Dijkstra and A* are special cases of dynamic programming.[29] A* itself is a special case of a generalization of branch and bound.[30]

A* is similar to beam search except that beam search maintains a limit on the numbers of paths that it has to explore.[31]

Variants

edit

A* can also be adapted to a bidirectional search algorithm, but special care needs to be taken for the stopping criterion.[35]

See also

edit

Notes

edit
  1. ^ "A*-like" means the algorithm searches by extending paths originating at the start node one edge at a time, just as A* does. This excludes, for example, algorithms that search backward from the goal or in both directions simultaneously. In addition, the algorithms covered by this theorem must be admissible, and "not more informed" than A*.
  2. ^ Goal nodes may be passed over multiple times if there remain other nodes with lower f values, as they may lead to a shorter path to a goal.

References

edit
  1. ^ a b c Russell, Stuart J.; Norvig, Peter (2018). Artificial intelligence a modern approach (4th ed.). Boston: Pearson. ISBN 978-0134610993. OCLC 1021874142.
  2. ^ Delling, D.; Sanders, P.; Schultes, D.; Wagner, D. (2009). "Engineering Route Planning Algorithms". Algorithmics of Large and Complex Networks: Design, Analysis, and Simulation. Lecture Notes in Computer Science. Vol. 5515. Springer. pp. 117–139. doi:10.1007/978-3-642-02094-0_7. ISBN 978-3-642-02093-3.
  3. ^ Zeng, W.; Church, R. L. (2009). "Finding shortest paths on real road networks: the case for A*". International Journal of Geographical Information Science. 23 (4): 531–543. Bibcode:2009IJGIS..23..531Z. doi:10.1080/13658810801949850. S2CID 14833639.
  4. ^ a b c Hart, P. E.; Nilsson, N.J.; Raphael, B. (1968). "A Formal Basis for the Heuristic Determination of Minimum Cost Paths". IEEE Transactions on Systems Science and Cybernetics. 4 (2): 100–7. doi:10.1109/TSSC.1968.300136.
  5. ^ Doran, J. E.; Michie, D. (2025-08-05). "Experiments with the Graph Traverser program". Proc. R. Soc. Lond. A. 294 (1437): 235–259. Bibcode:1966RSPSA.294..235D. doi:10.1098/rspa.1966.0205. S2CID 21698093.
  6. ^ Nilsson, Nils J. (2025-08-05). The Quest for Artificial Intelligence (PDF). Cambridge: Cambridge University Press. ISBN 9780521122931. One of the first problems we considered was how to plan a sequence of 'way points' that Shakey could use in navigating from place to place. […] Shakey's navigation problem is a search problem, similar to ones I have mentioned earlier.
  7. ^ Nilsson, Nils J. (2025-08-05). The Quest for Artificial Intelligence (PDF). Cambridge: Cambridge University Press. ISBN 9780521122931. Bertram Raphael, who was directing work on Shakey at that time, observed that a better value for the score would be the sum of the distance traveled so far from the initial position plus my heuristic estimate of how far the robot had to go.
  8. ^ Edelkamp, Stefan; Jabbar, Shahid; Lluch-Lafuente, Alberto (2005). "Cost-Algebraic Heuristic Search". Proceedings of the Twentieth National Conference on Artificial Intelligence (AAAI) (PDF). pp. 1362–1367. ISBN 978-1-57735-236-5.
  9. ^ Hart, Peter E.; Nilsson, Nils J.; Raphael, Bertram (2025-08-05). "Correction to 'A Formal Basis for the Heuristic Determination of Minimum Cost Paths'" (PDF). ACM SIGART Bulletin (37): 28–29. doi:10.1145/1056777.1056779. S2CID 6386648.
  10. ^ a b Dechter, Rina; Judea Pearl (1985). "Generalized best-first search strategies and the optimality of A*". Journal of the ACM. 32 (3): 505–536. doi:10.1145/3828.3830. S2CID 2092415.
  11. ^ Nannicini, Giacomo; Delling, Daniel; Schultes, Dominik; Liberti, Leo (2012). "Bidirectional A* search on time-dependent road networks" (PDF). Networks. 59 (2): 240–251. doi:10.1002/NET.20438.
  12. ^ Russell, Stuart J.; Norvig, Peter (2009). Artificial intelligence: A modern approach (3rd ed.). Boston: Pearson. p. 95. ISBN 978-0136042594.
  13. ^ a b De Smith, Michael John; Goodchild, Michael F.; Longley, Paul (2007), Geospatial Analysis: A Comprehensive Guide to Principles, Techniques and Software Tools, Troubadour Publishing Ltd, p. 344, ISBN 9781905886609.
  14. ^ a b Hetland, Magnus Lie (2010), Python Algorithms: Mastering Basic Algorithms in the Python Language, Apress, p. 214, ISBN 9781430232377, archived from the original on 15 February 2022.
  15. ^ Martelli, Alberto (1977). "On the Complexity of Admissible Search Algorithms". Artificial Intelligence. 8 (1): 1–13. doi:10.1016/0004-3702(77)90002-9.
  16. ^ Felner, Ariel; Uzi Zahavi (2011). "Inconsistent heuristics in theory and practice". Artificial Intelligence. 175 (9–10): 1570–1603. doi:10.1016/j.artint.2011.02.001.
  17. ^ Zhang, Zhifu; N. R. Sturtevant (2009). Using Inconsistent Heuristics on A* Search. Twenty-First International Joint Conference on Artificial Intelligence. pp. 634–639.
  18. ^ Pohl, Ira (1970). "First results on the effect of error in heuristic search". Machine Intelligence 5. Edinburgh University Press: 219–236. ISBN 978-0-85224-176-9. OCLC 1067280266.
  19. ^ Pearl, Judea (1984). Heuristics: Intelligent Search Strategies for Computer Problem Solving. Addison-Wesley. ISBN 978-0-201-05594-8.
  20. ^ Chen, Jingwei; Sturtevant, Nathan R. (2019). "Conditions for Avoiding Node Re-expansions in Bounded Suboptimal Search". Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence. International Joint Conferences on Artificial Intelligence Organization: 1220–1226.
  21. ^ Chen, Jingwei; Sturtevant, Nathan R. (2025-08-05). "Necessary and Sufficient Conditions for Avoiding Reopenings in Best First Suboptimal Search with General Bounding Functions". Proceedings of the AAAI Conference on Artificial Intelligence. 35 (5): 3688–3696. doi:10.1609/aaai.v35i5.16485. ISSN 2374-3468.
  22. ^ Pohl, Ira (August 1973). "The avoidance of (relative) catastrophe, heuristic competence, genuine dynamic weighting and computational issues in heuristic problem solving" (PDF). Proceedings of the Third International Joint Conference on Artificial Intelligence (IJCAI-73). Vol. 3. California, USA. pp. 11–17.
  23. ^ K?ll, Andreas; Hermann Kaindl (August 1992). "A new approach to dynamic weighting". Proceedings of the Tenth European Conference on Artificial Intelligence (ECAI-92). Vienna, Austria: Wiley. pp. 16–17. ISBN 978-0-471-93608-4.
  24. ^ Pearl, Judea; Jin H. Kim (1982). "Studies in semi-admissible heuristics". IEEE Transactions on Pattern Analysis and Machine Intelligence. 4 (4): 392–399. doi:10.1109/TPAMI.1982.4767270. PMID 21869053. S2CID 3176931.
  25. ^ Ghallab, Malik; Dennis Allard (August 1983). "Aε – an efficient near admissible heuristic search algorithm" (PDF). Proceedings of the Eighth International Joint Conference on Artificial Intelligence (IJCAI-83). Vol. 2. Karlsruhe, Germany. pp. 789–791. Archived from the original (PDF) on 2025-08-05.
  26. ^ Reese, Bj?rn (1999). AlphA*: An ε-admissible heuristic search algorithm (Report). Institute for Production Technology, University of Southern Denmark. Archived from the original on 2025-08-05. Retrieved 2025-08-05.
  27. ^ Klein, Dan; Manning, Christopher D. (2003). "A* parsing: fast exact Viterbi parse selection" (PDF). Proceedings of the 2003 Human Language Technology Conference of the North American Chapter of the Association for Computational Linguistics. pp. 119–126. doi:10.3115/1073445.1073461.
  28. ^ Kagan E.; Ben-Gal I. (2014). "A Group-Testing Algorithm with Online Informational Learning" (PDF). IIE Transactions. 46 (2): 164–184. doi:10.1080/0740817X.2013.803639. S2CID 18588494. Archived from the original (PDF) on 2025-08-05. Retrieved 2025-08-05.
  29. ^ Ferguson, Dave; Likhachev, Maxim; Stentz, Anthony (2005). "A Guide to Heuristic-based Path Planning" (PDF). Proceedings of the international workshop on planning under uncertainty for autonomous systems, international conference on automated planning and scheduling (ICAPS). pp. 9–18. Archived (PDF) from the original on 2025-08-05.
  30. ^ Nau, Dana S.; Kumar, Vipin; Kanal, Laveen (1984). "General branch and bound, and its relation to A? and AO?" (PDF). Artificial Intelligence. 23 (1): 29–58. doi:10.1016/0004-3702(84)90004-3. Archived (PDF) from the original on 2025-08-05.
  31. ^ "Variants of A*". theory.stanford.edu. Retrieved 2025-08-05.
  32. ^ Hansen, Eric A.; Zhou, Rong (2007). "Anytime Heuristic Search". Journal of Artificial Intelligence Research. 28: 267–297. arXiv:1110.2737. doi:10.1613/jair.2096. S2CID 9832874.
  33. ^ Fareh, Raouf; Baziyad, Mohammed; Rahman, Mohammad H.; Rabie, Tamer; Bettayeb, Maamar (2025-08-05). "Investigating Reduced Path Planning Strategy for Differential Wheeled Mobile Robot". Robotica. 38 (2): 235–255. doi:10.1017/S0263574719000572. ISSN 0263-5747. S2CID 181849209.
  34. ^ Pijls, Wim; Post, Henk. Yet another bidirectional algorithm for shortest paths (PDF) (Technical report). Econometric Institute, Erasmus University Rotterdam. EI 2009-10. Archived (PDF) from the original on 2025-08-05.
  35. ^ Goldberg, Andrew V.; Harrelson, Chris; Kaplan, Haim; Werneck, Renato F. "Efficient Point-to-Point Shortest Path Algorithms" (PDF). Princeton University. Archived (PDF) from the original on 18 May 2022.

Further reading

edit
edit
小肠疝气挂什么科 好马不吃回头草是什么意思 京畿是什么意思 omega3是什么 猪肉不能和什么一起吃
4月28日是什么日子 黄曲霉素是什么 背痒是什么原因 脖子上长个包挂什么科 身上长扁平疣是什么原因造成的
彩妆是什么意思 tf口红什么牌子 丛书是什么意思 喉咙有痰挂什么科 彩泥可以做什么
梦见借给别人钱是什么意思 小龙虾吃什么食物 农历正月初一是什么节日 土豆可以做什么美食 为什么感冒会头痛
宣肺是什么意思hcv9jop6ns7r.cn 自愈什么意思hcv8jop4ns8r.cn 为什么会打雷闪电hcv8jop8ns5r.cn 过敏打什么针hcv8jop4ns1r.cn 头晕吃什么药好hcv8jop5ns1r.cn
感觉是什么意思hcv9jop1ns3r.cn 吃茄子有什么坏处hcv9jop5ns1r.cn 姑姑的女儿叫什么hcv8jop8ns1r.cn 598是什么意思jasonfriends.com 政治面貌填什么hcv9jop2ns9r.cn
虱子长什么样子图片hcv9jop7ns2r.cn 肾病钾高吃什么食物好hcv9jop0ns2r.cn 清官是什么意思hcv8jop0ns5r.cn 苦荞茶有什么功效hcv8jop6ns7r.cn 干涉是什么意思hcv8jop6ns8r.cn
7月20号什么星座hcv9jop0ns1r.cn 白热化阶段是什么意思hcv9jop0ns5r.cn 玉兰片和竹笋有什么区别hcv8jop1ns3r.cn 过江龙是什么意思hcv8jop1ns8r.cn 为什么会有脚气hcv8jop0ns9r.cn
百度