Hi,
by changing bounds of a constraint you could do that.
Let me start with https://www.ibm.com/developerworks/community/forums/html/topic?id=4b0b67f3-bfb7-4a37-aef2-887c606153ce&ps=25
int nbKids=300;
float costBus40=500;
float costBus30=400;
dvar int+ nbBus40;
dvar int+ nbBus30;
minimize
costBus40*nbBus40 +nbBus30*costBus30;
subject to
{
ctKids:40*nbBus40+nbBus30*30>=nbKids;
}
execute
{
writeln("nbBus40 = ",nbBus40);
writeln("nbBus30 = ",nbBus30);
}
main
{
thisOplModel.generate();
cplex.solve();
thisOplModel.postProcess();
//now we remove the constraint 300 kids need to go to the zoo
writeln("remove the constraint ");
thisOplModel.ctKids.LB=-100000;
cplex.solve();
thisOplModel.postProcess();
}
gives
nbBus40 = 6
nbBus30 = 2
remove the constraint
nbBus40 = 0
nbBus30 = 0
and shows you how to remove a constraint
Many very simple examples at https://www.linkedin.com/pulse/making-decision-optimization-simple-alex-fleischer/
regards
#DecisionOptimization#OPLusingCPLEXOptimizer