Pergunta

I am writing code in c++ and calling CPLEX to solve it. It finds a very good solution quickly, but takes a very long time trying to improve it. So I want to set the gap to a larger value to terminate the code, and this is what I use:

    cplex_model.setParam(EpGap, 0.01);

But the compiler gives me an error saying EpGap is an undeclared identifier. What is the default name for relative gap?

Foi útil?

Solução

EpGap is a part of an enum within the class IloCplex

cplex_model.setParam(IloCplex::EpGap, 0.01);

Outras dicas

cplex_model.setParam(IloCplex::EpGap, 0.01); is correct

If the EpGap is 1 (1%) it goes to the next feasible solution found that gives a duality gap of 1% or less, so once it goes under 1% it should stop and give you that solution. So in your case, it may go from duality gap > 1% to 0.43%!

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top