Multiplication of two continuous variables

385 Views Asked by At

I am working on MILP problem using AMPL/CPLEX. How to model the multiplication of two continuous variables x,y? and does it make a difference if they are integers?

Thank you.

1

There are 1 best solutions below

0
On

The problem with multiplying two continuous variables is that it will make the model non-linear. There are multiple different methods to handle this, but one thing it is important to recognize is this: linear solvers use variants of the Simplex Method (usually Dual Simplex), which heavily rely on models with non-curved (linear) constraints. Suppose we have a non-linear constraint of the form $x_1x_2\ge25$ which will graphically look like so:

3

There is no way for the Simplex Method to traverse the curved line linearly. So, linear solvers will not be able handle this. There does however exist non-liner solvers, like the GRG Nonlinear, that could assist for this.

However, since you are wanting to work with integers and using CPLEX, here is a forum where this type of question has been asked and answered specifically for CPLEX if you're planning for one of the variables being Boolean: How to multiply a decision variable with a boolean decision variable.


Using AMPL, it is possible to model Non-Linear MIP. Suppose we have the following model:

$$\min z = x + y$$ Subject to: $$xy\ge25$$ $$x^y\le50^{10}$$ $$x\in\Bbb{Z}^+, y\ge1$$

Our .mod file for the AMPL project will look like so:

There exists a list of solvers in AMPL, however for this example we will use LINDO Global. However, do know for a lot of these types of problems Non-Linear solvers will often give you the best local solutions and not the best global solution. For this example, we will be using the following .run configuration:

Thus, the output of the solver will be:

9

The extra at the end of the objective function can be attributed to rounding errors, if we use the MINOS solver to double check the above output we get the following:

10

Which confirms the first output. Here is further reading for Non-Linear MIP