TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Universal optimality of Dijkstra via beyond-worst-case heaps

203 pointsby foweltschmerz7 months ago

10 comments

foota7 months ago
I&#x27;ve gone down a bit of a rabbit hole on path finding in the last week or two (most recently, this isn&#x27;t the first time). When you have some knowledge of the topology of the graph you can use different techniques to do better than djikstra&#x27;s.<p>Of course, if you have lots of time and space and a completely static graph, you can run all pairs shortest paths and simply store all the results for O(1) path lookup, but there are intermediates for varying types of graphs. This stack exchange article is a good overview: <a href="https:&#x2F;&#x2F;cstheory.stackexchange.com&#x2F;questions&#x2F;11855&#x2F;how-do-the-state-of-the-art-pathfinding-algorithms-for-changing-graphs-d-d-l" rel="nofollow">https:&#x2F;&#x2F;cstheory.stackexchange.com&#x2F;questions&#x2F;11855&#x2F;how-do-th...</a>.<p>I&#x27;ve been wondering about how well D* lite would perform in practice with a somewhat varying graph. I read some suggestions that if the graph is changing even a bit on occasion, then it will mostly degrade to A*, since many changed paths would need to be re-evaluated.<p>In the context of games, I&#x27;ve also been thinking about a technique called true distance heurustics (TDH), where you essentially precompute the distances between some fixed set of nodes, and then use those as a part of the heurustic for A* (or D* lite in this case), but it seems like updating these TDH in the case of a changing graph might introduce just as much overhead as not having them in the first place. It might be an interesting trade off though, if you have some &quot;lines&quot; (e.g., think train lines) that are much faster than roadways, you could handle each of these specially via the TDH, and in exchange you would be able to assume a lower &quot;max speed&quot; for use with the A* heurustic, allowing you to explore fewer paths (since with a lower &quot;max speed&quot; paths will more rapidly increase in cost), whereas if you had to assume all car based paths could move as fast as a train, you would have to explore more paths.
评论 #41949734 未加载
评论 #41954578 未加载
评论 #41951140 未加载
评论 #41950248 未加载
blt7 months ago
The paper&#x27;s name is shorter than this post title, and summarizes the result much better.
评论 #41949144 未加载
vanderZwan7 months ago
&gt; <i>Our universal optimality result reveals a surprisingly clean interplay between this property and Dijkstra’s algorithm: Any heap with the working set property enables the algorithm to efficiently leverage every structural attribute of the graph it operates on, to the fullest extent that any comparison-based algorithm possibly can.</i><p>That last bit makes me wonder: what would a shortest path algorithm <i>without</i> comparisons look like? Are there also &quot;radix sort&quot; like approaches to shortest-path algorithms that surpass comparison-based algorithms or something?
评论 #41952031 未加载
评论 #41950405 未加载
评论 #41954250 未加载
westurner7 months ago
&quot;Universal Optimality of Dijkstra via Beyond-Worst-Case Heaps&quot; (2024) <a href="https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2311.11793" rel="nofollow">https:&#x2F;&#x2F;arxiv.org&#x2F;abs&#x2F;2311.11793</a> :<p>&gt; Abstract: <i>This paper proves that Dijkstra&#x27;s shortest-path algorithm is universally optimal in both its running time and number of comparisons when combined with a sufficiently efficient heap data structure.</i><p>Dijkstra&#x27;s algorithm: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Dijkstra%27s_algorithm" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Dijkstra%27s_algorithm</a><p>NetworkX docs &gt; Reference &gt; Algorithms &gt; Shortest Paths: <a href="https:&#x2F;&#x2F;networkx.org&#x2F;documentation&#x2F;stable&#x2F;reference&#x2F;algorithms&#x2F;shortest_paths.html" rel="nofollow">https:&#x2F;&#x2F;networkx.org&#x2F;documentation&#x2F;stable&#x2F;reference&#x2F;algorith...</a><p>networkX.algorithms.shortest_path.dijkstra_path: <a href="https:&#x2F;&#x2F;networkx.org&#x2F;documentation&#x2F;stable&#x2F;reference&#x2F;algorithms&#x2F;generated&#x2F;networkx.algorithms.shortest_paths.weighted.dijkstra_path.html" rel="nofollow">https:&#x2F;&#x2F;networkx.org&#x2F;documentation&#x2F;stable&#x2F;reference&#x2F;algorith...</a> <a href="https:&#x2F;&#x2F;github.com&#x2F;networkx&#x2F;networkx&#x2F;blob&#x2F;main&#x2F;networkx&#x2F;algorithms&#x2F;shortest_paths&#x2F;weighted.py">https:&#x2F;&#x2F;github.com&#x2F;networkx&#x2F;networkx&#x2F;blob&#x2F;main&#x2F;networkx&#x2F;algo...</a><p>&#x2F;? Dijkstra manim: <a href="https:&#x2F;&#x2F;www.google.com&#x2F;search?q=dijkstra%20manim" rel="nofollow">https:&#x2F;&#x2F;www.google.com&#x2F;search?q=dijkstra%20manim</a>
akoboldfrying7 months ago
Robert Tarjan&#x27;s name is on a simply astounding number of breakthrough papers in graph algorithms, spanning decades.
评论 #41952776 未加载
m0llusk7 months ago
In most real situations a graph is likely to be a model with some expected characteristics or perhaps data regarding real situations. Either way with modern computing it seems like in many cases using machine learning to predict the path or next steps on the path might actually end up being a more optimal method. The issue is how much data and modeling is available and how any processing of that would best be accounted for in final results that make use of any analysis.
fiddlerwoaroof7 months ago
Does this mean that Dijkstra’s algorithm can perform better than something like A*?
评论 #41949521 未加载
评论 #41949671 未加载
评论 #41949376 未加载
评论 #41950157 未加载
评论 #41949778 未加载
评论 #41949402 未加载
评论 #41955403 未加载
评论 #41949704 未加载
评论 #41949344 未加载
moron4hire7 months ago
This came up for me not long ago. A* is a specialization of Dijkstra&#x27;s that is the canonical &quot;path finding algorithm&quot; for game development. A* is good for finding how to get from a specific point A to a specific point B. But I wanted to know how to get from any point A to a list of point Bs. And so it turned out that the extra work that Dijkstra&#x27;s does that A* skips is exactly the work you want when doing such a thing. It&#x27;s also cacheable, which is incredible in the modern era of having basically infinite memory for this sort of thing.
评论 #41950010 未加载
impure7 months ago
A* has entered the chat
评论 #41949555 未加载
heraldgeezer7 months ago
I recognize the name due to studying CCNA in the past. His name comes up with OSPF routing protocol.