Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Which callback I should do ?

    Posted 01/09/13 05:30 PM

    Originally posted by: bqt


    Hi all,

    I am trying to use CPLEX to solve a problem with the separation technique. After solving LP relaxation at a node, I will find some cuts (constraints) to add into the current model, I would like to add these cuts into the current model. What is callback i should to implement ?

    Now I am using LazyConstraintCallBack, but it cannot present my expectation. Could you please give me some advices ?

    Thanks a lot,
    Trung
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Which callback I should do ?

    Posted 01/10/13 02:55 AM

    Originally posted by: SystemAdmin


    Please refer to the user manual to learn about the difference between lazy constraints and user cuts.
    The lazy constraint callback is only invoked when CPLEX finds an integral feasible solution. In contrast the user cut callback is invoked at every node, so this might be the one you want to use.
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Which callback I should do ?

    Posted 01/10/13 03:43 AM

    Originally posted by: bqt


    Thanks you for your reply.

    I found that "The constraints added in a UserCutCallbackI must be real cuts in the sense that omitting them does not affect the feasible region of the model under consideration". It means that I cannot post more constraints that affect the feasible region. I would like to post constraints that affect strongly feasible solution at each node (after PL relaxation is just solved), could you please give me some advices ?

    Thank you so much,

    Trung
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Which callback I should do ?

    Posted 01/10/13 05:28 AM

    Originally posted by: SystemAdmin


    Note that "feasible region" means the integer feasible solution here.
    It is fine to post cuts that cut off only fractional solutions.
    If at each node you want to add constraints that (may) cut off integer feasible solutions then the lazy constraint callback is the wrong callback to use (since it is invoked only for integer feasible nodes/solutions).
    You could use a branch callback and add your constraints to the newly created nodes. The branch callback allows you to create nodes with any number of constraints.
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Which callback I should do ?

    Posted 01/10/13 09:11 AM

    Originally posted by: bqt


    Thanks for your reply, I will try it now.
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Which callback I should do ?

    Posted 01/13/13 08:27 AM

    Originally posted by: geffer


    It depends on what would want and property of constraint

    1 If I know the constraint at modeling time, and it has a reasonable chance of being binding, it goes into the model as a normal constraint.

    2. If I know the constraint at modeling time, but it is unlikely to be binding, it goes into the model as a lazy constraint. This usually occurs when the constraint is part of a large collection of constraints, such as subtour elimination constraints.

    3. If the constraint its unknown at modeling time, I ads it in a callback.

    Ps: Paul's blog has clearly clarified the difference between user cur and lazy constraints.
    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Which callback I should do ?

    Posted 02/10/13 12:47 PM

    Originally posted by: bqt


    Hi,

    I would like to add sub-tour elimination constraints (SECs) into current LP subproblem. I know that we cannot post them as normal constraints because there are exponential number of SECs.

    In Cplex 12.2, we can use IloCplex::CutCallbackI to add SECs into current LP subproblem ( it is possible to add SECs into LP subproblem as local or global cuts).

    Now I am using Cplex 12.4, IloCplex::CutCallbackI is no longer available. There is only a solution of using loCplex::BranchCallbackI to create a child node within SECs ? And how to post SECs as global cuts or local cuts (Cplex 12.2 can do it with CutCallbackl) ?

    Thanks
    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: Which callback I should do ?

    Posted 02/10/13 12:54 PM

    Originally posted by: SystemAdmin


    You can use either IloUserCutCallbackI or IloLazyConstraintCallbackI.
    Please refer to the user manual to read about the difference between user cuts and lazy constraints.
    UserCutCallback and LazyConstraintCallback give you better control about when to add constraints than the old CutCallback did.
    #CPLEXOptimizers
    #DecisionOptimization


  • 9.  Re: Which callback I should do ?

    Posted 02/10/13 01:13 PM

    Originally posted by: bqt


    I have been consulted the manual (http://pic.dhe.ibm.com/infocenter/cosinfoc/v12r4/index.jsp)

    In Cplex 12.4, "The constraints added in a UserCutCallbackI must be real cuts in the sense that omitting them does not affect the feasible region of the model under consideration.". In my experiences, sub-tour elimination constraints (SECs) affect strongly the feasible region of the model and posting SECs within UserCutCallbackl may result in incorrected solutions.

    So, what is a solution to my problem ?

    Thanks,
    #CPLEXOptimizers
    #DecisionOptimization


  • 10.  Re: Which callback I should do ?

    Posted 02/10/13 01:26 PM

    Originally posted by: SystemAdmin


    In that case use a LazyConstraintCallbackI.
    This callback will be invoked for each integral solution found.
    If that is not often enough for you, then you can also use a LazyConstraintCallbackI and a UserCutCallbackI that both implement the same separation procedure (it is an error to use only a UserCutCallbackI in your case).
    #CPLEXOptimizers
    #DecisionOptimization


  • 11.  Re: Which callback I should do ?

    Posted 02/10/13 01:45 PM

    Originally posted by: bqt


    Thank you so much for your solution. I will try it right now.
    #CPLEXOptimizers
    #DecisionOptimization