问题
I have two questions:
In IBM ILOG CPLEX, I wrote an OPL project. Because the code works with large scale data, it takes a lot of time to solve. What is the code for limitation the gap tolerance of MIP Problem and limitation the time?
I want to have a CSV file containing my desired results. For example, I want to have an objective function and runtime and the facility variable in a CSV file. I got all these results but I want them to be written in a CSV file too.
回答1:
1) Add the following code before the minimize
statement in your .mod
file.
execute
{
cplex.tilim=30; // 20 s time limt
cplex.epgap=0.01 // 1% gep
}
You can confirm that it is taken into account by examining the engine log. It should have something like this at the very beginning:
CPXPARAM_TimeLimit 30
CPXPARAM_MIP_Tolerances_MIPGap 0.01
2) You may rely on IloOplOutputFile
See example in https://www.ibm.com/developerworks/community/forums/html/topic?id=3fd44d41-210b-4b81-a005-819530d6377b&ps=25
来源:https://stackoverflow.com/questions/56448457/set-limitation-on-gap-tolerance-and-run-time