{
  "id": "binary-integer-programming",
  "title": "Binary integer programming",
  "lang": "en",
  "source_lang": "en",
  "summary": "Binary integer programming optimizes decisions represented by variables restricted to zero or one, typically under linear constraints and a linear objective.",
  "category": "mathematics",
  "subcategory": "applied",
  "type": "concept",
  "aliases": [
    "0–1 integer programming",
    "zero–one programming",
    "binary programming",
    "Boolean integer programming"
  ],
  "generated_at": "2026-11-06",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/binary-integer-programming/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/binary-integer-programming/",
      "json": "https://aiwiki.page/zh/binary-integer-programming.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "Binary integer programming is a form of mathematical optimization in which every decision variable is restricted to the values \\(0\\) and \\(1\\). These values commonly represent alternatives such as selecting or rejecting an item, opening or closing a facility, or assigning or not assigning a task. It is a special case of integer programming and a central modeling framework in operations research.\n\nIn its most common usage, the term refers to problems with a linear objective and linear constraints, also called binary linear programs or 0–1 linear programs. Binary variables can also occur in nonlinear optimization, but those problems require additional qualifications, such as binary quadratic programming."
    },
    {
      "heading": "Mathematical formulation",
      "text": "A binary linear program can be written as\n\n\\[\\begin{aligned} \\min_x \\quad & c^\\top x\\\\ \\text{subject to}\\quad & Ax\\le b,\\\\ &x\\in\\{0,1\\}^n. \\end{aligned}\\]\n\nHere:\n\n- \\(x=(x_1,\\ldots,x_n)\\) is the vector of binary decision variables;\n- \\(c\\) specifies their contributions to the objective function;\n- \\(A\\) is a constraint matrix;\n- \\(b\\) specifies resource limits or other requirements.\n\nEquality constraints and inequalities in the opposite direction can also be included. Maximization is equivalent to minimization after reversing the sign of the objective.\n\nThe feasible set consists of binary vectors satisfying all constraints. There are at most \\(2^n\\) candidate vectors. Consequently, a feasible binary program with a finite-valued objective always has an optimal solution, although finding one may require substantial computation. Unlike an unrestricted linear program, a pure binary program cannot have an unbounded objective.\n\nIf some variables are binary while others can take continuous values, the formulation is a mixed-integer linear program, not a pure binary program."
    },
    {
      "heading": "Modeling decisions and logical conditions",
      "text": "Binary variables make it possible to translate discrete choices into algebraic constraints. Their interpretation resembles truth values in propositional logic, with \\(1\\) representing true and \\(0\\) representing false.\n\nSelection constraints\n\nFor a set \\(S\\) of alternatives, common requirements include:\n\n\\[\\sum_{i\\in S}x_i\\le 1 \\qquad\\text{at most one alternative,}\\]\n\n\\[\\sum_{i\\in S}x_i=1 \\qquad\\text{exactly one alternative,}\\]\n\n\\[\\sum_{i\\in S}x_i\\ge 1 \\qquad\\text{at least one alternative.}\\]\n\nMore generally, \\(\\sum_{i\\in S}x_i=k\\) selects exactly \\(k\\) alternatives.\n\nImplication and exclusion\n\nThe statement “selecting \\(i\\) requires selecting \\(j\\)” becomes\n\n\\[x_i\\le x_j.\\]\n\nMutual exclusion becomes\n\n\\[x_i+x_j\\le 1.\\]\n\nThe complement of a binary variable is \\(1-x_i\\). Thus a logical clause such as “\\(x_1\\) is true, or \\(x_2\\) is false, or \\(x_3\\) is true” can be expressed as\n\n\\[x_1+(1-x_2)+x_3\\ge 1.\\]\n\nThis translation connects binary programming with Boolean satisfiability.\n\nProducts of binary variables\n\nA product \\(z=xy\\), where \\(x\\) and \\(y\\) are binary, can be represented exactly by linear constraints:\n\n\\[z\\le x,\\qquad z\\le y,\\qquad z\\ge x+y-1,\\qquad z\\ge 0.\\]\n\nThese constraints force \\(z\\) to equal the product even if \\(z\\) is declared continuous. Such constructions allow many nonlinear expressions involving binary variables to be reformulated as larger linear integer programs.\n\nConditional constraints\n\nA binary variable can activate a constraint. For example,\n\n\\[a^\\top y\\le b+M(1-x)\\]\n\nenforces \\(a^\\top y\\le b\\) when \\(x=1\\). When \\(x=0\\), the constraint is intended to become redundant.\n\nThe constant \\(M\\), often called a big-M value, must be large enough for that particular constraint to be redundant over the relevant variable bounds. An unnecessarily large value weakens the optimization model and may create numerical difficulties. Many optimization systems support indicator constraints, which express the conditional relationship directly, although their computational treatment depends on the solver."
    },
    {
      "heading": "Example: selecting projects",
      "text": "Suppose three projects have benefits \\(6\\), \\(5\\), and \\(4\\), and require resources \\(4\\), \\(3\\), and \\(2\\), respectively. With a resource budget of \\(5\\), define \\(x_i=1\\) if project \\(i\\) is selected. The model is\n\n\\[\\begin{aligned} \\max\\quad &6x_1+5x_2+4x_3\\\\ \\text{subject to}\\quad &4x_1+3x_2+2x_3\\le 5,\\\\ &x_1,x_2,x_3\\in\\{0,1\\}. \\end{aligned}\\]\n\nSelecting projects \\(2\\) and \\(3\\) uses the entire budget and yields benefit \\(9\\), which is optimal. This is an instance of the 0–1 knapsack problem.\n\nAdditional requirements can be incorporated without changing the basic framework. For example, \\(x_3\\le x_1\\) would require project \\(1\\) whenever project \\(3\\) is selected, changing the feasible combinations and potentially the optimum."
    },
    {
      "heading": "Linear relaxation and formulation strength",
      "text": "Replacing the binary restrictions by\n\n\\[0\\le x_i\\le 1\\]\n\nproduces the linear programming relaxation, which is a linear program. Its feasible region is a polyhedron containing every feasible binary solution, but usually also fractional points.\n\nFor a minimization problem, the relaxation gives a lower bound on the binary optimum; for a maximization problem, it gives an upper bound. If an optimal relaxation solution is binary, it is also optimal for the original problem.\n\nFractional solutions need not have a meaningful decision interpretation. Consider\n\n\\[\\max\\{x_1+x_2: 2x_1+2x_2\\le 3,\\; x_1,x_2\\in\\{0,1\\}\\}.\\]\n\nThe binary optimum is \\(1\\), whereas the relaxation has optimum \\(1.5\\). Rounding a fractional solution is not generally sufficient: rounding upward can violate constraints, while rounding downward can produce a poor solution.\n\nA formulation is considered stronger when its relaxation more closely approximates the convex hull of feasible binary solutions. In this example,\n\n\\[x_1+x_2\\le 1\\]\n\nis valid for all feasible binary points and removes the fractional advantage. Such inequalities can greatly improve computation without eliminating any legitimate discrete solution.\n\nSome structured models have integral relaxations. For instance, total unimodularity of the constraint matrix, together with integral right-hand sides and appropriate integral bounds, guarantees integral vertices. In such cases, linear programming can solve the discrete problem without branching."
    },
    {
      "heading": "Computational complexity",
      "text": "Binary linear programming is NP-hard in general. For rational input data, deciding whether a feasible binary solution exists is NP-complete. The threshold decision problem—whether a feasible solution has objective value at least or at most a specified bound—is also NP-complete.\n\nOne reason is that logical formulas in conjunctive normal form can be translated into binary linear inequalities, one inequality for each clause. An arbitrary efficient algorithm for binary feasibility would therefore solve Boolean satisfiability efficiently.\n\nEnumerating all \\(2^n\\) assignments is an exact method, but its worst-case running time is exponential in the number of variables. Nevertheless, worst-case complexity does not predict every practical instance. Constraint structure, sparsity, relaxation quality, symmetry, and the availability of good feasible solutions can matter as much as the variable count."
    },
    {
      "heading": "Solution methods",
      "text": "Branch-and-bound\n\nBranch-and-bound divides the problem into subproblems, typically by selecting a fractional binary variable and creating two branches:\n\n\\[x_i=0 \\qquad\\text{and}\\qquad x_i=1.\\]\n\nLinear relaxations provide bounds for the subproblems. A branch can be discarded when it is infeasible or cannot improve upon the best known feasible solution, called the incumbent.\n\nFor minimization, the incumbent supplies an upper bound, while bounds from the unresolved search nodes supply a global lower bound. When the bounds meet, optimality has been established.\n\nCutting planes and branch-and-cut\n\nA cutting plane is an inequality satisfied by every feasible integer solution but violated by a current fractional relaxation solution. Cuts strengthen relaxations and can reduce the amount of branching required.\n\nModern general-purpose solvers commonly combine branching, cuts, preprocessing, and heuristics in branch-and-cut algorithms. Preprocessing may fix variables, tighten bounds, detect contradictions, or simplify constraints before and during the search.\n\nHeuristics and specialized algorithms\n\nHeuristics seek good feasible solutions without necessarily proving optimality. Examples include constructive selection rules, local search, and simulated annealing. Solver heuristics may also solve restricted subproblems or search near an existing solution.\n\nSpecialized algorithms can outperform general-purpose methods for particular structures. For example, knapsack problems admit dynamic programming algorithms whose running time is polynomial in an integer capacity value, though not necessarily in its binary encoding length. Such algorithms are called pseudo-polynomial."
    },
    {
      "heading": "Applications",
      "text": "Binary integer programming is widely used for decisions involving selection, allocation, and sequencing:\n\n- Facility location: deciding which facilities to open, often alongside continuous shipment quantities.\n- Scheduling: assigning workers, machines, or jobs to time periods.\n- Network design: selecting links subject to connectivity, capacity, or cost requirements.\n- Set covering: choosing a minimum-cost collection of sets that covers specified elements.\n- Routing: selecting edges in a traveling salesperson problem or related vehicle-routing model.\n- Assignment: matching tasks to resources under exclusivity and compatibility constraints.\n\nIn routing, local degree constraints alone generally do not enforce a single connected tour; additional constraints are needed to eliminate disconnected subtours. This illustrates an important distinction between a model that resembles a problem and one that fully expresses its requirements."
    },
    {
      "heading": "Relationship to other optimization models",
      "text": "A bounded nonnegative integer variable \\(y\\), with \\(0\\le y\\le U\\), can be encoded using binary variables:\n\n\\[y=\\sum_{k=0}^{K-1}2^k x_k, \\qquad K=\\left\\lceil\\log_2(U+1)\\right\\rceil,\\]\n\nfor \\(U\\ge 1\\), together with \\(y\\le U\\) when needed. Thus bounded general-integer linear models can be transformed into binary models. The transformation changes the number of variables, coefficient sizes, and relaxation behavior, so it does not automatically improve computational performance.\n\nBinary quadratic optimization uses an objective such as \\(x^\\top Qx+c^\\top x\\). It may be reformulated using product linearizations, but it is not itself a binary linear program. Likewise, restricting variables to two values does not make a problem an instance of convex optimization: the binary feasible domain is generally nonconvex."
    },
    {
      "heading": "Practical limitations",
      "text": "Model quality strongly influences solution difficulty. Weak relaxations, excessive big-M constants, and interchangeable decisions can produce large search trees. Symmetry-breaking constraints may remove equivalent representations, but must preserve at least one representative of every relevant solution class.\n\nOptimization software normally uses floating-point arithmetic and numerical feasibility tolerances. A reported binary value can therefore differ slightly from an exact integer, and optimality may be reported within a specified gap rather than as exact equality of mathematical bounds. Solver status, objective bounds, and tolerances are distinct parts of interpreting a computational result.\n\nFinally, an optimal solution is optimal only for the stated model and data. Binary decisions can represent choices precisely, but the formulation does not by itself account for omitted constraints, uncertain inputs, or objectives that were not encoded."
    }
  ],
  "links": [
    "mathematical-optimization",
    "integer-programming",
    "operations-research",
    "objective-function",
    "matrix",
    "feasible-set",
    "propositional-logic",
    "boolean-satisfiability-problem",
    "numerical-stability",
    "knapsack-problem",
    "linear-programming",
    "polyhedron",
    "convex-hull",
    "np-hardness",
    "conjunctive-normal-form",
    "branch-and-bound",
    "simulated-annealing",
    "dynamic-programming",
    "traveling-salesman-problem",
    "integer",
    "convex-optimization",
    "floating-point-arithmetic"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}