With the zoo example
execute
{
cplex.intsollim=2;
}
int nbKids=300;
float costBus40=500;
float costBus30=400;
dvar int+ nbBus40;
dvar int+ nbBus30;
minimize
costBus40*nbBus40 +nbBus30*costBus30;
subject to
{
40*nbBus40+nbBus30*30>=nbKids;
}
execute
{
writeln(cplex.getBestObjValue());
writeln(cplex.getObjValue());
}
gives
3750
3900
and with constraint programming
using CP;
execute
{
cp.param.SolutionLimit=1;
cp.param.SearchType=24;
}
int nbKids=300;
float costBus40=500;
float costBus30=400;
dvar int+ nbBus40;
dvar int+ nbBus30;
minimize
costBus40*nbBus40 +nbBus30*costBus30;
subject to
{
40*nbBus40+nbBus30*30>=nbKids;
}
execute
{
writeln(cp.getObjBound());
writeln(cp.getObjValue());
writeln(cp.getObjGap());
}
gives
0
4000
1
------------------------------
[Alex] [Fleischer]
[Data and AI Technical Sales]
[IBM]
------------------------------
Original Message:
Sent: Tue January 23, 2024 10:08 AM
From: Berkay Orkun Erkılınç
Subject: GAP VALUE in IBM CPLEX ILOG
Dear Mr.Alex thank you for answer. However, I want to learn how it is calculated in the system . Is there any specific formula for that ?
------------------------------
Berkay Orkun Erkılınç
Original Message:
Sent: Tue January 23, 2024 09:53 AM
From: ALEX FLEISCHER
Subject: GAP VALUE in IBM CPLEX ILOG
same question at https://stackoverflow.com/questions/77867129/ibm-cplex-gap-value-calculation-and-meani/77867176#77867176
In the documentation you can read
gap The relative difference between the integer solution found and the proven best possible objective solution value
If the gap is 0 then you have a solution that is proved to be optimal
------------------------------
[Alex] [Fleischer]
[Data and AI Technical Sales]
[IBM]
Original Message:
Sent: Tue January 23, 2024 09:46 AM
From: Berkay Orkun Erkılınç
Subject: GAP VALUE in IBM CPLEX ILOG
Hello,
In IBM cplex ılog, I am working at constraint programming for job shop scheduling. I need GAP values of the output. In IBM , I can get value of GAP . For a example in the picture that ı shared gap value is %0,00. How can this value calculate from the system? and what is the meaning of GAP for IBM CPLEX ILOG terminology. Can you help me with that ?
------------------------------
Berkay Orkun Erkılınç
------------------------------