Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

LP Relaxation with Ranges

  • 1.  LP Relaxation with Ranges

    Posted Tue November 04, 2014 04:49 AM

    Originally posted by: Claus Brech


    Dear everyone,

    I implemented a column generation scheme for a cutting-stock problem using CPLEX Studio 12.2.  During this process, the integer variables are converted to float decision variables using convertAllIntVars().  Everything worked fine. I upgraded to 12.6 and it does not work anymore. 

    Here is the model (rmp.mod):

    //Types of iron pipes
    int n = ...;
    range Type = 1..n;
    tuple Pattern{
    int Quantity[Type];
    }
    {Pattern} P = ...; 
    float demand[Type] = ...; 
    constraint ctDemand[Type];
    dvar int+ x[P];

    minimize sum(p in P) x[p];

    subject to{
    forall(t in Type) ctDemand[t]:
    sum(p in P) p.Quantity[t] * x[p] >= demand[t];
    }

    I created another file (main.mod) that should solve the LP relaxation:

    main {
    var masterSource = new IloOplModelSource("rmp.mod");
    var masterDef = new IloOplModelDefinition(masterSource);
    var masterCplex = new IloCplex();
    var masterData = new IloOplDataSource("rmp.dat");
    var masterOpl = new IloOplModel(masterDef, masterCplex);   
     
    masterOpl.addDataSource(masterData);
    masterOpl.generate();
    masterOpl.convertAllIntVars();
    masterCplex.solve();

    }

    Even though the code is correct from my point of view, it still solves the integer program. And here is the weird thing: By replacing the data-type of "Type" from a range to an integer-set, the code works fine!

    It seems odd to me, that LP-relaxations only work in case you do not use ranges as a datatype.

    I just want to report this bug, in case someone struggles with the same problem. I also want to highlight that the above code with ranges works when you use 12.2. 

    Best regards

    Claus Brech

     

    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: LP Relaxation with Ranges

    Posted Thu November 20, 2014 07:23 AM

    Hi,

    do not hesitate to attached .mod and .dat so that anyone can reproduce the issue.

    Regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer