Changing the bound of a CPLEX constraint when search is in progress

363 views
Skip to first unread message

Marek Grześ

unread,
Nov 30, 2013, 11:01:37 PM11/30/13
to ai...@googlegroups.com
Hello,

This example http://pic.dhe.ibm.com/infocenter/oplinfoc/v6r3/topic/ilog.odms.ide.help/examples/html/opl/mulprod/mulprod_change_main.mod.html (line 86) shows how to change the bound of a variable in the model and then run the solver again. I would like to change the bound of a particular variable during "solve()". What would be the easiest way to do that? Could I change the bound of a variable in a callback function in a way that if I return from the callback function the search will continue with the updated bound? Do you know about any examples in OPL, C++, or Java that do something like that? Or maybe it could be easily defined in AIMMS? If not in cplex, would it be possible in gurobi?

Cheers,
Marek

Marcel Hunting

unread,
Dec 2, 2013, 7:58:08 AM12/2/13
to ai...@googlegroups.com
Hello Marek,

I think you can only do that indirectly by using the branch callback of CPLEX which (among others) allows you to create one child node in which the lower or upper bound of a variable is changed. (It might be that the new upper bound must be lower than the original upper bound; I am not sure about that.) Changing the upper bound of a variable in a branch callback can be done by using the function GMP::SolverSession::GenerateBranchUpperBound; there exists a similar function for changing the lower bound. This only works for problems containing integer variables.

For using CPLEX from OPL, C++ or Java you probably get a better answer at the IBM CPLEX forum.

Best regards,

Marcel Hunting
AIMMS Software Developer

Marek Grześ

unread,
Dec 3, 2013, 9:32:05 AM12/3/13
to ai...@googlegroups.com
Hi Marcel,

Thanks for reply. It is a good start for me.

Cheers,
Marek
Reply all
Reply to author
Forward
0 new messages