Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  How to extract and save CPLEX-generated cuts?

    Posted 08/29/14 11:34 AM

    Originally posted by: maiklb2005


     
    I was wondering how to extract and save CPLEX-generated cuts such as Gomory cuts after the optimization is interrupted or complete (by default CPLEX outputs only cuts' names and their number, but not the cuts themselves).

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: How to retain cuts within Lagrangian relaxation?

    Posted 09/09/14 01:53 PM

    Originally posted by: maiklb2005


    I have found the following piece of code from iloadmipes5.cpp:

     

    
    
    ILOCUTCALLBACK3(CtCallback, IloExprArray, lhs, IloNumArray, rhs, IloNum, eps) {
    
    
      IloInt n = lhs.getSize();
    
    
      for (IloInt i = 0; i < n; ++i) {
    
    
         IloNum xrhs = rhs[i];
    
    
         if ( xrhs < IloInfinity  &&  getValue(lhs[i]) > xrhs + eps ) {
    
    
            IloRange cut;
    
    
            try {
    
    
               cut = (lhs[i] <= xrhs);
    
    
               add(cut).end();
    
    
               rhs[i] = IloInfinity;
    
    
            }
    
    
            catch (...) {
    
    
               cut.end();
    
    
               throw;
    
    
            }
    
    
         }
    
    
      }
    
    
    }
    

    I am still not sure how to use it properly to get/read cuts from previous iterations and re-use them in subsequent iterations when solving the relaxed problem within Lagrangian relaxation. 


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: How to retain cuts within Lagrangian relaxation?

    Posted 09/16/14 07:16 AM

    Originally posted by: davidoff


    This is example is related to implement your own cut generator

    The only method that I used once was through the C API customizing one of the example provided by CPLEX so that I could export the LP right after CPLEX cut generation has been triggered.

    But I completely forgot which sample I based this extension :-(

     

    David


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: How to retain cuts within Lagrangian relaxation?

    Posted 09/21/14 10:34 PM

    Originally posted by: maiklb2005


    Dear David, thank you for the reply. I found out that the LP probem that CPLEX is solving at a root node (including both original constraints and CPLEX-added cuts) can be accessed by using the function CPXgetcallbacknodelp, and that CPLEX-provided examples admipex1.c and admipex6.c use CPXgetcallbacknodelp.

     

    To see the cuts, I added the following line to the admipex6.c: 

    status = CPXwriteprob(env, tmpLp, "ProblemWithCuts.lp", NULL);

    However, the resulting .lp file contains only original constraints.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: How to retain cuts within Lagrangian relaxation?

    Posted 09/21/14 11:16 PM

    Originally posted by: maiklb2005


    I think, I got it. After adding 

    status = CPXwriteprob(env, tmpLp, "ProblemWithCuts.lp", NULL);

    to the admipex1.c, in addition to the original constraints c1, c2, etc, the resulting .lp file contains other constraints that are labeled by m1, m2, ... or v1, v2, ... or z1, z2, .... etc. I presume, those are the cuts that I am looking for. Just curious, what are these letters "m," "z," and "v" stand for?
     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: How to retain cuts within Lagrangian relaxation?

    Posted 09/22/14 10:19 AM


  • 7.  Re: How to retain cuts within Lagrangian relaxation?

    Posted 12/03/14 11:15 AM

    Originally posted by: maiklb2005


    I was also curious if there is a way to output cuts/constraints selectively in case I do not need all of them? For example, is there a way to output all the original constraints + last 100 cuts that CPLEX generated?


    #DecisionOptimization
    #OPLusingCPLEXOptimizer