Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  setSolution does not accept feasible solutions

    Posted 06/09/20 03:25 AM
    Hi everyone,

    I'm using Heuristic callback using .NET with CPLEX 12.9. During the callback, I improve the current solution and use setSolution() method to inject my solution as the new incumbent solution. However, CPLEX seems not to accept my solution. More precisely, I do the following:
    1. The problem is a large MIP. During the callback, I use setBounds(vars, vals, vals) method to change the values of integer/binary variables to heuristic values. The setBounds() is not necessarily called only once and not necessarily contains all integer/binary variables, but I make sure that all integer/binary variables in my model are eventually integer and binary, respectively. I call the method many times. But before using setBounds(), I call GetFeasibilities() to make sure that none of the variables are implied.
    2. After making sure that the heuristic solution is feasible (i.e., the status all integer/binary variables are either integer feasible or implied) and it is better than the current incumbent solution, I use setSolution(vars, vals, obj) to inject the heuristic solution. However, CPLEX seems not to accept the solution. I say this because I check whether my injected solution is passed to the incumbentCallback. The injected solution is not passed.
    3. I do not call setSolution() more than once per callback invocation. In fact I don't inject the heuristic solution if it is worse than the preceding injected solutions. 
    That said, I am suspicious that the problem may be due to SOS constraints in my model. Although I couldn't find any reference to it in the documentation, a reply to this post hints it. Does anyone have an idea on that?

    Thanks in advance.

    ------------------------------
    Faruk Akin
    ------------------------------

    #DecisionOptimization


  • 2.  RE: setSolution does not accept feasible solutions

    Posted 06/09/20 05:04 AM
    Do you calls the callback's solve() method anywhere in your process? Do you provide values for all variables in the call to setSolution()? Does the problem persist if you disable dual and/or non-linear reductions? I don't understand your comment about SOS constraints. Does your solution satisfy all the SOS constraints or might it violated some of them?

    ------------------------------
    Daniel Junglas
    ------------------------------



  • 3.  RE: setSolution does not accept feasible solutions

    Posted 06/09/20 08:31 AM
    Edited by System Admin 01/20/23 04:13 PM
    Thank you for your reply Daniel. Sorry, I forgot to include that I call the callback's solve() method right after calling SetBounds() method. Yes, I provide values for all variables in the call to SetSolution() method. I disabled dual and/or non-linear reductions, but still the heuristic solution is not accepted. 

    About SOS constraints, I thought that having SOS constraints in the model would be a problem for SetSolution() based on your reply to a post. It seems that some of the SOS constraints are not satisfied although the resulting LP's (with feasibility status either integerFeasible or implied for all variables) status is optimal. 

    How can I check before using the SetSolution() method whether SOS constraints are satisfied? And is there a way to force all of the continuous variables except one in SOS1 constraint to zero? 


    ------------------------------
    Faruk Akin
    ------------------------------