# 随机舍入

随机舍入是组合优化中的一种技术，它将线性规划（LP）松弛的分数解转化为整数解：对每个变量进行随机舍入，以分数值作为向上取整的概率。它是求解NP难问题的近似算法的核心工具：舍入解的期望代价可以用LP最优值来界定，而通过切尔诺夫界等集中不等式则可证明约束违反不太可能发生。<sup>[1](https://www2.eecs.berkeley.edu/Pubs/TechRpts/1985/5636.html)</sup>

| 关键事实 | 详情 |
|---|---|
| 产生什么 | 从LP解中采样得到的0/1整数解，其期望代价在LP最优值的α倍以内<sup>[1](https://www2.eecs.berkeley.edu/Pubs/TechRpts/1985/5636.html)</sup> |
| 舍入规则 | 独立地以概率\( x_{i} \)令每个变量\( X_{i} = 1 \)，以概率\( 1 - x_{i} \)令\( X_{i} = 0 \)<sup>[2](https://drops.dagstuhl.de/storage/00lipics/lipics-vol334-icalp2025/LIPIcs.ICALP.2025.127/LIPIcs.ICALP.2025.127.pdf)</sup> |
| 代价保证 | 每个线性函数在期望意义下保持不变；例如在适当缩放下有\( c^{T}X \le (1+\epsilon) \cdot c^{T}x \)<sup>[2](https://drops.dagstuhl.de/storage/00lipics/lipics-vol334-icalp2025/LIPIcs.ICALP.2025.127/LIPIcs.ICALP.2025.127.pdf)</sup> |
| 集合覆盖比率 | 配合修正步骤得到\( (1+\ln n) \)-近似；在\( \lambda = \Theta(\log n) \)缩放下以高概率得到\( O(\log n) \)-近似<sup>[3](https://www.cs.dartmouth.edu/~deepc/LecNotes/Appx/7.%20Randomized%20Rounding.pdf)</sup><sup> • </sup><sup>[4](https://www.cs.jhu.edu/~mdinitz/classes/ApproxAlgorithms/Spring2019/Lectures/lecture11.pdf)</sup> |
| 拥塞最小化 | 通过切尔诺夫界的一个推论得到\( O(\log n / \log \log n) \)拥塞度<sup>[5](https://www.cs.cornell.edu/courses/cs6820/2022fa/Handouts/LP+RR.pdf)</sup> |
| 提出者 | 拉加万（Prabhakar Raghavan）与汤普森（Clark D. Thompson），《Combinatorica》，1987年<sup>[6](https://doi.org/10.1007/bf02579324)</sup> |
| 主要局限 | 独立舍入可能违反必须严格成立的约束；此时需要修正步骤或相关舍入方案<sup>[7](https://theory.stanford.edu/~jvondrak/data/matroid-rounding.pdf)</sup> |

## 工作原理

该方法基于两个观察。第一，LP松弛的可行域包含整数解的超集，因此LP最优值\( \mathrm{OPT}_{\mathrm{LP}} \)是真实最优值（对于最小化问题）的下界；任何代价不超过\( \alpha \cdot \mathrm{OPT}_{\mathrm{LP}} \)的整数解因此就是一个α-近似。<sup>[8](https://www.cs.utexas.edu/~ecprice/courses/randomized/fa23/scribe/lec26.pdf)</sup>第二，将分数值\( x_{i} \in [0,1] \)解释为概率，使得变量的每个线性函数在期望意义下正确：\( \mathbb{E}[X_{i}] = x_{i} \)，因此\( \mathbb{E}[c^{T}X] = c^{T}x \)。于是舍入解的期望代价与LP代价一样好。<sup>[9](https://www.ccs.neu.edu/home/rraj/Courses/7880/F09/Lectures/LP.pdf)</sup><sup> • </sup><sup>[2](https://drops.dagstuhl.de/storage/00lipics/lipics-vol334-icalp2025/LIPIcs.ICALP.2025.127/LIPIcs.ICALP.2025.127.pdf)</sup>

约束以概率方式处理。每个线性约束在期望意义下保持不变，且由于\( X_{i} \)相互独立，其值通过切尔诺夫界或更一般的伯恩斯坦不等式紧密集中在均值附近。<sup>[10](https://theoryofcomputing.org/articles/v020a006/v020a006.pdf)</sup>对于拥塞最小化，切尔诺夫界的一个推论给出：当均值至多为1时，对\( b \ge e\log N / \log\log N \)有\( \Pr(X \ge b) < 1/N \)，这正是\( O(\log n / \log\log n) \)拥塞保证的基础；随后对所有边取并集界，将每条边的失败概率转化为全局失败概率。<sup>[5](https://www.cs.cornell.edu/courses/cs6820/2022fa/Handouts/LP+RR.pdf)</sup>与朴素概率方法相比，新要素在于分数解\( x^{*} \)本身充当概率分布的基础，从而将舍入代价与松弛值联系起来。<sup>[11](https://algnotes.info/on/background/randomized-rounding/)</sup>

对于集合覆盖，已发表的分析给出了相关但表述不同的保证：配合修正步骤和缩放\( \lambda = \ln n \)，该过程是一个\( (1+\ln n) \)-近似随机算法；而当\( \lambda = \Theta(\log n) \)时，它是一个\( O(\log n) \)-近似，且解以高概率可行。<sup>[3](https://www.cs.dartmouth.edu/~deepc/LecNotes/Appx/7.%20Randomized%20Rounding.pdf)</sup><sup> • </sup><sup>[4](https://www.cs.jhu.edu/~mdinitz/classes/ApproxAlgorithms/Spring2019/Lectures/lecture11.pdf)</sup>这些反映了不同的保证类型，尚无单一的公认比率；对于集合覆盖，超越\( \log n \)是NP难的。<sup>[8](https://www.cs.utexas.edu/~ecprice/courses/randomized/fa23/scribe/lec26.pdf)</sup>

## 操作步骤

实践者遵循以下步骤。<sup>[12](https://cs.ucr.edu/~neal/Young95Randomized.pdf)</sup>

1. 将NP难问题表述为0/1整数线性规划。对于集合覆盖，即\( \min \sum_{S} c_{S} x_{S} \)，约束为对每个元素\( e \)有\( \sum_{e \in S} x_{S} \ge 1 \)，且\( x_{S} \in \{0,1\} \)。<sup>[9](https://www.ccs.neu.edu/home/rraj/Courses/7880/F09/Lectures/LP.pdf)</sup>
2. 松弛整数性约束（将\( x_{S} \in \{0,1\} \)替换为\( x_{S} \ge 0 \)），并求解LP至最优。<sup>[9](https://www.ccs.neu.edu/home/rraj/Courses/7880/F09/Lectures/LP.pdf)</sup><sup> • </sup><sup>[12](https://cs.ucr.edu/~neal/Young95Randomized.pdf)</sup>
3. 独立舍入每个变量：以概率\( \min(\lambda \cdot x^{*}_{S},\, 1) \)令\( x_{S} = 1 \)，其中\( \lambda \)为缩放参数；或在无缩放形式下直接以概率\( x_{i} \)令其等于1。<sup>[4](https://www.cs.jhu.edu/~mdinitz/classes/ApproxAlgorithms/Spring2019/Lectures/lecture11.pdf)</sup><sup> • </sup><sup>[2](https://drops.dagstuhl.de/storage/00lipics/lipics-vol334-icalp2025/LIPIcs.ICALP.2025.127/LIPIcs.ICALP.2025.127.pdf)</sup>
4. 后处理。简单舍入可能留下未覆盖的元素，因此修正步骤用包含该元素的最小代价集合来覆盖每个未覆盖元素；或者，重复舍入\( t \)次并合并结果，或通过马尔可夫不等式加上\( \ell = O(\log n) \)次重复来放大置信度。<sup>[3](https://www.cs.dartmouth.edu/~deepc/LecNotes/Appx/7.%20Randomized%20Rounding.pdf)</sup><sup> • </sup><sup>[9](https://www.ccs.neu.edu/home/rraj/Courses/7880/F09/Lectures/LP.pdf)</sup><sup> • </sup><sup>[4](https://www.cs.jhu.edu/~mdinitz/classes/ApproxAlgorithms/Spring2019/Lectures/lecture11.pdf)</sup>

重复之所以有效，是因为每个元素以常数非零概率被覆盖：对于任何固定元素，覆盖它所需的期望迭代次数至多为2，且在\( T \)次迭代内被覆盖的概率至少为\( 1 - 1/2^{T} \)。<sup>[9](https://www.ccs.neu.edu/home/rraj/Courses/7880/F09/Lectures/LP.pdf)</sup>

## 起源

随机舍入是在论文《随机舍入：一种可证明良好的算法与算法证明的技术》（"Randomized rounding: A technique for provably good algorithms and algorithmic proofs"）中提出的，发表于《Combinatorica》。<sup>[6](https://doi.org/10.1007/bf02579324)</sup>一份技术报告陈述了核心结果：0-1整数规划的有理最优值可用于通过随机算法构造可证明良好的0-1解，并给出了有理最优值与0-1最优值之间差距的界。<sup>[1](https://www2.eecs.berkeley.edu/Pubs/TechRpts/1985/5636.html)</sup>拉加万的博士论文（报告编号UCB/CSD 87/312，1986年7月）将该技术应用于路由和装箱问题。<sup>[13](https://www2.eecs.berkeley.edu/Pubs/TechRpts/1987/CSD-87-312.pdf)</sup>1988年，拉加万在《Journal of Computer and System Sciences》上发表了对该方法的去随机化，使用悲观估计量确定性地近似装箱整数规划。<sup>[14](https://doi.org/10.1016/0022-0000%2888%2990003-7)</sup>该技术是概率方法的算法实现，其通过悲观估计量的去随机化推广了条件期望方法。<sup>[15](https://lucatrevisan.github.io/pubs/dimacs97.pdf)</sup>

## 变体

若干有名称的变体以独立性换取硬约束满足或集中性。

- **管道舍入（Pipage rounding）** 是一种确定性过程，适用于具有分配型和预算型约束的线性松弛，由阿格耶夫（A.A. Ageev）和斯维里登科（M.I. Sviridenko）于2004年在《Journal of Combinatorial Optimization》上提出；它在至多\( |E| \)个多项式时间步骤内将分数解转化为整数解，在其ε-凸性条件下保持目标函数，其设计目的是避免随机舍入的去随机化困难。<sup>[16](https://doi.org/10.1023/b:joco.0000038913.96607.c2)</sup>
- **随机管道舍入** 遵循确定性的阿格耶夫–斯维里登科变体；对于拟阵多面体，**交换舍入（swap rounding）** 产生一个随机顶点\( X \)，满足\( \mathbb{E}[X_{i}] = x_{i} \)且坐标负相关，从而对任何线性函数产生切尔诺夫型集中。<sup>[7](https://theory.stanford.edu/~jvondrak/data/matroid-rounding.pdf)</sup>
- **相关舍入（Dependent rounding）** 用于二分图边集上的分数向量，由甘地（Rajiv Gandhi）、库勒（Samir Khuller）、帕塔萨拉蒂（Srinivasan Parthasarathy）和斯里尼瓦桑（Aravind Srinivasan）于2006年在《Journal of the ACM》上发展。<sup>[17](https://doi.org/10.1145/1147954.1147956)</sup>
- **带修正的随机舍入** 用于装箱整数规划，由班萨尔（Nikhil Bansal）、科鲁拉（N. Korula）、纳加拉詹（V. Nagarajan）和斯里尼瓦桑（Aravind Srinivasan）（2012年）提出，给出了首批RNC近似算法，其保证与最佳串行保证在常数因子内匹配；选取适当的\( \lambda \)，每个\( x_{j} \)独立舍入，修正步骤纠正约束违反。<sup>[7](https://theory.stanford.edu/~jvondrak/data/matroid-rounding.pdf)</sup>
- 其他相关方案包括最大熵采样——阿萨德普尔（Asadpour）及其同事在其ATSP工作中用于在生成树多面体中以负相关变量进行舍入——以及通过差异度的舍入和高斯随机游走。<sup>[7](https://theory.stanford.edu/~jvondrak/data/matroid-rounding.pdf)</sup><sup> • </sup><sup>[10](https://theoryofcomputing.org/articles/v020a006/v020a006.pdf)</sup>

## 应用

随机舍入是集合覆盖、网络中路径的拥塞最小化路由、MAXSAT、MINCUT和MAXCUT的标准技术。<sup>[5](https://www.cs.cornell.edu/courses/cs6820/2022fa/Handouts/LP+RR.pdf)</sup><sup> • </sup><sup>[18](https://cs.uni-paderborn.de/fileadmin-eim/informatik/fg/ti/Lehre/Old-Semesters/RA/lecture_3.pdf)</sup>甘地及其同事的相关舍入技术为低拥塞多路径路由、给定度序列的随机图、广播调度中的吞吐量和延迟最小化、带容量顶点覆盖以及无关并行机上的公平调度提供了改进算法。<sup>[17](https://doi.org/10.1145/1147954.1147956)</sup>装箱整数规划通过带修正的舍入来处理。

近期结果扩展了该技术的适用范围。一篇STOC 2025论文在动态规划上进行随机舍入：子问题被重新解释为网络设计问题以构建强LP松弛，在此基础上随机舍入以大约\( (n^{\epsilon} \cdot \mathrm{polylog}\, n) \)-近似在时间\( n^{O(1/\epsilon)} \)内近似满足大量额外装箱约束；该框架重现了有向斯坦纳树和圣诞老人问题的最先进算法，并为鲁棒最短路径、鲁棒二分匹配、多彩定向越野和整数广义流给出了新结果。<sup>[19](https://dl.acm.org/doi/10.1145/3798129.3800892)</sup>一个2025年的相关舍入方案保证舍入整数解的代价不超过分数解的代价，结合Shmoys–Tardos方法，为预算圣诞老人问题给出了\( O(\log n) \)-近似。<sup>[2](https://drops.dagstuhl.de/storage/00lipics/lipics-vol334-icalp2025/LIPIcs.ICALP.2025.127/LIPIcs.ICALP.2025.127.pdf)</sup>同样的二分框架为无关机上加权完成时间最小化给出了1.398-近似，改进了Im和Li（2023年）先前的1.45比率。<sup>[20](https://arxiv.org/pdf/2308.07476)</sup>一篇ICALP 2026论文——狄利克雷机制——为二分分配图发展了具有强负相关的舍入，其中每个右节点必须恰好选择一条边，而独立舍入会导致左节点负载不均。<sup>[21](https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.ICALP.2026.107)</sup>一篇2024年《Mathematical Programming》论文将TSP子回路消除松弛的任何半整数解进行舍入，同时损失小于1.5的因子，建立在Karlin、Klein和Oveis Gharan的最大熵采样舍入之上。<sup>[22](https://link.springer.com/article/10.1007/s10107-024-02065-4)</sup>一种结合迭代舍入和随机舍入的通用方法适用于迭代舍入有余量的任何情形，为列稀疏LP、无关机上的完工时间最小化和度约束生成树给出了新结果。<sup>[10](https://theoryofcomputing.org/articles/v020a006/v020a006.pdf)</sup>

## 局限与替代方案

独立舍入无法满足不可违反的约束。集合覆盖的朴素舍入有较高概率使某个元素未被覆盖；对于一个三角形，最小边覆盖为2，但LP最优值为3/2，每条边分配1/2。<sup>[7](https://theory.stanford.edu/~jvondrak/data/matroid-rounding.pdf)</sup><sup> • </sup><sup>[8](https://www.cs.utexas.edu/~ecprice/courses/randomized/fa23/scribe/lec26.pdf)</sup>该技术非常适合约束结构较少、或约束是软的且容忍一定误差的问题；针对具体问题的修正步骤有时可以纠正约束违反。<sup>[10](https://theoryofcomputing.org/articles/v020a006/v020a006.pdf)</sup>

原始-对偶方法从原始不可行、对偶可行的解出发，以整数方式扩展原始解；其相对于舍入的所述优势在于无需解LP，而解LP即使多项式时间可解也很耗时。<sup>[23](https://webdocs.cs.ualberta.ca/%7Emreza/courses/Approx13/week3.pdf)</sup>由于大多数组合问题的LP松弛的极点不对应于组合解，经典原始-对偶方法无法直接找到最优整数解，但适当的修改可为网络设计问题产生良好的近似算法，作为无舍入的替代方案。<sup>[24](https://math.mit.edu/~goemans/PAPERS/book-ch4.pdf)</sup>管道舍入是确定性的，完全绕过了去随机化。<sup>[16](https://doi.org/10.1023/b:joco.0000038913.96607.c2)</sup>遗忘舍入避免了先求解线性规划，消除了随机舍入算法（无论是否去随机化）的主要瓶颈。<sup>[12](https://cs.ucr.edu/~neal/Young95Randomized.pdf)</sup>当需要对原始技术进行去随机化时，悲观估计量推广了条件期望方法。<sup>[15](https://lucatrevisan.github.io/pubs/dimacs97.pdf)</sup>

## References

1. [Randomized Rounding: A Technique for Provably Good Algorithms and Algorithmic Proofs | EECS at UC Berkeley](https://www2.eecs.berkeley.edu/Pubs/TechRpts/1985/5636.html)
2. [Cost Preserving Dependent Rounding for Allocation Problems (ICALP 2025)](https://drops.dagstuhl.de/storage/00lipics/lipics-vol334-icalp2025/LIPIcs.ICALP.2025.127/LIPIcs.ICALP.2025.127.pdf)
3. [Randomized Rounding: Set Cover and Independent Set (Dartmouth approximation algorithms lecture notes)](https://www.cs.dartmouth.edu/~deepc/LecNotes/Appx/7.%20Randomized%20Rounding.pdf)
4. [Lecture 11: Rounding for set cover (Johns Hopkins, Approximation Algorithms, Spring 2019)](https://www.cs.jhu.edu/~mdinitz/classes/ApproxAlgorithms/Spring2019/Lectures/lecture11.pdf)
5. [CS6820 Fall 2022 lecture notes: LP + Randomized Rounding (Cornell)](https://www.cs.cornell.edu/courses/cs6820/2022fa/Handouts/LP+RR.pdf)
6. [Prabhakar Raghavan, Clark D. Tompson (1987). Randomized rounding: A technique for provably good algorithms and algorithmic proofs. COMBINATORICA.](https://doi.org/10.1007/bf02579324)
7. [Randomized Rounding via Exchange (Chekuri, Vondrák, Zenklusen)](https://theory.stanford.edu/~jvondrak/data/matroid-rounding.pdf)
8. [Lecture 26: Randomized Rounding (UT Austin, Fall 2023)](https://www.cs.utexas.edu/~ecprice/courses/randomized/fa23/scribe/lec26.pdf)
9. [Rounding for set cover (Northeastern lecture notes)](https://www.ccs.neu.edu/home/rraj/Courses/7880/F09/Lectures/LP.pdf)
10. [On a Generalization of Iterated and Randomized Rounding (Theory of Computing, vol. 20)](https://theoryofcomputing.org/articles/v020a006/v020a006.pdf)
11. [Notes on algorithms, Randomized rounding](https://algnotes.info/on/background/randomized-rounding/)
12. [Randomized Rounding Without Solving the Linear Program (Neal E. Young, 1995)](https://cs.ucr.edu/~neal/Young95Randomized.pdf)
13. [Randomized Rounding And Discrete Ham-Sandwich Theorems: Provably Good Algorithms For Routing And Packing Problems](https://www2.eecs.berkeley.edu/Pubs/TechRpts/1987/CSD-87-312.pdf)
14. [Probabilistic construction of deterministic algorithms: Approximating packing integer programs (Journal of Computer and System Sciences, 1988)](https://doi.org/10.1016/0022-0000%2888%2990003-7)
15. [Notes on algorithms (Luca Trevisan, DIMACS 1997)](https://lucatrevisan.github.io/pubs/dimacs97.pdf)
16. [A.A. Ageev, M.I. Sviridenko (2004). Pipage Rounding: A New Method of Constructing Algorithms with Proven Performance Guarantee. Journal of Combinatorial Optimization.](https://doi.org/10.1023/b:joco.0000038913.96607.c2)
17. [Rajiv Gandhi and colleagues (2006). Dependent rounding and its applications to approximation algorithms. Journal of the ACM.](https://doi.org/10.1145/1147954.1147956)
18. [Lecture 3: Randomized Rounding (Paderborn, Approximation Algorithms course)](https://cs.uni-paderborn.de/fileadmin-eim/informatik/fg/ti/Lehre/Old-Semesters/RA/lecture_3.pdf)
19. [Randomized Rounding over Dynamic Programs (STOC 2025)](https://dl.acm.org/doi/10.1145/3798129.3800892)
20. [A new dependent-rounding algorithmic framework for bipartite graphs (arXiv 2308.07476)](https://arxiv.org/pdf/2308.07476)
21. [The Dirichlet Mechanism for Rounding with Strong Negative Correlation, with Applications (ICALP 2026)](https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.ICALP.2026.107)
22. [Matroid-based TSP rounding for half-integral solutions (Mathematical Programming, 2024)](https://link.springer.com/article/10.1007/s10107-024-02065-4)
23. [Primal-dual vs rounding for set cover (Alberta lecture notes)](https://webdocs.cs.ualberta.ca/%7Emreza/courses/Approx13/week3.pdf)
24. [The primal-dual method for approximation algorithms and its application to network design problems (Goemans, Williamson)](https://math.mit.edu/~goemans/PAPERS/book-ch4.pdf)

---
*Initially written Sep 29, 2026 · Reviewed: Sep 30, 2026 · Edited: Sep 30, 2026 · Last review: Sep 30, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 逻辑与离散数学 › General discrete mathematics and discrete structures › Combinatorics › Geometric, polyhedral, and topological combinatorics

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/randomized-rounding

English original: https://www.edgepedia.org/randomized-rounding
