Code: Select all
set testSet / 1 * 7 /;
integer variables
testVar(testSet) a test variable
testVar2(testSet) another test variable
;
free variables
ObjVal The objective function value
;
equations
testEq a test equation
Objective Objective function
;
Objective..
ObjVal =e= sum(testSet, testVar(testSet)) + sum(testSet, testVar2(testSet));
testEq(testSet)..
testVar(testSet) + testVar2(testSet) =l= 14.3;
model testModel
/
Objective
testEq
/;
testVar.l(testSet) = 1;
testVar2.l(testSet) = 0;
execute_unload "test.gdx", testVar.l,
testVar2.l;
$onecho > cplex.opt
mipstart=1
multimipstart=test.gdx
$offecho
testModel.optfile = 1;
solve testModel using mip maximizing ObjVal;
Code: Select all
Processing 2 MIP starts.
MIP start 'm1' defined solution with objective 7.0000.
MIP start 'm2' defined no solution.
1 of 2 MIP starts provided solutions.
MIP start 'm1' defined initial solution with objective 7.0000.
Changing "testVar2.l(testSet) = 0;" to "testVar2.l(testSet) = 1;" and rerunning gives:
Code: Select all
Processing 2 MIP starts.
MIP start 'm1' defined solution with objective 14.0000.
MIP start 'm2' defined solution with objective 14.0000.
2 of 2 MIP starts provided solutions.
MIP start 'm1' defined initial solution with objective 14.0000.