Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Bounds and UserCutCallback

    Posted 05/24/12 07:39 AM

    Originally posted by: Tulkas


    Hello,

    I generate some local cuts thanks to C++ UserCutCallback mechanism, exploiting the decisions CPLEX has already taken throughout the branch and cut algorithm. In other words, at any given node, I use only the variables so that getLB(var) == getUB(var) +/- EPSILON to perform some deductions which are specific to my MILP model.

    Imagine the constraints:
    (1) x1 boolean
    (2) x2 boolean
    (3) x1 + x2 <= 1
    and the current state:
    LB(x1) = LB(x2) = 0
    UB(x1) = UB(x2) = 1

    Thanks to other variables, I deduce x1 = 1 and so execute addLocal(x1 == 1).

    MY PROBLEM:

    At the next call of my callback, I have the following state:
    getValue(x1) = 1
    getValue(x2) = 0 (neither my cut, nor my constraints (1)..(3) are violated)

    but I still have something like:
    LB(x1) = LB(x2) = 0
    UB(x1) = UB(x2) = 1
    or:
    LB(x1) = 1 / LB(x2) = 0
    UB(x1) = 1 / UB(x2) = 1

    I consenquently miss some new possible deductions or worse, I deduce wrong things...

    QUESTION:

    Is it possible to set bounds of variables (x1 and x2) inside a UserCutCallback or using other tricks ? I would like to have:
    LB(x1) = 1 / LB(x2) = 0
    UB(x1) = 1 / UB(x2) = 0

    In other words, is it possible to "propagate" constraints after any call of my deuction routine ?

    Thanks a lot,
    Tulkas
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Bounds and UserCutCallback

    Posted 05/24/12 11:38 AM

    Originally posted by: SystemAdmin


    Adding a (local) cut will not necessarily affect the bounds that CPLEX stores.
    If you can fix variables by your deduction algorithm then you are probably better off using a branch callback rather than a usercut callback. In the branch callback you could just create a single new node with all the fixings/bound strengthenings you could deduce. This will affect all bounds in the subtree rooted at the newly created node.

    Or did I get you wrong and the fixings you deduce are globally valid and you want to change the global bounds for variables?
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Bounds and UserCutCallback

    Posted 05/25/12 08:14 AM

    Originally posted by: Tulkas


    My deductions are not global. I'll try to use branch callback and keep you in touch !

    Thanks a lot.
    Tulkas
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Bounds and UserCutCallback

    Posted 05/27/12 03:05 PM

    Originally posted by: Tulkas


    I might be wrong but I have the feeling BranchCallback do not eliminate nodes I would like to prune thanks to my deductions. Considering the same example presented above, if I deduce x=1, I jump to node:

    LB(x1) = 1 / LB(x2) = 0
    UB(x1) = 1 / UB(x2) = 0

    thanks to makebranch(...) method, but I think CPLEX might still generate unwanted nodes later...

    Example of undesirable node:
    LB(x1) = 1 / LB(x2) = 0
    UB(x1) = 1 / UB(x2) = 1 (see above for more details)

    Am I Wrong ?

    Thanks a lot,
    Tulkas
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Bounds and UserCutCallback

    Posted 05/28/12 03:27 AM

    Originally posted by: SystemAdmin


    > I might be wrong but I have the feeling BranchCallback do not eliminate nodes I would like to prune thanks to my deductions. Considering the same example presented above, if I deduce x=1, I jump to node:
    >
    > LB(x1) = 1 / LB(x2) = 0
    > UB(x1) = 1 / UB(x2) = 0
    >
    > thanks to makebranch(...) method,
    >
    When you do that, do you only specify LB(x1)=1 to makebranch() or do you also specify UB(x2)=0 for the new node?

    > but I think CPLEX might still generate unwanted nodes later...
    >
    > Example of undesirable node:
    > LB(x1) = 1 / LB(x2) = 0
    > UB(x1) = 1 / UB(x2) = 1 (see above for more details)
    >
    Are you sure that this node is a descendant of the node you created above? Maybe this "unwanted" node is in a completely different part of the tree?

    > Am I Wrong ?
    >
    Most probably yes. If you have UB(x2)=0 (for binary x2) for a node in the tree then CPLEX will never create a descendant node with UB(x2)=1 for that node.
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Bounds and UserCutCallback

    Posted 05/30/12 09:45 AM

    Originally posted by: Tulkas


    I think it works (I specify both LB(x1)=1 and UB(x2)=0) :-)

    Thanks a lot !
    Tulkas
    #CPLEXOptimizers
    #DecisionOptimization