Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Java - efficient copying/cloning of models read from .lp files

    Posted 10/05/15 12:58 AM

    Originally posted by: LGFearnley


    I'm looking for the most efficient way to clone an IloCplex model using the Java API.

    Essentially I have a core problem which I'm solving, then deriving child problems from (which add additional constraints to the original).

    I've tried two candidate approaches:

    1) Load an lp file from disk using IloCplex.importModel(), then load subsequent copies from the same file using IloCplex.importModel();

    2) Load an lp file from disk using IloCplex.importModel(), then clone the objective and ranges using an IloCopyManager instance as described in this Technote from the FAQs.

    Loading the lp file from disk seems to be dramatically faster - loading and solving an individual IloCplex instance takes on the order of 0.1s, whereas using the IloCopyManager is taking about 7s per problem from copying to solution.

    Is there a faster way to achieve what I'm after here?


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Java - efficient copying/cloning of models read from .lp files

    Posted 10/15/15 08:37 AM

    Have you tried SAV files instead of LP files?

    You may also want to take a look at the CplexServer.java example shipped with CPLEX. This illustrates how you can create a model that can be serialized. Instead of LP and SAV files you could try using this serialized object.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Java - efficient copying/cloning of models read from .lp files

    Posted 10/15/15 07:09 PM

    Originally posted by: LGFearnley


    I haven't tried SAV files - I can't readily use these in my application. The use of the LP file format allows me to switch out ILOG/CPLEX for glpk (parallelised using OpenMPI), which is a requirement for being able to distribute my code to people without ILOG licenses.

    In the end, I opted to implement a threading system where each thread has an IloCplex object - the additional constraints are added to this object, the object is solved, then the constraints are removed (returning the constraint set to the original condition). This effectively warm-starts the solver on subsequent problems, but this isn't a problem in my specific application thus far...


    #CPLEXOptimizers
    #DecisionOptimization