一种更快的最短路径算法
A Faster Shortest Path Algorithm

原始链接: https://www.vals.ai/blogs/faster-shortest-path-algorithm

这项研究介绍了 **C-HD**,这是一种用于在具有非负实数权重的有向图中寻找精确最短路径的新型确定性算法。该算法由人工智能体协作团队开发,并使用 **Lean** 进行形式化验证,以确保其正确性和性能。 在 $m \le n \lfloor \log_2 n \rfloor^{3/4}$ 的特定密度范围内,C-HD 的复杂度达到了 $O(n + m + m \log(2 + \frac{m}{n+1}) + m^{1/3}(n \log(n+2))^{2/3})$。通过利用有界局部搜索并保持严格的局部不变性,该算法相比 Dijkstra 及其他顶尖方法减少了重复工作。 在 $m \approx n \log^{3/4} n$ 的图中,C-HD 在理论上比 Dijkstra 的 $O(n \log n)$ 界限有了渐近改进,达到 $O(n \log^{11/12} n)$。尽管这在理论计算机科学中是一个显著的多对数级进展,但研究人员指出,由于该结构涉及较大的常数,它更多是对算法性能的数学证明,而非针对实际应用的性能提升。该项目展示了多智能体协作在推动形式化数学验证和算法优化边界方面的潜力。

Hacker News 最新 | 过往 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 更快速的最短路径算法 ( vals.ai ) 6 点 由 leumon 38 分钟前发布 | 隐藏 | 过往 | 收藏 | 讨论 帮助 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

Problem

Shortest paths is a very simple problem. There is a graph of vertices and (possibly directed) edges that connect them. Each edge has a real number weight. Starting from some vertex, for every other vertex in the graph you want to find the minimum total weight of a path, or report that it is unreachable.

In the version I considered, the graph was directed, I required exact answers and was given non-negative real weights for the edges.

I assume that real number weights can be compared and added. Any operations the shortest path algorithm does internally (such as counting how many nodes are visited or storing distances on intermediate vertices) counts towards running time.

With this setup, the classic Dijkstra’s shortest path algorithm runs in O(m+nlogn)O(m+n\log n)

Given these bounds, there’s a broad area of the parameter space for mm as a function of nn where Dijkstra is better. So I invited my agents to figure out what’s possible if the weights were non-negative reals, and to prove correctness and efficiency using Lean, the formal verification tool.

Solution

After about 15 hours and 733 messages on the message board, the team had completed a proposed new algorithm for finding exact shortest-path distances in the directed graph setting. This algorithm, called C-HD, is presented in this Lean proof.

The algorithm handles local search which encounter unproductive edges quite well. It still uses priority comparisons, but a newly encountered vertex can count towards a search’s size limit as an unexplored leaf. The algorithm maintains local invariants (rules that stay true after each update), with careful edge deletion and a bounded local search. This enables it to achieve this bound within its certified range:

O ⁣(n+m+mlog ⁣(2+mn+1)+m1/3(nlog(n+2))2/3).O\!\left(n+m+m\log\!\left(2+\frac{m}{n+1}\right)+m^{1/3}\bigl(n\log(n+2)\bigr)^{2/3}\right).
联系我们 contact @ memedata.com