An integer programming problem is a
mathematical optimization
Mathematical optimization (alternatively spelled ''optimisation'') or mathematical programming is the selection of a best element, with regard to some criterion, from some set of available alternatives. It is generally divided into two subfi ...
or
feasibility program in which some or all of the variables are restricted to be
integer
An integer is the number zero (), a positive natural number (, , , etc.) or a negative integer with a minus sign ( −1, −2, −3, etc.). The negative numbers are the additive inverses of the corresponding positive numbers. In the language ...
s. In many settings the term refers to integer
linear programming
Linear programming (LP), also called linear optimization, is a method to achieve the best outcome (such as maximum profit or lowest cost) in a mathematical model whose requirements are represented by linear relationships. Linear programming is ...
(ILP), in which the objective function and the constraints (other than the integer constraints) are
linear
Linearity is the property of a mathematical relationship ('' function'') that can be graphically represented as a straight line. Linearity is closely related to '' proportionality''. Examples in physics include rectilinear motion, the linear ...
.
Integer programming is
NP-complete
In computational complexity theory, a problem is NP-complete when:
# it is a problem for which the correctness of each solution can be verified quickly (namely, in polynomial time) and a brute-force search algorithm can find a solution by tryin ...
. In particular, the special case of 0-1 integer linear programming, in which unknowns are binary, and only the restrictions must be satisfied, is one of
Karp's 21 NP-complete problems
In computational complexity theory, Karp's 21 NP-complete problems are a set of computational problems which are NP-complete. In his 1972 paper, "Reducibility Among Combinatorial Problems", Richard Karp used Stephen Cook's 1971 theorem that the bo ...
.
If some decision variables are not discrete, the problem is known as a mixed-integer programming problem.
Canonical and standard form for ILPs
In integer linear programming, the ''canonical form'' is distinct from the ''standard form''. An integer linear program in canonical form is expressed thus (note that it is the
vector which is to be decided):
:
and an ILP in standard form is expressed as
:
where
are vectors and
is a matrix. As with linear programs, ILPs not in standard form can be
converted to standard form by eliminating inequalities, introducing slack variables (
) and replacing variables that are not sign-constrained with the difference of two sign-constrained variables
Example

