Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

Might a simple OplModel.GetElement() or AsNumMap() be changing the optimisation outcome?

  • 1.  Might a simple OplModel.GetElement() or AsNumMap() be changing the optimisation outcome?

    Posted 06/09/21 10:40 AM
    Hello dear community,

       As a bit of context, our current solution is using CPLEX .NET API with F# in order to control an optimisation process.

       During a phase, we lunch several runs of CPLEX attempting to fix a number of variables (or bound them) to accelerate the process of finding the sweet spot of relaxation following the established business rules.

       During this part of the process, one of our colleague added this line (in order to debug the state of the process) :

       let test = passe.InstanceOPL.Modele.GetElement("varMDG").AsNumMap()

       ...and after this sole modification, it seems like CPLEX is now finding an equivalent solution of the original solution (with same objective) to this part of the process. If we comment the line, it seems we get the original CPLEX answer back.

       ...and what is even stranger is that the F# variable "test" is not even used, so it would be only the "GetElement" (or "AsNumMap") that would be changing the behavior of CPLEX!

       So I am right? It is possible that the invocation of these query functions may affect CPLEX outcome on equivalent solutions?

       Of course we are working on enhancing this process to eliminate the equivalent state. Also, just to mention, should it be the case, we are not necessarily looking for a modification of the API or CPLEX, but we would like to understand the "magic", mostly to ensure that some other part of our code would not responsible of this behavior. :)

       Thanks in advance!

    ------------------------------
    Luc Charest
    ------------------------------

    #DecisionOptimization


  • 2.  RE: Might a simple OplModel.GetElement() or AsNumMap() be changing the optimisation outcome?

    Posted 06/14/21 07:33 AM
    I don't see what can cause this.
    I would check:
    * run the app, but use the setting setWithMultiEnv(false). Your app has a workflow with several OPL/CPLEX, instead of having a fine grained memory management with 1 stack for each, it will use only 1. I doubt your behavior comes a bad copy/new/delete when passing data from 1 object to the other, but I may be wrong.
    * if the workflow correctly handles new/end OPL and CPLEX objects.
    * disable main end methods to see if this comes from memory


    ------------------------------
    Vincent Beraudier
    ------------------------------