Stay organized with collections
Save and categorize content based on your preferences.
Integer Optimization
Linear optimization problems that require some of the variables to be integers
are called Mixed Integer Programs (MIPs).
These variables can arise in a couple of ways:
Integer variables that represent numbers of items, such as cars or
television sets, and the problem is to decide how many of each item to
manufacture in order to maximize profit.
Typically, such problems can be set up as standard linear optimization
problems, with the added requirement that the variables must be integers.
The next section shows an example of this
type of problem.
Boolean variables that represent decisions with 0-1 values.
As an example, consider a problem that involves assigning workers to tasks (
see Assignment). To set up this type of problem,
you can define Boolean variables xi,j that equal 1 if worker i
is assigned to task j, and 0 otherwise.
There's no ironclad rule for deciding whether to use a MIP solver or the CP-SAT
solver. As a rough guide:
MIP solvers are better suited for problems that can be set up as a standard LP
, but with arbitrary integer variables, like the first example above.
The CP-SAT solver is better suited for problems in which most of the variables
are Boolean, like the second example above.
For typical MIPs that have both integer and Boolean variables, there's often no
clear difference in speed between the two solvers, so your choice may come down
to personal preference.
For examples that use both the MIP and CP-SAT solvers, see
Solving an Assignment Problem
and the other assignment sections.
Another way to solve integer programming problems is using a
network flow solver.
See Assignment as a Min Cost Flow Problem
for an example.
For a problem that can be set up as a network flow, the min cost flow solver can
be faster than either the MIP or CP-SAT solvers. However, not all MIPs can be
set up this way.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-28 UTC."],[[["Mixed Integer Programs (MIPs) are linear optimization problems where some variables must be integers, representing quantities or decisions."],["Google offers tools for solving MIPs: MPSolver uses standard techniques, while CP-SAT solver employs constraint programming, particularly suitable for problems with many Boolean variables."],["Choosing between MIP and CP-SAT solvers depends on the problem structure, with MIP solvers often preferred for problems with standard LP formulations and arbitrary integer variables, while CP-SAT excels in scenarios dominated by Boolean variables."],["Network flow solvers can offer faster solutions for specific MIPs that can be formulated as network flow problems."]]],["Mixed Integer Programs (MIPs) handle linear optimization problems requiring integer variables, which can represent item counts or Boolean decisions. Google offers MPSolver for MIPs, CP-SAT, and original CP solvers for constraint programming. MIP solvers suit problems with arbitrary integer variables, while CP-SAT excels with predominantly Boolean variables. Network flow solvers are faster for problems adaptable to this format, although not all MIPs fit this structure. The choice between MIP and CP-SAT often depends on problem structure and personal preference.\n"]]