I have a linear program written in MathProg. My unknown binary variable is a two-dimensional array defined as:
var x{i in V, l in L}, >=0, <=1;
where V and L are sets of integers.
The value of some variables, however, are known in advance and I would like to specify this for the solver in order to reduce the size of the ILP. For example I know that x[4,l] when l=2 is 1 and for any other values of l is zero. Currently, I specify this as as a constraint:
s.t. initial4{i in V: i=4}: sum{l in L}(l*x[i,l]) = 2;
I was wondering if this is the efficient way of specifying the values of a subset of unknowns in advance.
Ideally, I would like to place such information in a separate file together with the data section rather than in the model file.
Create an upper bound and lower bound for each variable:
and adjust the lower and upper bounds for the known values.
Here is a MathProg snippet fixing
x[2]
to zero:From the (filtered) output it is clear that the preprocessor is smart enough to fix
x[2]
to 0: