5.2.1. Mixed Integer Linear Programming¶
Mixed Integer Linear Programming (MILP) problems can be described by using the following mathematical model:
- In the preceding model:
\(x \in \mathbb{R}^{n}\) is a decision variable.
\(l^c \in \mathbb{R}^{n}\) and \(u^c \in \mathbb{R}^{n}\) are the lower bound and upper bound of \(x\).
\(c^f \in \mathbb{R}\) is a constant in the target function.
\(c \in \mathbb{R}^{n}\) is a coefficient in the target function.
\(A \in \mathbb{R}^{m \times n}\) is a constraint matrix.
\(l^r \in \mathbb{R}^{m}\) and \(u^r \in \mathbb{R}^{m}\) are the lower bound and upper bound of a constraint.
\(partial\ x \in \mathbb{Z}^{n}\) means the variables are integer.
The procedure of using MindOpt is as follows:
Create an optimization model.
Input an optimization problem and set algorithm parameters.
Solve the problem and obtain the solution.
Note
MindOpt stores only non-zero elements in the constraint matrix \(A\) . Therefore, you only need to input the row/column index and non-zero value of each non-zero element in the constraint matrix.
5.2.1.1. Examples of MILP problems¶
Mixed Integer Linear Programming problem:
The following part describes how to use MindOpt to build a model and solve the optimization problem.
Mixed Integer Linear Programming (MILP) differs from linear programming (LP) in the input of variables. For the modeling of integer constraints, the is_integer
parameter should be set to True
when adding the variables.
You can input non-zero elements into the constraint matrix in two ways:
By row (constraint)
By column (variable)
For more information, see Modeling for linear programming.
Examples are provided for different programming languages.