solver:how_do_i_fix_a_semiint_cont_variable

A “fixed” semicont variable has still the implicit lower bound of 0. In order to truly fix it the variable needs to be relaxed via RMIP or to add to attribute `prior=INF`

. The example below illustrates this.

variable x,z; semicont variable x; equation e; e.. z =e= x; model m /all/; * A "fixed" semicont variable has still the implicit lower bound of 0 * The domain for x is {0,1} x.fx=1; solve m us mip min z; abort$(abs(z.l-0)>1e-6) 'wrong obj'; * In order to truly fix it the variable needs to be relaxed via RMIP or prior=INF * Solved as an RMIP the domain of x becomes {1} x.fx=1; solve m us rmip min z; abort$(abs(z.l-1)>1e-6) 'wrong obj'; * Solved as a MIP with x.prior=INF the domain of x becomes also {1} x.fx=1; x.prior=INF; solve m us mip min z; abort$(abs(z.l-1)>1e-6) 'wrong obj'; * Since x is not truly fixed (domain is {0,1}) holdfixed does not "hold" x x.fx=1; m.holdfixed=1; solve m us mip min z; abort$(m.numvar<>2) 'x hold incorrectly'; * Holdfixed does not "hold" semicont variables even if they are relaxed and truely fixed x.fx=1; m.holdfixed=1; solve m us rmip min z; abort$(m.numvar<>2) 'x hold incorrectly'; * Holdfixed does not "hold" semicont variables even if they are relaxed and truly fixed x.fx=1; x.prior=INF; m.holdfixed=1; solve m us mip min z; abort$(m.numvar<>2) 'x hold incorrectly';

IMPRESSUM / LEGAL NOTICE
PRIVACY POLICY
solver/how_do_i_fix_a_semiint_cont_variable.txt · Last modified: 2010/05/19 11:07 by support