TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Reweighting a graph for faster shortest paths

52 点作者 mc超过 13 年前

5 条评论

repsilat超过 13 年前
One point this article skips over is that Dijkstra's algorithm can be used more generally to find a shortest paths tree to all destinations, whereas A* is really just a single-source, single-destination pathfinding algorithm. Adding the heuristic obviously gets you to termination faster, but the work done by Dijkstra's algorithm isn't wasted if you're actually going to use it later.
Sharlin超过 13 年前
Another useful way to see A* is as the synthesis of two different search algorithms. To compute which untraversed node to choose next, A* uses the function<p><pre><code> f(n) = g(n) + h(n) </code></pre> where g(n) is the actual traversed distance from the start to n, and h(n) is an (optimistic) approximation of the distance from n to the goal. Now, without making any other modifications to the algorithm, if we substitute<p><pre><code> g(n) = 0 </code></pre> what we get is the greedy "best-first" search [1]. If, on the other hand, we select<p><pre><code> h(n) = 0 </code></pre> we get a single-goal variant of Dijkstra's algorithm [2].<p>[1] <a href="http://en.wikipedia.org/wiki/Best-first_search" rel="nofollow">http://en.wikipedia.org/wiki/Best-first_search</a><p>[2] <a href="http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm" rel="nofollow">http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm</a>
vecter超过 13 年前
When I was taught A*, I was just given the mathematical definition of admissible and left to run with that. The intuition the author gave transforms some vague notion of a weight function with certain properties into an almost obvious mental picture. I wish more things were taught this way at school.
ot超过 13 年前
These slides summarize pretty much all the recent developments in shortest path algorithms:<p><a href="http://research.microsoft.com/en-us/people/goldberg/erice.pdf" rel="nofollow">http://research.microsoft.com/en-us/people/goldberg/erice.pd...</a><p>There are example with maps overlaid with the nodes visited by each algorithm before finding the solution. The difference between Dijkstra, A* and landmarks-based algorithms is impressive!
suivix超过 13 年前
It's funny how he posted it on Livejournal. Talk about a dead site.