{
  "id": "integer-programming",
  "title": "Integer programming",
  "lang": "en",
  "source_lang": "en",
  "summary": "Integer programming optimizes decisions subject to constraints requiring some or all variables to take integer values.",
  "category": "mathematics",
  "subcategory": "applied",
  "type": "concept",
  "aliases": [
    "Integer optimization",
    "IP"
  ],
  "generated_at": "2026-10-04",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/integer-programming/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/integer-programming/",
      "json": "https://aiwiki.page/zh/integer-programming.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "Integer programming is a branch of mathematical optimization in which some or all decision variables must take integer values. It represents indivisible quantities and discrete choices, such as how many machines to install or whether to open a facility. The most widely studied form, integer linear programming, combines these restrictions with a linear objective function and linear constraints. Here, “programming” means constructing and solving an optimization model, rather than writing computer code. (web.mit.edu)"
    },
    {
      "heading": "Mathematical formulation and variants",
      "text": "A mixed-integer linear program can be written as\n\n\\[\\begin{aligned} \\min_x\\quad &c^{\\mathsf T}x\\\\ \\text{subject to}\\quad &Ax\\leq b,\\\\ &\\ell\\leq x\\leq u,\\\\ &x_j\\in\\mathbb Z\\qquad(j\\in I). \\end{aligned}\\]\n\nHere \\(A\\) is a coefficient matrix, \\(b\\) contains constraint bounds, \\(c\\) contains objective coefficients, and \\(I\\) identifies the integer-constrained variables. Variables outside \\(I\\) may take real values. Equalities, lower-bound inequalities, and maximization objectives are also possible. The feasible set consists of all assignments satisfying both the algebraic constraints and the variable-domain restrictions. (gurobi.com)\n\nIn a pure integer program, every decision variable is integer-constrained. A mixed-integer program combines integer and continuous variables. A binary integer program restricts its variables to \\(0\\) or \\(1\\), making them suitable for yes-or-no decisions. Integer programming also includes nonlinear models; integrality alone does not imply linearity. Quadratic objectives and constraints define important intermediate classes between linear and general nonlinear models. (web.mit.edu)"
    },
    {
      "heading": "Modeling discrete decisions",
      "text": "Binary variables translate many rules from logic into linear constraints. If \\(y_A\\) and \\(y_B\\) indicate whether two actions occur, \\(y_A\\leq y_B\\) expresses “action A requires action B.” The inequality \\(y_A+y_B\\leq1\\) prohibits choosing both, while \\(\\sum_j y_j=1\\) requires exactly one choice from a collection. These constructions connect integer models with Boolean algebra. (docs.mosek.com)\n\nA standard knapsack problem chooses items with values \\(v_j\\) and weights \\(w_j\\) under capacity \\(W\\):\n\n\\[\\max\\sum_jv_jy_j,\\qquad \\sum_jw_jy_j\\leq W,\\qquad y_j\\in\\{0,1\\}.\\]\n\nRelated formulations describe project selection and capital budgeting, potentially with several resource constraints. Binary choices can also be linked to continuous activity levels: \\(0\\leq q\\leq My\\) permits positive production \\(q\\) only when \\(y=1\\). This is a big-M formulation, where \\(M\\) must be a valid upper bound. Such models represent fixed setup costs and facility-opening decisions. (web.mit.edu)"
    },
    {
      "heading": "Relaxation and geometry",
      "text": "Removing integrality restrictions produces a linear-programming relaxation, solvable by methods for linear programming. Its feasible region contains every feasible integer solution. Therefore, for minimization, its optimal value is a lower bound on the integer optimum; for maximization, it is an upper bound. If an optimal relaxed solution already satisfies integrality, it also solves the original problem. Simply rounding a fractional solution need not preserve feasibility or optimality. (gurobi.com)\n\nFor example, maximize \\(x+y\\) subject to \\(2x+2y\\leq3\\) and nonnegative integer \\(x,y\\). The relaxation attains \\(1.5\\), whereas the integer optimum is \\(1\\). Rounding the relaxed optimum \\((0.75,0.75)\\) coordinatewise to \\((1,1)\\) violates the constraint.\n\nGeometrically, linear inequalities define a convex polyhedron, while integrality selects lattice points within it. Their convex hull is the ideal linear relaxation: optimizing a linear objective over it gives the integer optimal value whenever an optimum exists. Describing that hull explicitly, however, can require many inequalities. (arxiv.org)"
    },
    {
      "heading": "Solution methods",
      "text": "Branch-and-bound systematically divides the problem into subproblems. If an integer variable has relaxed value \\(3.6\\), branching creates cases \\(x_j\\leq3\\) and \\(x_j\\geq4\\), excluding the fractional value without losing integer possibilities. A subproblem is discarded when it is infeasible, its bound cannot improve the best known feasible solution, or its relaxation yields an integer optimum. This avoids explicitly enumerating every candidate assignment. (gurobi.com)\n\nThe cutting-plane method adds inequalities valid for integer solutions but violated by selected fractional solutions. Combining cuts with branching gives branch-and-cut, a central framework in integer optimization. Solvers also use preprocessing and heuristics: preprocessing simplifies the model, while heuristics seek feasible solutions that improve the incumbent and strengthen pruning. (arxiv.org)\n\nFor minimization, an incumbent supplies an upper bound \\(U\\), while the search supplies a lower bound \\(L\\). The optimality gap measures their separation. Equality certifies optimality in exact arithmetic; practical termination may instead use specified absolute or relative tolerances. A feasible solution alone is not an optimality certificate. (gurobi.com)"
    },
    {
      "heading": "Complexity and formulation quality",
      "text": "Within computational complexity, general integer linear optimization is NP-hard. This worst-case classification does not mean every instance is difficult: practical performance depends strongly on structure and formulation. (csc.kth.se)\n\nSome structured models have integral linear relaxations. In particular, if \\(A\\) is totally unimodular and \\(b\\) is integral, every vertex of \\(\\{x:Ax\\leq b,\\ x\\geq0\\}\\) is integral. When an optimal vertex exists, linear programming can therefore solve the associated integer problem directly. (arxiv.org)\n\nEquivalent integer formulations can have different relaxation strengths and computational behavior. Tight bounds, informative valid inequalities, and reduced symmetry can improve the search. Excessively large big-M constants can weaken bounds and cause numerical difficulties, even though they leave the intended integer choices unchanged. (docs.mosek.com)"
    }
  ],
  "links": [
    "mathematical-optimization",
    "integer",
    "objective-function",
    "matrix",
    "real-number",
    "feasible-set",
    "mixed-integer-programming",
    "binary-integer-programming",
    "logic",
    "boolean-algebra",
    "knapsack-problem",
    "linear-programming",
    "convex-set",
    "convex-hull",
    "branch-and-bound",
    "cutting-plane-method",
    "heuristic",
    "computational-complexity",
    "np-hardness"
  ],
  "sources": [
    {
      "title": "Integer Programming, Chapter 9 of Applied Mathematical Programming",
      "url": "https://web.mit.edu/15.053/www/AMP-Chapter-09.pdf"
    },
    {
      "title": "Mixed-Integer Programming: An Intro to the Basics",
      "url": "https://www.gurobi.com/resources/blog/mixed-integer-programming-an-introduction-to-the-basics"
    },
    {
      "title": "A Directed Augmentation Algorithm for Integer Programming",
      "url": "https://web.mit.edu/schulz/www/epapers/sw-mor-2002.pdf"
    },
    {
      "title": "9 Mixed integer optimization — MOSEK Modeling Cookbook",
      "url": "https://docs.mosek.com/modeling-cookbook/mio.html"
    },
    {
      "title": "Finding total unimodularity in optimization problems solved by linear programs",
      "url": "https://arxiv.org/abs/cs/0602016"
    },
    {
      "title": "Structural Analysis of Branch-and-Cut and the Learnability of Gomory Mixed Integer Cuts",
      "url": "https://arxiv.org/abs/2204.07312"
    },
    {
      "title": "What Is MILP? Solver & Uses Explained",
      "url": "https://www.gurobi.com/resources/blog/milp"
    },
    {
      "title": "Notes for the course advanced algorithms",
      "url": "https://www.csc.kth.se/~johanh/algnotes.pdf"
    },
    {
      "title": "4 The Optimizer for Mixed-Integer Problems — MOSEK Command Line Tools",
      "url": "https://docs.mosek.com/latest/cmdtools/mip-optimizer.html"
    }
  ],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}