# 唐纳德·B·约翰逊

**唐纳德·B·约翰逊**（Donald B. Johnson）是一位计算机科学家，他的名字与两个至今仍在标准使用的图算法联系在一起：一个是1977年提出的稀疏网络全源最短路径算法，另一个是1975年提出的枚举有向图所有基本回路的算法。关于他的生平记载十分稀少。检索到的一手资料、学术文献或新闻报道均未记录他的雇主、教育背景或去世情况，而常与这个名字联系在一起的[贝尔实验室](https://www.edgepedia.org/zh/bell-labs)职业生涯，实际上属于另一位计算机科学家——[大卫·S·约翰逊](https://www.edgepedia.org/zh/david-s-johnson)。

| 关键事实 | 详情 |
|---|---|
| 最短路径论文 | 《稀疏网络中最短路径的高效算法》，《ACM杂志》24(1)：1–13，1977<sup>[1](https://dl.acm.org/doi/10.1145/321992.321993)</sup> |
| 回路论文 | 《寻找有向图的所有基本回路》，《SIAM计算杂志》4(1)：77–84，1975<sup>[2](https://www.cs.tufts.edu/comp/150GA/homeworks/hw1/Johnson%2075.PDF)</sup> |
| 回路复杂度上界 | 对于n个顶点、e条边、c个回路，时间复杂度为O((n+e)(c+1))，空间复杂度为O(n+e)<sup>[2](https://www.cs.tufts.edu/comp/150GA/homeworks/hw1/Johnson%2075.PDF)</sup> |
| 最短路径复杂度上界 | 对于任意权重的全源最短路径，通过Bellman–Ford重赋权加重复Dijkstra，总复杂度为O(VE + V² log V)<sup>[3](https://ocw.tau.edu.ng/courses/electrical-engineering-and-computer-science/6-046j-design-and-analysis-of-algorithms-spring-2015/lecture-notes/MIT6_046JS15_lec11.pdf)</sup> |
| 有记载的所属机构 | 1975年论文发表时为宾夕法尼亚州立大学计算机科学系<sup>[2](https://www.cs.tufts.edu/comp/150GA/homeworks/hw1/Johnson%2075.PDF)</sup> |
| 早期工作 | 康奈尔技术报告《最短路径算法》（技术报告73-169，1973年5月）及1973年关于Dijkstra算法的一篇短文，《ACM杂志》20(3)：385–388<sup>[1](https://dl.acm.org/doi/10.1145/321992.321993)</sup> |
| 仍在使用的实现 | JGraphT、NetworkX和Boost图库均包含以他命名的算法<sup>[4](https://github.com/jgrapht/jgrapht/blob/master/jgrapht-core/src/main/java/org/jgrapht/alg/shortestpath/JohnsonShortestPaths.java)</sup><sup> • </sup><sup>[5](https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.shortest_paths.weighted.johnson.html)</sup><sup> • </sup><sup>[6](https://www.boost.org/doc/libs/latest/libs/graph/doc/johnson_all_pairs_shortest.html)</sup> |

## 记录记载了什么，没有记载什么

有记载的职业生涯由四篇出版物构成。1975年的回路论文于1973年12月10日收稿，1974年6月10日修订，署名单位为宾夕法尼亚州立大学大学公园校区计算机科学系<sup>[2](https://www.cs.tufts.edu/comp/150GA/homeworks/hw1/Johnson%2075.PDF)</sup>。1977年的最短路径论文引用了他自己早期的作品：一份康奈尔技术报告《最短路径算法》（技术报告73-169，康奈尔大学计算机科学系，伊萨卡，1973年5月），以及1973年发表在《ACM杂志》20(3)：385–388上关于Dijkstra最短路径算法的一篇短文<sup>[1](https://dl.acm.org/doi/10.1145/321992.321993)</sup>。DBLP确认了1977年的条目，署名唐纳德·B·约翰逊<sup>[7](http://www.sigmod.org/publications/dblp/db/journals/jacm/Johnson77.html)</sup>。

**未有记载的内容。** 检索到的资料均未说明他在哪里受教育、他的导师或合作者是谁、除了在一篇论文上标注的宾夕法尼亚州立大学隶属关系之外他还在哪里工作过，以及他去世的情况。特别需要指出的是，以这个名字搜索到的漫长的贝尔电话实验室和AT&T职业生涯属于大卫·S·约翰逊，是另一位计算机科学家；没有任何资料将唐纳德·B·约翰逊与贝尔实验室联系起来。读者应当注意，任何叙述贝尔实验室职业生涯的“那位”唐纳德·约翰逊传记，都是把两个人混为一谈了。

## 约翰逊的全源最短路径算法

问题是在加权有向图中找到每一对顶点之间的最短路径。Dijkstra算法能以近线性时间解决单源版本，但仅当所有边权非负时适用；Bellman–Ford算法能处理负权重，但每次运行代价为O(VE)，因此从每个顶点各运行一次的总代价为O(V²E)<sup>[8](https://algo.ics.hawaii.edu/~nodari/teaching/s15/Notes/Topic-19.html)</sup>。约翰逊1977年的思路是：在保持最短路径不变的前提下，让所有边权变为非负，这样就可以从每个顶点运行Dijkstra了<sup>[9](https://ocw.mit.edu/courses/6-006-introduction-to-algorithms-spring-2020/7d7d5c35490f41b7b037cafbda7019ad_MIT6_006S20_lec14.pdf)</sup>。

重赋权的操作如下。添加一个虚拟顶点，用零权重边连接到其他所有顶点，从它出发运行一次Bellman–Ford，耗时O(VE)；这一步要么发现负权重回路——此时最短路径无定义，算法终止——要么为每个顶点产生一个势函数h(v)<sup>[10](http://www.cse.cuhk.edu.hk/~taoyf/course/3160/lec/0p2_apsp-johnson.pdf)</sup>。然后将每条边的权重替换为w(u,v) + h(u) − h(v)，该值非负，其效果是对源点加权重、对目标点减权重，因此固定两点之间每条路径的长度变化量相同，最短路径保持不变<sup>[8](https://algo.ics.hawaii.edu/~nodari/teaching/s15/Notes/Topic-19.html)</sup>。

总代价为：重赋权步骤O(VE)，从V个顶点各运行一次Dijkstra，总计O(VE + V² log V)<sup>[3](https://ocw.tau.edu.ng/courses/electrical-engineering-and-computer-science/6-046j-design-and-analysis-of-algorithms-spring-2015/lecture-notes/MIT6_046JS15_lec11.pdf)</sup>。MIT 6.006课程笔记给出的上界相同，写作|V| · O(|V| log |V| + |E|)<sup>[9](https://ocw.mit.edu/courses/6-006-introduction-to-algorithms-spring-2020/7d7d5c35490f41b7b037cafbda7019ad_MIT6_006S20_lec14.pdf)</sup>。逐步计算为：构建增广图Θ(V)，Bellman–Ford O(VE)，重赋权Θ(E)，恢复真实距离Θ(V²)，使用二叉堆重复运行Dijkstra为O(VE log V)，使用[斐波那契堆](https://www.edgepedia.org/zh/fibonacci-heap)可改进为O(V² log V + VE)<sup>[8](https://algo.ics.hawaii.edu/~nodari/teaching/s15/Notes/Topic-19.html)</sup>。

1977年《ACM杂志》论文本身用其自己的记号给出了更紧的界：非负网络上的单源问题为O(min(n^(1+1/k)+e, n+e) log n)，在稠密网络上即为O(e)；全源问题为O(min(n^(2+1/k)+ne, n² log n + ne log n))，使用了一种新的优先队列实现和一类“弧集划分”算法<sup>[1](https://dl.acm.org/doi/10.1145/321992.321993)</sup>。

## 1975年的基本回路算法

枚举所有基本回路之所以代价高昂，是因为回路数量随n增长的速度可以超过指数级的2^n<sup>[2](https://www.cs.tufts.edu/comp/150GA/homeworks/hw1/Johnson%2075.PDF)</sup>。约翰逊的算法能在O((n+e)(c+1))时间和O(n+e)空间内找到所有回路<sup>[2](https://www.cs.tufts.edu/comp/150GA/homeworks/hw1/Johnson%2075.PDF)</sup>，改进了此前基于Tiernan回溯的算法所实现的O(n·e·(c+1))最优上界<sup>[2](https://www.cs.tufts.edu/comp/150GA/homeworks/hw1/Johnson%2075.PDF)</sup>。

其机制将深度优先搜索与阻塞/解阻方案相结合：当从起始顶点s出发的搜索穷尽了一条路径而未找到回路时，路径上的顶点被阻塞，以免重复访问无结果的路径；只有当它们能再次位于经过s的回路上时才被解阻<sup>[11](https://arxiv.org/html/2512.08392v4)</sup>。相对于Tiernan和Tarjan的改进来自一个简单性质：在输出序列中，任意一个回路到下一个回路之间，算法对每条边至多考虑两次<sup>[2](https://www.cs.tufts.edu/comp/150GA/homeworks/hw1/Johnson%2075.PDF)</sup>。

在论文自身的基准测试中，产生15、30、60、120、180和240个回路的运行分别耗时.03、.11、.32、1.17、2.61和4.46秒，而竞争算法分别耗时.06、.27、1.67、11.51、36.89和86.66秒，加速比为2倍到19.4倍<sup>[2](https://www.cs.tufts.edu/comp/150GA/homeworks/hw1/Johnson%2075.PDF)</sup>。约翰逊指出，除了极小的图之外，该算法始终快于Tarjan的算法，且在任何图上都不会慢超过一个常数因子，他以此作为该算法适合通用场景的理由<sup>[2](https://www.cs.tufts.edu/comp/150GA/homeworks/hw1/Johnson%2075.PDF)</sup>。

## 最短路径算法的比较

| 方法 | 权重 | 时间 | 适用场景 |
|---|---|---|---|
| Floyd–Warshall | 任意边权，若无负权重回路 | O(V³)<sup>[8](https://algo.ics.hawaii.edu/~nodari/teaching/s15/Notes/Topic-19.html)</sup> | 稠密图<sup>[6](https://www.boost.org/doc/libs/latest/libs/graph/doc/johnson_all_pairs_shortest.html)</sup> |
| 重复Dijkstra（V次运行） | 仅非负 | O(VE + V² log V)<sup>[3](https://ocw.tau.edu.ng/courses/electrical-engineering-and-computer-science/6-046j-design-and-analysis-of-algorithms-spring-2015/lecture-notes/MIT6_046JS15_lec11.pdf)</sup> | 无负边的稀疏图 |
| 重复Bellman–Ford（V次运行） | 任意边权，若无负权重回路 | O(V²E)<sup>[8](https://algo.ics.hawaii.edu/~nodari/teaching/s15/Notes/Topic-19.html)</sup> | 被约翰逊方法支配 |
| 约翰逊 | 任意边权，若无负权重回路 | O(VE + V² log V)<sup>[3](https://ocw.tau.edu.ng/courses/electrical-engineering-and-computer-science/6-046j-design-and-analysis-of-algorithms-spring-2015/lecture-notes/MIT6_046JS15_lec11.pdf)</sup> | 含负边的稀疏图 |

约翰逊的算法在达到重复Dijkstra上界的同时消除了非负性限制，因此在稀疏图上优于Floyd–Warshall的O(V³)<sup>[8](https://algo.ics.hawaii.edu/~nodari/teaching/s15/Notes/Topic-19.html)</sup>。MIT 6.046J课程笔记将这些结果列为已知最优，“不知道如何超越|V|× Dijkstra”<sup>[3](https://ocw.tau.edu.ng/courses/electrical-engineering-and-computer-science/6-046j-design-and-analysis-of-algorithms-spring-2015/lecture-notes/MIT6_046JS15_lec11.pdf)</sup>。各库的指导文档在适用场景划分上一致：Boost推荐稀疏图使用johnson_all_pairs_shortest_paths，稠密图使用floyd_warshall_all_pairs_shortest_paths，同时将约翰逊的复杂度列为O(VE log V)<sup>[6](https://www.boost.org/doc/libs/latest/libs/graph/doc/johnson_all_pairs_shortest.html)</sup>。NetworkX文档给出O(n² log n + nm)，并指出对于稠密图，约翰逊算法可能快于Floyd–Warshall算法；它还提供了一个并行后端，将节点分块并逐块运行约翰逊算法<sup>[5](https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.shortest_paths.weighted.johnson.html)</sup>。JGraphT将其实现为JohnsonShortestPaths，运行时间为O(nm + n² log n)，当存在负回路时抛出NegativeCycleDetectedException<sup>[4](https://github.com/jgrapht/jgrapht/blob/master/jgrapht-core/src/main/java/org/jgrapht/alg/shortestpath/JohnsonShortestPaths.java)</sup>。

## 近期进展

在回路枚举方面，约翰逊的算法仍是基准。2025年的一篇回顾论文称其为有向图领域最具影响力的算法，并在其阻塞/解阻机制的基础上构建了有界长度简单回路枚举<sup>[11](https://arxiv.org/html/2512.08392v4)</sup>；2021年的一篇综述指出，它仍是该问题迄今为止已知最优的算法<sup>[12](https://arxiv.org/html/2105.10094v2)</sup>。2012年的一项分析指出，近40年来没有提出理论上更快的无向回路列举方案，该问题仍然活跃，在生物信息学中有新的应用——在研究生物相互作用图时提出了两种算法<sup>[13](https://ar5iv.labs.arxiv.org/html/1205.2766)</sup>。

在全源最短路径方面，后续工作将约翰逊的重赋权作为组件使用而非取代它：一篇《离散应用数学》论文在非负长度下以O(mn + m lg n + nT(m,n))计算全源最短路径，结合约翰逊的重赋权和拓扑排序，对于任意边长的有向无环图可达到O(mn + m lg n)<sup>[14](https://dl.acm.org/doi/10.1016/j.dam.2017.03.008)</sup>。

## References

1. [Donald B. Johnson, "Efficient Algorithms for Shortest Paths in Sparse Networks," J. ACM 24(1): 1–13 (1977)](https://dl.acm.org/doi/10.1145/321992.321993)
2. [Donald B. Johnson, "Finding All the Elementary Circuits of a Directed Graph," SIAM J. Comput. 4(1): 77–84 (1975), scanned PDF](https://www.cs.tufts.edu/comp/150GA/homeworks/hw1/Johnson%2075.PDF)
3. [MIT 6.046J Lecture 11: All-Pairs Shortest Paths](https://ocw.tau.edu.ng/courses/electrical-engineering-and-computer-science/6-046j-design-and-analysis-of-algorithms-spring-2015/lecture-notes/MIT6_046JS15_lec11.pdf)
4. [JohnsonShortestPaths.java, JGraphT](https://github.com/jgrapht/jgrapht/blob/master/jgrapht-core/src/main/java/org/jgrapht/alg/shortestpath/JohnsonShortestPaths.java)
5. [johnson — NetworkX 3.7 documentation](https://networkx.org/documentation/stable/reference/algorithms/generated/networkx.algorithms.shortest_paths.weighted.johnson.html)
6. [Johnson All Pairs Shortest Paths, Boost Graph Library](https://www.boost.org/doc/libs/latest/libs/graph/doc/johnson_all_pairs_shortest.html)
7. [DBLP record: J. ACM 24(1): 1–13 (1977)](http://www.sigmod.org/publications/dblp/db/journals/jacm/Johnson77.html)
8. [ICS 311 #19: All-Pairs Shortest Paths, University of Hawaii course notes](https://algo.ics.hawaii.edu/~nodari/teaching/s15/Notes/Topic-19.html)
9. [MIT 6.006 Lecture 14: Johnson's Algorithm](https://ocw.mit.edu/courses/6-006-introduction-to-algorithms-spring-2020/7d7d5c35490f41b7b037cafbda7019ad_MIT6_006S20_lec14.pdf)
10. [CUHK CSE 3160 lecture notes: All-Pairs Shortest Paths](http://www.cse.cuhk.edu.hk/~taoyf/course/3160/lec/0p2_apsp-johnson.pdf)
11. [Finding All Bounded-Length Simple Cycles in a Directed Graph — Revisited (arXiv, 2025)](https://arxiv.org/html/2512.08392v4)
12. [Finding All Bounded-Length Simple Cycles in a Directed Graph (arXiv, 2021)](https://arxiv.org/html/2105.10094v2)
13. [Ferreira, Meeks, Uno, "Optimal Listing of Cycles and st-Paths in Undirected Graphs" (2012)](https://ar5iv.labs.arxiv.org/html/1205.2766)
14. ["Solving all-pairs shortest path by single-source computations," Discrete Applied Mathematics (2017)](https://dl.acm.org/doi/10.1016/j.dam.2017.03.008)
The biographical record is thin: no retrieved primary, official, scholarly or journalistic source documents Donald B. Johnson's employers, education, or 1994 death, and the Bell Labs career often associated with this name belongs to a different computer scientist (David S. Johnson).

---
*Initially written Oct 10, 2026 · Edited: Oct 11, 2026; Oct 15, 2026*

Topic: 技术与人造世界 › 工程师与计算机科学家 › 计算机科学家与人工智能研究者 › Researchers in theoretical computer science, cryptography, quantum computing, graphics, and HCI › Algorithms and data structures

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/donald-b-johnson

English original: https://www.edgepedia.org/donald-b-johnson
