5.5.1. Modeling for Mixed Integer Quadratic Programming¶
A linear-constrained mixed integer quadratic program (referred to as MIQP for simplicity) can be represented as follows:
- where
\(x \in \mathbb{R}^{n}\) is the decision variable,
\(l^c \in \mathbb{R}^{n}\) and \(u^c \in \mathbb{R}^{n}\) are the lower and upper bounds of \(x\),
\(c^f \in \mathbb{R}\) is the constant term in the objective function,
\(c \in \mathbb{R}^{n}\) is the linear coefficient in the objective function,
\(Q \in \mathbb{R}^{n\times n}\) is the quadratic coefficient matrix in the objective function,
\(A \in \mathbb{R}^{m \times n}\) is the constraint matrix,
\(l^r \in \mathbb{R}^{m}\) and \(u^r \in \mathbb{R}^{m}\) are the lower and upper bounds of the constraints,
\(x_k \in I\) are integer variables.
The steps to use MindOpt are as follows:
Create an optimization model;
Input the optimization problem and set algorithm parameters;
Solve the optimization problem and retrieve the optimal solutions.
Note
MindOpt only stores the non-zero elements in the constraint matrices A and \(Q\). Therefore, we only need to input the positions and the values of the non-zero elements during the modeling process. Currently MindOpt supports solving convex Mixed Integer quadratically constrained programming. Thus it requires the quadratic coefficient matrices in the objective \(Q_0\) and quadratic constraints \(\{Q_i \mid i=1,2,\cdots,m\}\) to be positive semi-definite. When users input quadratic constraints in the direction of \(\geq\), then it requires the quadratic matrices to be negative semi-definite.
5.5.1.1. Example of Mixed Integer Quadratic Programming¶
We consider the following Quadratic Programming problem:
The only difference between the above quadratic programming and linear programming is the input of the quadratic item matrix \(Q\). We will provide example codes illustrating how MindOpt models and solves the above QP problem in different programming languages.