Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  [C callable] Problem getting presolved problem with CPLEX cuts

    Posted 05/12/11 10:30 AM

    Originally posted by: rocarvaj


    Hello!

    I'm working with a MILP and I want to get the presolved problem after the root node of the B&C tree is solved with the cuts added by CPLEX. The way I've been doing this is using a (C callable library) solve callback (or a branch callback, the result is the same) and using the function CPXgetcallbacknodelp and changing the obtained problem to MILP, changing the type of the variables and adding the corresponding bounds.
    The problem is that if I try to solve this MILP, I get that the problem is integer infeasible. I know the instance is feasible (is markshare_4_0.mps from Mittelmann's instances at http://plato.asu.edu/ftp/milp/) .

    One thing I've tried is comparing the problem I just mentioned with the problem obtained from calling CPXpresolve. They are exactly the same, except for the fact that the first one has additional constraints (CPLEX cuts) and some of the variables are fixed (by bounds) to zero.

    Obviously this could be due to an error in my code, but I would like to know if this approach is the right one to get the presolved problem with cuts.

    Any thoughts on this are appreciated.
    Best regards,

    Rodolfo
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: [C callable] Problem getting presolved problem with CPLEX cuts

    Posted 05/12/11 11:52 AM

    Originally posted by: EdKlotz


    > rocarvaj wrote:
    > Hello!
    >
    > I'm working with a MILP and I want to get the presolved problem after the root node of the B&C tree is solved with the cuts added by CPLEX. The way I've been doing this is using a (C callable library) solve callback (or a branch callback, the result is the same) and using the function CPXgetcallbacknodelp and changing the obtained problem to MILP, changing the type of the variables and adding the corresponding bounds.
    The documentation indicates that the LP you get from CPXgetcallbacknodelp
    should not be altered in any way. You can query it, but not change it.
    So, if you modify the LP pointer you get from CPXgetcallbacknodelp, results
    will be unpredictable. If you want to modify the model in this LP pointer,
    first call CPXcloneprob to obtain a separate copy of the model, then
    modify that LP pointer instead.

    > The problem is that if I try to solve this MILP, I get that the problem is integer infeasible. I know the instance is feasible (is markshare_4_0.mps from Mittelmann's instances at http://plato.asu.edu/ftp/milp/) .

    Well, you can always run the conflict refiner on an infeasible model to get
    a minimal explanation of the infeasibility. But, if you didn't make a separate
    copy of the LP pointer, do that first, and hopefully you won't have to deal
    with any infeasibility issues.

    >
    > One thing I've tried is comparing the problem I just mentioned with the problem obtained from calling CPXpresolve. They are exactly the same, except for the fact that the first one has additional constraints (CPLEX cuts) and some of the variables are fixed (by bounds) to zero.
    >
    > Obviously this could be due to an error in my code, but I would like to know if this approach is the right one to get the presolved problem with cuts.
    >

    First try using cloneprob as described above. If the problem remains infeasible, use the conflict refiner to get an explanation. That will
    help shed light on the issue.
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: [C callable] Problem getting presolved problem with CPLEX cuts

    Posted 05/12/11 02:29 PM

    Originally posted by: rocarvaj


    Hi, EdKlotz. Thanks for your reply.

    I'm sorry for not being clear in the previous post. I do clone the problem before doing the modifications.

    Actually, with my colleague we have found that the problem had to do with giving CPLEX a mipstart solution. For some reason CPLEX was fixing the values of some variables which make the problem obtained with CPXgetcallbacknodelp infeasible.
    After we removed the mipstart solution, everything worked fine.

    But I still don't know why this behavior from CPLEX.

    Regards,

    Rodolfo
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: [C callable] Problem getting presolved problem with CPLEX cuts

    Posted 05/12/11 03:01 PM

    Originally posted by: SystemAdmin


    I can only guess, but here are two potential explanations:

    1. You provided the optimal solution to the problem as a MIP start. Then, CPLEX was able to add some cuts or fix/modify some variables by exploiting the resulting primal bound. As a consequence, it could be that the incumbent (i.e., the optimal solution vector) is no longer feasible for the resulting presolved model. Then, the new presolved problem would indeed be infeasible. This is completely okay, because those reductions are valid for the problem to find a solution that is feasible and better than the current incumbent.

    2. CPLEX did some non-linear presolve reductions, for example to combine two binary variables into a general integer variable. Now, if you query the nodelp and set all ctypes of the remaining variables to 'B'inary, then you have turned a general integer variable into a binary variable. Obviously, this would reduce the search space and could make a feasible model infeasible.
    Tobias
    #CPLEXOptimizers
    #DecisionOptimization