5.1.1. Modeling for Linear Programming¶
A linear programming (LP)problem can be represented in the following mathematical form:
- 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,
\(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.
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 matrix \(A\). Therefore, we only need to input the positions and the values of \(A\)’s non-zero elements during the modeling process.
5.1.1.1. Example of Linear Programming¶
We consider the following linear program:
We will provide example codes of how MindOpt models and solves the above linear program in different programming languages.