• 1 reply
  • Latest Post - ‏2012-11-19T13:45:46Z by SystemAdmin
4 Posts

Pinned topic cplex to cp

‏2012-11-17T03:31:54Z |
I'm a CPLEX user but never used CP. The time has arrived.

I have a CPLEX model for which I just want to obtain a feasible solution, no matter which one, so the objective function is useless for me.
I set the integer solution limit to 1 and solve it with CPLEX.

Can I use the same set of constraints and model objects to solve it using CP? In this case, where would the main modifications be done? Can you point to a example in C++?

Updated on 2012-11-19T13:45:46Z at 2012-11-19T13:45:46Z by SystemAdmin
  • SystemAdmin
    554 Posts

    Re: cplex to cp

    It is quite easy to use a model developped for CPLEX in CP OPtimizer. CP Optimizer is able to handle linear or non-linear models. You need to include cp.h and to replace the sequence

    IloCplex cplex(model);


    IloCP cp(model);

    You can remove the objective function from your model is you wish. Most of CPLEX parameter settings cannot be aplied to CP Optimizer but you will have an output log that will show the search progress.

    Note that, on linear models, CPLEX will give better performance in general than CP Optimizer. To take benefit from CP you will probably have to give more structural information in the model using logical constraints and global constraints. For more details and examples, please have a look at the first chapters of the user manual.