The plot on the right shows the following problem.
:
The feasible integer points are shown in red, and the red dashed lines indicate their convex hull, which is the smallest convex polyhedron that contains all of these points. The blue lines together with the coordinate axes define the polyhedron of the LP relaxation, which is given by the inequalities without the integrality constraint. The goal of the optimization is to move the black dashed line as far upward while still touching the polyhedron. The optimal solutions of the integer problem are the points
and
which both have an objective value of 2. The unique optimum of the relaxation is
with objective value of 2.8. If the solution of the relaxation is rounded to the nearest integers, it is not feasible for the ILP.
Proof of NP-hardness
The following is a reduction from minimum
vertex cover
In graph theory, a vertex cover (sometimes node cover) of a graph is a set of vertices that includes at least one endpoint of every edge of the graph.
In computer science, the problem of finding a minimum vertex cover is a classical optimiza ...
to integer programming that will serve as the proof of NP-hardness.
Let
be an undirected graph. Define a linear program as follows:
:
Given that the constraints limit
to either 0 or 1, any feasible solution to the integer program is a subset of vertices. The first constraint implies that at least one end point of every edge is included in this subset. Therefore, the solution describes a vertex cover. Additionally given some vertex cover C,
can be set to 1 for any
and to 0 for any
thus giving us a feasible solution to the integer program. Thus we can conclude that if we minimize the sum of
we have also found the minimum vertex cover.
Variants
Mixed-integer linear programming (MILP) involves problems in which only some of the variables,
, are constrained to be integers, while other variables are allowed to be non-integers.
Zero-one linear programming (or binary integer programming) involves problems in which the variables are restricted to be either 0 or 1. Any bounded integer variable can be expressed as a combination of
binary variables. For example, given an integer variable,
, the variable can be expressed using
binary variables:
:
Applications
There are two main reasons for using integer variables when modeling problems as a linear program:
#The integer variables represent quantities that can only be integer. For example, it is not possible to build 3.7 cars.
#The integer variables represent decisions (e.g. whether to include an edge in a
graph
Graph may refer to:
Mathematics
*Graph (discrete mathematics), a structure made of vertices and edges
**Graph theory, the study of such graphs and their properties
*Graph (topology), a topological space resembling a graph in the sense of discre ...
) and so should only take on the value 0 or 1.
These considerations occur frequently in practice and so integer linear programming can be used in many applications areas, some of which are briefly described below.
Production planning
Mixed-integer programming has many applications in industrial productions, including job-shop modelling. One important example happens in agricultural
production planning
Production planning is the planning of production and manufacturing modules in a company or industry. It utilizes the resource allocation of activities of employees, materials and production capacity, in order to serve different customers.Fa ...
involves determining production yield for several crops that can share resources (e.g. Land, labor, capital, seeds, fertilizer, etc.). A possible objective is to maximize the total production, without exceeding the available resources. In some cases, this can be expressed in terms of a linear program, but the variables must be constrained to be integer.
Scheduling
These problems involve service and vehicle scheduling in transportation networks. For example, a problem may involve assigning buses or subways to individual routes so that a timetable can be met, and also to equip them with drivers. Here binary decision variables indicate whether a bus or subway is assigned to a route and whether a driver is assigned to a particular train or subway. The zero-one programming technique has been successfully applied to solve a project selection problem in which projects are mutually exclusive and/or technologically interdependent. It is used in a special case of integer programming, in which all the decision variables are integers. It can assume the values either as zero or one.
Territorial partitioning
Territorial partitioning or districting problem consists in partitioning a geographical region into districts in order to plan some operations while considering different criteria or constraints. Some requirements for this problem are: contiguity, compactness, balance or equity, respect of natural boundaries, and socio-economic homogeneity. Some applications for this type of problem include: political districting, school districting, health services districting and waste management districting.
Telecommunications networks
The goal of these problems is to design a network of lines to install so that a predefined set of communication requirements are met and the total cost of the network is minimal. This requires optimizing both the topology of the network along with the setting the capacities of the various lines. In many cases, the capacities are constrained to be integer quantities. Usually there are, depending on the technology used, additional restrictions that can be modeled as linear inequalities with integer or binary variables.
Cellular networks
The task of frequency planning in
GSM
The Global System for Mobile Communications (GSM) is a standard developed by the European Telecommunications Standards Institute (ETSI) to describe the protocols for second-generation ( 2G) digital cellular networks used by mobile devices such as ...
mobile networks involves distributing available frequencies across the antennas so that users can be served and interference is minimized between the antennas. This problem can be formulated as an integer linear program in which binary variables indicate whether a frequency is assigned to an antenna.
Other applications
*
Cash flow matching
*
Energy system
An energy system is a system primarily designed to supply energy-services to end-users. The intent behind energy systems is to minimise energy losses to a negligible level, as well as to ensure the efficient use of energy. The IPCC Fifth As ...
optimization
*
UAV
An unmanned aerial vehicle (UAV), commonly known as a drone, is an aircraft without any human pilot, crew, or passengers on board. UAVs are a component of an unmanned aircraft system (UAS), which includes adding a ground-based controller ...
guidance
Algorithms
The naive way to solve an ILP is to simply remove the constraint that x is integer, solve the corresponding LP (called the
LP relaxation of the ILP), and then round the entries of the solution to the LP relaxation. But, not only may this solution not be optimal, it may not even be feasible; that is, it may violate some constraint.
Using total unimodularity
While in general the solution to LP relaxation will not be guaranteed to be integral, if the ILP has the form
such that
where
and
have all integer entries and
is
totally unimodular, then every basic feasible solution is integral. Consequently, the solution returned by the
simplex algorithm
In mathematical optimization, Dantzig's simplex algorithm (or simplex method) is a popular algorithm for linear programming.
The name of the algorithm is derived from the concept of a simplex and was suggested by T. S. Motzkin. Simplices are no ...
is guaranteed to be integral. To show that every basic feasible solution is integral, let
be an arbitrary basic feasible solution . Since
is feasible,
we know that
. Let