How to conditionalize a constraint in mip?

2 Ansichten (letzte 30 Tage)
Christian Piwitt
Christian Piwitt am 24 Nov. 2015
Kommentiert: Nana am 11 Jun. 2016
I have an integer variable X that counts down. When it takes the value of zero a binary variable A should take the value 1. Is there a way to do this in Matlab?

Akzeptierte Antwort

Matt J
Matt J am 24 Nov. 2015
Impose the linear constraints
A+X>=1
A<=1-X/Xmax
where Xmax is the maximum value that X can assume.
  6 Kommentare
Matt J
Matt J am 10 Jun. 2016
I don't see any X's in there...
Nana
Nana am 11 Jun. 2016
I thought a is similar with X, but then I realized X is count-down integer, not continuous variable. Anyway, do you still any idea to solve it? Thanks.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Matt J
Matt J am 24 Nov. 2015
Bearbeitet: Matt J am 25 Nov. 2015
Decompose into 2 sub-problems.
  1. A version of the original problem where A is fixed at 0, and a lower bound of 1 is applied to X
  2. A version of the original problem where X is fixed at 0 and A is fixed at 1.
Then see which sub-problem produces the more optimal value.

Kategorien

Mehr zu Get Started with Optimization Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by