# 分布式算法

分布式算法是一种并发算法，设计用于由多个处理器执行，这些处理器不共享公共内存或时钟，仅通过交换消息进行协调。“分布式算法”一词最初指为分布在大地理区域上的处理器设计的算法，但其范围后来扩大到涵盖局域网和共享内存多处理器的算法，因为这些场景中所使用的算法有许多共同之处。<sup>[1](https://www.oreilly.com/library/view/distributed-algorithms/9781558603486/OEBPS/B9781558603486500018.htm)</sup> 分布式算法出现在电信、分布式信息处理、科学计算以及从紧耦合多处理器到互联网的各种系统的协调之中。<sup>[1](https://www.oreilly.com/library/view/distributed-algorithms/9781558603486/OEBPS/B9781558603486500018.htm)</sup><sup> • </sup><sup>[2](https://gyires.inf.unideb.hu/KMITT/a52/ch01.html)</sup>

| 关键事实 | 详情 |
|---|---|
| 定义性条件 | 各进程拥有自己的内存，在没有公共物理时钟的情况下运行，通过网络上的消息传递进行通信<sup>[3](https://www.cambridge.org/core/books/abs/distributed-computing/introduction/C1F1F226654B27B699F31F1AB3B33ED4)</sup> |
| 两种通信范式 | 消息传递与共享内存<sup>[4](https://www.krchowdhary.com/distributed_algos/1-intro.pdf)</sup> |
| LOCAL 模型 | 同步轮次，消息大小不限；一个 t 轮算法恰好是从每个节点的 t 跳邻域到其输出的函数<sup>[5](https://disco.ethz.ch/courses/podc/lecturenotes/LOCAL.pdf)</sup> |
| CONGEST 模型 | 与 LOCAL 相同，但每条消息至多携带 O(log n) 比特，足以容纳常数个节点标识符<sup>[5](https://disco.ethz.ch/courses/podc/lecturenotes/LOCAL.pdf)</sup> |
| 核心不可能性结果 | 费舍尔、林奇和帕特森（JACM，1985）：在异步系统中，即使只有一个故障进程，共识也不可能达成<sup>[6](https://www.cs.rochester.edu/u/scott/courses/458/notes/FLP.pdf)</sup> |
| CONGEST 中的全局问题 | 最小生成树、最小割和最短路径计算在一般图上具有约为 \( D + \sqrt{n} \) 轮的下界，其中 D 为网络直径<sup>[5](https://disco.ethz.ch/courses/podc/lecturenotes/LOCAL.pdf)</sup> |
| 确定性 vs. 随机化的差距 | 对于极大独立集和 (Δ+1)-着色，随机化复杂度为 n 的多对数级，而最佳确定性复杂度通常为 \( 2^{O(\sqrt{\log n})} \)<sup>[7](https://doi.org/10.1145/3055399.3055471)</sup> |

## 系统模型

分布式算法的设计与分析均针对明确的时间和通信模型进行。异步性意味着各个计算设备上事件的绝对时间和相对时间往往无法精确获知。<sup>[2](https://gyires.inf.unideb.hu/KMITT/a52/ch01.html)</sup> 第三类模型——部分同步系统——假设时间保证仅从某一时刻起才成立。<sup>[8](https://ocw.iti.hr/courses/electrical-engineering-and-computer-science/6-852j-distributed-algorithms-fall-2009/lecture-notes/MIT6_852JF09_lec25.pdf)</sup>

**图问题的网络模型。** 在 LOCAL 模型中——该模型由耶路撒冷希伯来大学计算机科学家纳坦·利尼尔（Nathan Linial）形式化，其 1987 年的 FOCS 论文开创了这一领域——一个 n 节点图的每个节点上驻留一个进程，该进程知道 n 及其自身的唯一标识符；每一轮中，每个节点进行计算、向所有邻居发送消息并接收它们的消息，消息大小和本地计算量均不受限制。<sup>[5](https://disco.ethz.ch/courses/podc/lecturenotes/LOCAL.pdf)</sup><sup> • </sup><sup>[9](https://epubs.siam.org/doi/10.1137/0221015)</sup> 由于消息不受限制，一个 t 轮 LOCAL 算法等价于将每个节点的 t 跳邻域映射到其输出的函数，因此该模型在数学意义上刻画了图问题的局部性。<sup>[5](https://disco.ethz.ch/courses/podc/lecturenotes/LOCAL.pdf)</sup> CONGEST 模型增加了现实的带宽限制，将每条消息限制为 O(log n) 比特。<sup>[5](https://disco.ethz.ch/courses/podc/lecturenotes/LOCAL.pdf)</sup>

两种模型之间的差距可能很大。检测 4-环在 LOCAL 模型中轻而易举，但在 CONGEST 中需要 \( \Theta(\sqrt{n}) \) 轮。<sup>[10](https://www.sciencedirect.com/science/article/abs/pii/S0304397524005693)</sup>

## 核心问题

该领域研究的经典任务包括领导者选举、广播与汇聚广播、广度优先搜索、最短路径、生成树与最小生成树、互斥、资源分配、分布式提交、时钟同步和共识。<sup>[11](https://ocw.mit.edu/courses/6-852j-distributed-algorithms-fall-2009/pages/lecture-notes/)</sup> 在共享内存系统中，相应的问题是互斥、原子对象与快照，以及无等待可计算性。<sup>[11](https://ocw.mit.edu/courses/6-852j-distributed-algorithms-fall-2009/pages/lecture-notes/)</sup>

**时间假设下的互斥与共识。** 时间模型的强度决定了哪些问题可解。在异步系统中，使用少于 n 个共享寄存器的互斥是不可能的，但在定时系统中可解，且有匹配的时间下界；在时间假设仅从某一时刻起成立的系统中，无法同时保证安全性和进展性。在有 f 个故障的系统中，共识在异步系统中不可能达成，在定时系统中可解且有匹配的界，而在最终定时系统中当 n > 2f 时可同时保证安全性和活性。<sup>[8](https://ocw.iti.hr/courses/electrical-engineering-and-computer-science/6-852j-distributed-algorithms-fall-2009/lecture-notes/MIT6_852JF09_lec25.pdf)</sup>

## 不可能性结果与逻辑时间

**FLP 定理。** 迈克尔·费舍尔（Michael Fischer）、南希·林奇（Nancy Lynch）和迈克尔·帕特森（Michael Paterson）于 1985 年 4 月在《ACM 杂志》上证明：在消息异步且延迟任意的假设下，即使所有初始投票均为 0 或 1、所有消息最终都被送达、故障进程为故障停止型，共识也无法达成；更复杂的提案、不可靠的消息或拜占庭行为只会使情况更糟。<sup>[6](https://www.cs.rochester.edu/u/scott/courses/458/notes/FLP.pdf)</sup> 这一结果影响了实用共识协议（如 Paxos）的设计，Paxos 与故障检测器一起被教授，作为绕开异步不可能性的一种途径。<sup>[11](https://ocw.mit.edu/courses/6-852j-distributed-algorithms-fall-2009/pages/lecture-notes/)</sup>

**无时钟的事件排序。** 莱斯利·兰波特（Leslie Lamport）的论文《时间、时钟与分布式系统中事件的排序》（《ACM 通讯》第 21 卷第 7 期，1978 年 7 月，第 558–565 页）引入了使用时间戳来提供与因果顺序一致的事件全序，其依据是狭义相对论中的一个观察：只有由可能的因果影响所定义的偏序才是不变量。该论文获得了 2000 年 PODC 影响力论文奖，该奖项后来更名为埃兹赫尔·W.

## 分布式图算法

该领域的一大分支研究图问题，其中每个节点仅持有局部信息，并在同步轮次中与邻居交换消息，设计重点在于轮复杂度、消息大小和近似质量之间的权衡。<sup>[13](https://www.nature.com/nature-index/topics/l4/distributed-algorithms-for-graph-optimization)</sup>

**来自局部性的下界。** 利尼尔 1987 年的结果确立了局部性本身就会带来代价：对 n-环进行 3-着色需要 \( \Omega(\log^{*} n) \) 时间，这一下界由科尔和维什金的早期工作证明是紧的；n-环中的极大独立集无法在快于 \( \Omega(\log^{*} n) \) 的时间内找到；半径为 r 的 d-正则树无法在 \( 2r/3 \) 时间内用少于 \( \sqrt{d} \) 种颜色着色。<sup>[9](https://epubs.siam.org/doi/10.1137/0221015)</sup><sup> • </sup><sup>[14](https://cris.huji.ac.il/en/publications/distributive-graph-algorithms-global-solutions-from-local-data/)</sup> 对于极大独立集和 (Δ+1)-着色等问题，随机化多对数复杂度与确定性 \( 2^{O(\sqrt{\log n})} \) 复杂度之间存在指数级差距，理解这一差距被认为是分布式图算法中核心的长期未解问题之一。<sup>[7](https://doi.org/10.1145/3055399.3055471)</sup>

**全局问题与消息复杂度。** 对于解依赖于远处信息的全局问题，如最小生成树、最小割和最短路径，一般图在 CONGEST 中具有约为 \( D + \sqrt{n} \) 轮的下界，过去十年的算法在多对数因子内与之匹配。<sup>[5](https://disco.ethz.ch/courses/podc/lecturenotes/LOCAL.pdf)</sup> 经典的 GHS 最小生成树算法通过片段构建树，每个片段选择连接它到另一片段的最轻边，每次迭代片段数至少减半。<sup>[15](https://doi.org/10.1145/3694966)</sup> 消息复杂度的行为与轮复杂度不同：最小顶点覆盖、最小支配集和最大独立集在 CONGEST 中的精确多项式轮计算，所需消息数的下界为 \( \tilde{\Theta}(n^{3}) \)，且这一下界可以达到；常数因子近似所需消息数的下界则为 \( \tilde{\Theta}(n^{2}) \)，且同样可以达到，精确解与近似解之间存在鲜明的分离。<sup>[16](https://drops.dagstuhl.de/storage/00lipics/lipics-vol287-itcs2024/LIPIcs.ITCS.2024.41/LIPIcs.ITCS.2024.41.pdf)</sup>

## 大规模图处理

实际系统在大规模上实现分布式图算法。谷歌的 Pregel 在 SIGMOD 2010 上被描述，是一个用于云端图处理的迭代式以顶点为中心的框架，其计算在整体同步并行风格的执行下以超步推进。<sup>[17](https://research.google/pubs/pregel-a-system-for-large-scale-graph-processing/)</sup><sup> • </sup><sup>[18](https://www.researchgate.net/publication/281144895_Partitioning_Strategies_for_Load_Balancing_Subgraph-centric_Distributed_Graph_Processing)</sup> 分布式图处理的综述指出，并行性、负载均衡、通信开销和带宽是在海量图上运行这些算法时反复出现的挑战。<sup>[15](https://doi.org/10.1145/3694966)</sup>

## References

1. [Nancy A. Lynch, Distributed Algorithms, Chapter 1: Introduction, Morgan Kaufmann (O'Reilly)](https://www.oreilly.com/library/view/distributed-algorithms/9781558603486/OEBPS/B9781558603486500018.htm)
2. [Chapter 13. Distributed Algorithms](https://gyires.inf.unideb.hu/KMITT/a52/ch01.html)
3. [Distributed Computing: Introduction (Cambridge University Press)](https://www.cambridge.org/core/books/abs/distributed-computing/introduction/C1F1F226654B27B699F31F1AB3B33ED4)
4. [Distributed Algorithms, introductory lecture notes](https://www.krchowdhary.com/distributed_algos/1-intro.pdf)
5. [Distributed Graph Algorithms: LOCAL and CONGEST models, ETH Zurich lecture notes](https://disco.ethz.ch/courses/podc/lecturenotes/LOCAL.pdf)
6. [The Impossibility of Asynchronous Consensus: overview of Fischer, Lynch, and Paterson (JACM 1985), University of Rochester](https://www.cs.rochester.edu/u/scott/courses/458/notes/FLP.pdf)
7. [Mohsen Ghaffari, Fabian Kuhn, Yannic Maus (2017). On the complexity of local distributed graph problems. STOC 2017.](https://doi.org/10.1145/3055399.3055471)
8. [MIT 6.852J Lecture 25: Timing-based mutual exclusion and consensus](https://ocw.iti.hr/courses/electrical-engineering-and-computer-science/6-852j-distributed-algorithms-fall-2009/lecture-notes/MIT6_852JF09_lec25.pdf)
9. [Nathan Linial (1992). Locality in Distributed Graph Algorithms. SIAM Journal on Computing.](https://epubs.siam.org/doi/10.1137/0221015)
10. [Distributed computing in the asynchronous LOCAL model, Theoretical Computer Science (ScienceDirect)](https://www.sciencedirect.com/science/article/abs/pii/S0304397524005693)
11. [MIT OpenCourseWare 6.852J Distributed Algorithms, Fall 2009, Lecture Notes](https://ocw.mit.edu/courses/6-852j-distributed-algorithms-fall-2009/pages/lecture-notes/)
12. [Leslie Lamport. Time, Clocks and the Ordering of Events in a Distributed System, Microsoft Research page](https://www.microsoft.com/en-us/research/publication/time-clocks-ordering-events-distributed-system/)
13. [Distributed Algorithms for Graph Optimization, Nature Index topic summary](https://www.nature.com/nature-index/topics/l4/distributed-algorithms-for-graph-optimization)
14. [Nathan Linial (1987). Distributive Graph Algorithms: Global Solutions from Local Data. FOCS 1987, Hebrew University of Jerusalem](https://cris.huji.ac.il/en/publications/distributive-graph-algorithms-global-solutions-from-local-data/)
15. [A Survey of Distributed Graph Algorithms on Massive Graphs, ACM Computing Surveys](https://doi.org/10.1145/3694966)
16. [Dufoulon, Pai, Pandurangan, Pemmaraju, Robinson (2024). The Message Complexity of Distributed Graph Optimization. ITCS 2024.](https://drops.dagstuhl.de/storage/00lipics/lipics-vol287-itcs2024/LIPIcs.ITCS.2024.41/LIPIcs.ITCS.2024.41.pdf)
17. [Grzegorz Malewicz et al. (2010). Pregel: a system for large-scale graph processing. SIGMOD 2010, Google Research](https://research.google/pubs/pregel-a-system-for-large-scale-graph-processing/)
18. [Partitioning Strategies for Load Balancing Subgraph-centric Distributed Graph Processing, ResearchGate](https://www.researchgate.net/publication/281144895_Partitioning_Strategies_for_Load_Balancing_Subgraph-centric_Distributed_Graph_Processing)

---
*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 逻辑与离散数学 › General discrete mathematics and discrete structures › Graph theory › Computational graph problems and algorithms › Parallel and distributed graph algorithms

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/distributed-algorithm

English original: https://www.edgepedia.org/distributed-algorithm
