# 整数二次规划

整数二次规划（Integer Quadratic Programming, IQP）是一种优化方法，它在变量必须取整数值的约束下，最小化或最大化一个二次目标函数。它是混合整数二次规划（Mixed-Integer Quadratic Programming, MIQP）的全整数特例；在 MIQP 中，一部分变量取整数值，另一部分取连续值。一般的 MIQP 模型为

\[ \min x^{\top} H x + c^{\top} x \quad \text{s.t.} \quad A x \le b, \;\; x \in \mathbb{Z}^{p} \times \mathbb{R}^{n-p}, \]

而 IQP 是 \( p = n \) 即所有变量均为整数时的情形。<sup>[1](https://doi.org/10.1007/s10107-016-1036-0)</sup> 在标准 IQP 模型中，目标函数是二次的，约束是线性的，变量是整数。一个带二次约束的变体（IQCQP/MIQCP）则允许二次约束：最小化 \( \tfrac{1}{2} x^{\top} Q^{0} x + b^{0\top} x + q^{0} \)，约束为 \( \tfrac{1}{2} x^{\top} Q^{i} x + b^{i\top} x \le d_{i} \)、界约束 \( l_{j} \le x_{j} \le u_{j} \)，以及 \( x \in \mathbb{Z}^{n} \)。<sup>[2](https://arxiv.org/html/2409.19668v1)</sup> 二次项正是 IQP 区别于整数线性规划之处，也正是它使问题难得多。

| 关键事实 | 详情 |
|---|---|
| 模型 | 在线性（或二次）约束下最小化二次目标，且 \( x \in \mathbb{Z}^{n} \)；MIQP 允许 \( x \in \mathbb{Z}^{p} \times \mathbb{R}^{n-p} \)<sup>[1](https://doi.org/10.1007/s10107-016-1036-0)</sup> |
| 复杂度 | IQP 与 MIQP 的判定版本是 NP 完全的；即使限定为布尔域且所有系数均为 1，IQP 仍是 NP 难的<sup>[1](https://doi.org/10.1007/s10107-016-1036-0)</sup><sup> • </sup><sup>[3](https://ojs.aaai.org/index.php/AAAI/article/download/3960/3838)</sup> |
| 凸性 | 一个 QP 是凸的，当且仅当其矩阵 \( Q \) 为半正定；凸性决定所用算法<sup>[4](https://plato.asu.edu/APM523/cpl_miqp.pdf)</sup> |
| 主要求解器 | Gurobi、CPLEX 与 SCIP，均基于分支定界；Gurobi 于 2024 年 8 月退出 Mittelmann 基准测试，其结果已被移除，因此在当前的 IQP/QP 竞赛中它不再能排名第一；这些基准测试中目前领先的求解器包括 COPT<sup>[2](https://arxiv.org/html/2409.19668v1)</sup> |
| 固定维数 | 带线性约束的整数二次规划在每个固定维数下都是多项式时间可解的，包括 \( n = 2 \) 的情形，且适用于有理多面体上的任意有理二次目标；该算法要么求出精确最小值，要么证明问题不可行或整数无界<sup>[1](https://doi.org/10.1007/s10107-016-1036-0)</sup><sup> • </sup><sup>[18](https://optimization-online.org/2026/09/integer-quadratic-programming-in-fixed-dimension-is-polynomial-time-solvable/)</sup> |
| 参数化难度 | IQP 在变量数目上是 W[1] 难的<sup>[5](https://arxiv.org/html/2608.17818)</sup> |
| 不可判定性 | 当部分变量没有有限界时，带二次约束的变体是不可判定的（Jeroslow，1970 年代）<sup>[6](https://sburer.github.io/papers/030-miqcpsurvey.pdf)</sup> |

## 工作原理

目标函数是一个二次型 \( x^{\top} H x \) 加上一个线性项，而整数限制把光滑连续的地形变成离散的地形。凸性是一条分水岭：对于最小化问题，二次目标为凸，当且仅当其对称 Hessian 矩阵 \( Q \) 为半正定；而凸的最大化问题则要求目标为凹，即 Hessian 为负半定。<sup>[4](https://plato.asu.edu/APM523/cpl_miqp.pdf)</sup> 凸 MIQP 的目标呈碗形，具有单一的全局权衡曲面，因此任何连续松弛的最优值都是有效的全局下界。非凸 MIQP 的连续松弛可能有鞍点或多个局部最优，这会大幅增加计算成本。<sup>[7](https://www.gurobi.com/resources/faq/miqp-faq-mixed-integer-quadratic-programming-basics)</sup> 如果 MIQP 的 QP 松弛本身即非凸，那么求解该松弛已经是 NP 难的，因而需要更复杂的技术。<sup>[8](https://optimization-online.org/wp-content/uploads/2020/03/7662.pdf)</sup>

## 如何实现

几乎所有完备的 IQP 求解器，包括 Gurobi、CPLEX 与 SCIP，都基于分支定界。<sup>[2](https://arxiv.org/html/2409.19668v1)</sup> 对于凸 MIQP，求解器在分支定界树的每个节点上求解一个 QP 以给出有效的下界，而不是像纯整数线性规划那样求解 LP；另一种做法是把 MILP 作为子问题求解。<sup>[4](https://plato.asu.edu/APM523/cpl_miqp.pdf)</sup> 外逼近法利用一阶近似 \( g(x_{k}) + \nabla g(x_{k})^{\top}(x - x_{k}) \le 0 \) 构造一个等价的 MILP，并在约束规范下对凸的、连续可微的函数在有限步内收敛。<sup>[4](https://plato.asu.edu/APM523/cpl_miqp.pdf)</sup>

求解器还要在两种松弛之间选择：把二次项线性化为 MILP 会增加许多变量和约束（数量取决于 \( Q \) 的非零元），但能得到很强的 LP 松弛；而保留 QP 松弛可避免额外变量，但界可能较弱，有时需要对 \( Q \) 作对角扰动。<sup>[8](https://optimization-online.org/wp-content/uploads/2020/03/7662.pdf)</sup> 对于非凸问题，CPLEX 在 12.6 版（2013 年）中加入通过空间分支定界求非凸 QP 与 MIQP 全局解的功能，此前在 12.3 版（2011 年）已引入用原始-对偶内点法求非凸 QP 局部解的功能。<sup>[4](https://plato.asu.edu/APM523/cpl_miqp.pdf)</sup> 此后商用求解器不断扩展全局非凸能力：Gurobi 9.0 引入了针对非凸二次目标与约束的双线性求解器，Gurobi 13.0 采用带二次约束动态外逼近的空间分支定界，大幅缩短了非凸 MIQCP 的求解时间；Xpress 也加入了类似的全局 MIQCQP 能力。<sup>[9](https://www.gurobi.com/resources/faq/gurobi-miqcp)</sup> 割平面同样重要：Burer 与 Letchford（2012）考察了非凸二次整数规划的分裂不等式，在小规模箱约束算例上，这些不等式弥合了 RLT 与 SDP 两种松弛共同留下的差距的很大一部分。<sup>[10](https://www.sciencedirect.com/science/article/pii/S1572528614000371)</sup> 对于带二次约束的问题，通用的精确方案有 BARON、ANTIGONE 等 MINLP 求解器，扩展到二次约束的 MIP 求解器，以及基于 SDP 的分支定界。<sup>[11](https://tidel.mie.utoronto.ca/pubs/Ellipsoid-cp2016.pdf)</sup>

局部搜索已成为分支定界之外的一个真正选择：LS-IQCQP 采用四个专为二次项设计的新局部搜索算子，在 QPLIB 与 MINLPLIB 上与 Gurobi 相比颇具竞争力。<sup>[2](https://arxiv.org/html/2409.19668v1)</sup> 标准的进展度量是**最优性差距**，由当前已知的最好解与已知最好的松弛界算出；在 Gurobi 的约定中，差距按 \( \left| \text{ObjBound} - \text{ObjVal} \right| / \left| \text{ObjVal} \right| \) 由最好界与当前 incumbent 计算，所报告的差距是最终解实际相对差距的上界；提前停止的求解器返回其最好可行解及该差距。<sup>[7](https://www.gurobi.com/resources/faq/miqp-faq-mixed-integer-quadratic-programming-basics)</sup> 在完备求解器中，根据 Mittelmann 2023 年的排名，Gurobi 在 IQP 竞赛中排名第一，SCIP 则是最好的开源学术求解器。<sup>[2](https://arxiv.org/html/2409.19668v1)</sup>

## 起源

针对带线性约束、部分或全部变量为整数的二次目标，Ta Huu Phuong 于 1976 年在《Journal of the ACM》上的一篇论文中给出了一个早期算法，其做法是把 Beale 方法的逆基版本嫁接到 Land-Doig 分支定界过程上。<sup>[12](https://doi.org/10.1145/321958.321968)</sup> 在复杂度方面，Alberto Del Pia、Santanu S. Dey 与 Marco Molinaro 于 2016 年在《Mathematical Programming》上证明 IQP 与 MIQP 的判定版本属于 NP，从而是 NP 完全的。<sup>[1](https://doi.org/10.1007/s10107-016-1036-0)</sup> 在计算工具方面，Ruth Misener 与 Christodoulos A. Floudas 于 2012 年在《Journal of Global Optimization》上提出了 GloMIQO 全局混合整数二次优化器。<sup>[13](https://doi.org/10.1007/s10898-012-9874-7)</sup> 更近一些，Andrea Ghezzi 及其同事在《Mathematical Programming Computation》上提出了基于 Benders 分解的顺序式 s-b-miqp 算法与 CAMINO 工具箱。<sup>[14](https://doi.org/10.1007/s12532-026-00331-4)</sup>

## 变体

有三类具名的问题占主导地位。**凸 MIQP** 的 Hessian 为半正定，是基于 QP 的分支定界可处理的情形。<sup>[7](https://www.gurobi.com/resources/faq/miqp-faq-mixed-integer-quadratic-programming-basics)</sup> **非凸 MIQP** 需要空间分支定界或重构；值得注意的是，所有变量均为 0-1 的非凸 MIQP，或所有乘积都出现在一个 0-1 变量与一个有界变量之间的非凸 MIQP，都可以重构为等价的凸 MIQP。<sup>[4](https://plato.asu.edu/APM523/cpl_miqp.pdf)</sup> 非凸 MIQP 的一个子类同样可以重构为一个箱约束二次规划，其解对原问题是全局最优的。<sup>[15](https://www.aimsciences.org/article/doi/10.3934/jimo.2011.7.1027)</sup> **无约束二元二次规划（UBQP）** 是布尔、无约束的情形，由一个简单的系数矩阵定义。更广泛地说，任何多项式优化问题都可归结为带二次约束的变体：引入辅助变量把所有多项式的次数降到 2。<sup>[6](https://sburer.github.io/papers/030-miqcpsurvey.pdf)</sup>

## 应用

MIQP 建模出现在运筹学的各个领域。在金融中，对资产数目或交易次数设限的均值-方差投资组合选择是一个 MIQP，因为基数限制在二次风险项之外引入了整数变量。在能源领域，机组组合与发电调度把二次发电成本与离散的启停决策结合起来；生产计划、人力排班、车辆路径与产品部件选择是更多的例子。<sup>[7](https://www.gurobi.com/resources/faq/miqp-faq-mixed-integer-quadratic-programming-basics)</sup> 在组合方面，UBQP 模型可表示图上的优化问题、设施选址问题、资源分配、聚类、集合划分、各种形式的指派问题，以及排序与定序问题。IQP 编码还被应用于能耗分解、博弈论与匹配。<sup>[3](https://ojs.aaai.org/index.php/AAAI/article/download/3960/3838)</sup>

## 局限与替代方案

分支定界在最坏情况下需要指数时间，而这种指数行为在实践中经常出现。<sup>[2](https://arxiv.org/html/2409.19668v1)</sup> 复杂度图景解释了原因：在布尔变量上最大化一个二次函数已经是 NP 难的，所以 IQP 比整数线性规划难得多，<sup>[3](https://ojs.aaai.org/index.php/AAAI/article/download/3960/3838)</sup> 而且即使所有系数均为 1、所有域均为布尔、且没有目标函数，它仍是 NP 难的。<sup>[3](https://ojs.aaai.org/index.php/AAAI/article/download/3960/3838)</sup> 相比之下，两变量的情形 \( \min\{f(x): x \in P \cap \mathbb{Z}^{2}\} \) 是多项式时间可解的，这与 Manders 与 Adleman（1978）关于二次同余问题 NP 难性的结果形成对照。<sup>[16](https://minlp.cheme.cmu.edu/2014/papers/delpia.pdf)</sup><sup> • </sup><sup>[18](https://optimization-online.org/2026/09/integer-quadratic-programming-in-fixed-dimension-is-polynomial-time-solvable/)</sup> 参数化复杂度进一步收窄了希望：IQP 在变量数目上是 W[1] 难的，因此在标准假设下不存在 \( f(n) \cdot |\mathcal{I}|^{O(1)} \) 算法。<sup>[5](https://arxiv.org/html/2608.17818)</sup> 多项式时间可解性已知于固定维数、有理二次目标与有理线性约束的情形，而不是通过诸如固定 \( Q \) 与 \( A \) 中最大绝对系数 \( \alpha \) 之类的限制得到的。<sup>[5](https://arxiv.org/html/2608.17818)</sup>

每种替代方案都有所取舍。SDP 松弛利用矩阵 \( \begin{pmatrix} 1 & x^{\top} \\ x & X \end{pmatrix} \) 半正定这一事实，为二次问题给出有用的界，<sup>[17](https://www.lancaster.ac.uk/staff/letchfoa/articles/2012-minlp-survey.pdf)</sup> 但现有的 SDP 求解器如 BiqCrunch 只能处理二元变量，而非一般整数变量。<sup>[11](https://tidel.mie.utoronto.ca/pubs/Ellipsoid-cp2016.pdf)</sup> 线性化为 MILP 能获得强松弛，代价是模型可能非常庞大。<sup>[8](https://optimization-online.org/wp-content/uploads/2020/03/7662.pdf)</sup> LS-IQCQP 之类的局部搜索启发式能快速找到好解，但与完备求解器不同，它们本身不能证明最优性。<sup>[2](https://arxiv.org/html/2409.19668v1)</sup>

## References

1. [Alberto Del Pia, Santanu S. Dey, Marco Molinaro (2016). Mixed-integer quadratic programming is in NP. Mathematical Programming.](https://doi.org/10.1007/s10107-016-1036-0)
2. [Local Search for Integer Quadratic Programming (LS-IQCQP)](https://arxiv.org/html/2409.19668v1)
3. [Solving Integer Quadratic Programming via Explicit and Structural Restrictions](https://ojs.aaai.org/index.php/AAAI/article/download/3960/3838)
4. [Solving Mixed-Integer Quadratic Programming problems with IBM-CPLEX: a progress report](https://plato.asu.edu/APM523/cpl_miqp.pdf)
5. [Integer Quadratic Programming is W[1]-Hard Parameterized by the Number of Variables](https://arxiv.org/html/2608.17818)
6. [A survey of mixed integer quadratically constrained problems (MIQCP) / The MILP road to MIQCP](https://sburer.github.io/papers/030-miqcpsurvey.pdf)
7. [MIQP FAQ: Mixed-Integer Quadratic Programming Basics](https://www.gurobi.com/resources/faq/miqp-faq-mixed-integer-quadratic-programming-basics)
8. [A Classifier to Decide on the Linearization of Mixed-Integer Quadratic Problems](https://optimization-online.org/wp-content/uploads/2020/03/7662.pdf)
9. [Gurobi MIQCP (vendor resource)](https://www.gurobi.com/resources/faq/gurobi-miqcp)
10. [On the separation of split inequalities for non-convex quadratic integer programming](https://www.sciencedirect.com/science/article/pii/S1572528614000371)
11. [Ellipsoid method paper (CP 2016)](https://tidel.mie.utoronto.ca/pubs/Ellipsoid-cp2016.pdf)
12. [Ta Huu Phuong (1976). Solution of Integer Programs with a Quadratic Objective Function. Journal of the ACM.](https://doi.org/10.1145/321958.321968)
13. [Ruth Misener, Christodoulos A. Floudas (2012). GloMIQO: Global mixed-integer quadratic optimizer. Journal of Global Optimization.](https://doi.org/10.1007/s10898-012-9874-7)
14. [Andrea Ghezzi and colleagues (2026). A sequential Benders-based mixed-integer quadratic programming algorithm and its implementation in the CAMINO toolbox. Mathematical Programming Computation.](https://doi.org/10.1007/s12532-026-00331-4)
15. [Nonconvex quadratic reformulations and solvable conditions for mixed integer quadratic programming problems](https://www.aimsciences.org/article/doi/10.3934/jimo.2011.7.1027)
16. [Integer Quadratic Programming in the Plane (Del Pia slides)](https://minlp.cheme.cmu.edu/2014/papers/delpia.pdf)
17. [Non-convex mixed-integer nonlinear programming: A survey](https://www.lancaster.ac.uk/staff/letchfoa/articles/2012-minlp-survey.pdf)
18. [Integer quadratic programming in fixed dimension is polynomial-time solvable, Optimization Online](https://optimization-online.org/2026/09/integer-quadratic-programming-in-fixed-dimension-is-polynomial-time-solvable/)

---
*Initially written Sep 29, 2026 · Edited: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 逻辑与离散数学

Copyright 2026 Edgepedia

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

Source: https://www.edgepedia.org/zh/integer-quadratic-programming

English original: https://www.edgepedia.org/integer-quadratic-programming
