How can I control decision variables?

I use MILP and have two decision variables u(i),v(i). u and v are non-negative variables which cannot both be non-zero simultaneously. more detailed, if u have some value, then v is zero value. The opposite is also true. How can I do that?

Respuestas (1)

Alan Weiss
Alan Weiss el 29 de Oct. de 2017

0 votos

I assume that u and v are integers, because otherwise the problem is ill-posed.
In that case, to say that both variables cannot simultaneously be zero (for nonnegative variables) is equivalent to
u + v >= 1
This is a linear inequality that you can easily put in intlinprog syntax.
For the other part (when one variable is nonzero the other must be zero), I suppose that there is an upper bound M to your variables. In that case, these inequalities enforces that constraint:
(M+1)*u <= v % enforces u = 0 when v >= 1
(M+1)*v <= u % enforces v = 0 when u >= 1
Alan Weiss
MATLAB mathematical toolbox documentation

Categorías

Preguntada:

el 29 de Oct. de 2017

Respondida:

el 29 de Oct. de 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!