Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.

 View Only
  • 1.  MIP warmstart: all variables not extracted

    Posted Thu October 27, 2016 11:19 PM

    Originally posted by: JorisK


    Linux, Cplex 12.6.3, Java interface.

    Issue: when warmstarting a cplex MIP model, I get the following error for *all* variables:

    ilog.concert.IloException: The referenced IloExtractable has not been extracted by the IloAlgorithm
    

    This error only occurs, when I import oplall.jar into my project. Without any modifications to my code, the error disappears if I swap out oplall.jar for cplex.jar. When using cplex.jar, the warmstart works as expected without any errors. Consequently, this looks like a bug?

    Unfortunately, I cannot use cplex.jar in my project, since my code relies on both cplex and cp optimizer. Several topics in this forum recommend to use oplall.jar when both CP and Cplex are required, to deal with the infamous "Native code library failed to load: ensure the appropriate library (oplXXX.dll/.so) is in your path." errors.

     

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: MIP warmstart: all variables not extracted

    Posted Mon October 31, 2016 08:08 AM

    This indeed sounds like a bug. Do you have a minimal example to reproduce that?

    In order to work around this could you try if one of this helps:

    1. Add the MIP start only directly before the call to solve()
    2. Explicitly IloCplex::add() all the variables in the MIP start.

    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: MIP warmstart: all variables not extracted

    Posted Mon October 31, 2016 11:15 AM

    Originally posted by: JorisK


    Please find a minimal example attached. To demonstrate the issue, I have modified one of the examples shipped with Cplex. The only modification I have made to this file is the addition of a mip start (3 lines), right before the solve() method is invoked.

    Compile/execute with the following commands (java 8):

     

    1. set LD_LIBRARY_PATH:
    export LD_LIBRARY_PATH=/opt/ILOG/CPLEX_Studio1263/opl/bin/x86-64_linux

    2. Compile:
    javac -cp /opt/ILOG/CPLEX_Studio1263/opl/lib/oplall.jar:. FixCost1.java

    3. Run:
    java -cp /opt/ILOG/CPLEX_Studio1263/opl/lib/oplall.jar:. FixCost1

     

    Result: Concert exception 'ilog.concert.IloException: The referenced IloExtractable has not been extracted by the IloAlgorithm' caught

     

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: MIP warmstart: all variables not extracted

    Posted Mon October 31, 2016 01:37 PM

    Sorry, I had edited my original post but somehow this Forum swallowed that.

    I had already reproduced the issue here. A workaround is to call cplex.exportModel("dummy.sav") before calling addMIPStart(). Another workaround is this sequence before calling addMIPStart():

    final double old = cplex.getParam(IloCplex.DoubleParam.DetTiLim);
    cplex.setParam(IloCplex.DoubleParam.DetTiLim, 0);
    cplex.solve();
    cplex.setParam(IloCplex.DoubleParam.DetTiLim, old);

    You just have to do something that makes sure all changes to the model are actually committed and not stored in internal buffers.

    I have filed a bug report for this problem.


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: MIP warmstart: all variables not extracted

    Posted Mon October 31, 2016 01:43 PM

    Originally posted by: JorisK


    Great, thanks for your quick reply!


    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: MIP warmstart: all variables not extracted

    Posted Wed January 18, 2017 12:58 PM

    Originally posted by: JorisK


    Just to let you know: the issue reported in this topic has not been resolved in Cplex 12.7. Same workaround is still necessary.


    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: MIP warmstart: all variables not extracted

    Posted Thu January 19, 2017 01:58 AM

    Yes, sorry, the bug report/fix came too late to get into the 12.7 release. Here is a shorter workaround: Right before calling addMIPStart() do

    ((ilog.cplex.cppimpl.IloCplex)cplex.getCplexImpl()).extract(cplex.getModelImpl());

    That should do the trick. Note that this works only with oplall.jar, with cplex.jar you will get references to undefined symbols (but for cplex.jar the workaround is not required anyway).


    #CPLEXOptimizers
    #DecisionOptimization