Mar 10, 2026 1 min read en algorithm / review Algorithm Miscellany - Search Algorithm Miscellany series: A* search and iterative deepening search algorithms. Algorithm Miscellany (9 posts) 1 Algorithm Miscellany - Basics 2 Algorithm Miscellany - Search 3 Algorithm Miscellany - Dynamic Programming 4 Algorithm Miscellany - String 5 Algorithm Miscellany - Mathematics 6 Algorithm Miscellany - Data Structures 7 Algorithm Miscellany - Graph Theory 8 Algorithm Miscellany - Computational Geometry 9 Algorithm Miscellany - Miscellaneous A*算法# A*算法的目标是找到有向图上从起点sss到终点ttt的最短路径。设d(x,y)d(x,y)d(x,y)为结点xxx与yyy之间的距离,也就是它们之间最短路径的长度。记g(x)=d(s,x)g(x) = d(s, x)g(x)=d(s,x)为从起点sss到结点xxx的距离函数,h∗(x)h^{*}(x)h∗(x)为从结点 f(x)=g(x)+h(x)f(x) = g(x) + h(x) f(x)=g(x)+h(x) 搜索时,A∗A^{*}A∗算法每次从优先队列中取出一个fff最小的结点。然后,将它的所有后继结点xxx都推入优先队列中,并利用实际记录的g(x)g(x)g(x)和估计的h(x)h(x)h(x)更新f(x)f(x)f(x) 性质# 由于h∗(x)h^{*}(x)h∗(x)的 迭代加深搜索#