Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Column generation - problem when adding and modifying constraints

    Posted 11/05/09 10:41 PM

    Originally posted by: SystemAdmin


    [chicoscience said:]

    Hello, I am working on a column generation algorithm based firstly on these steps:

    1) Solve the linear relaxation of my master model with cplex
    2) Get the dual variables and find an attractive column.
    3) Add attractive column to the model.
    4) Solve the linear relaxation of the incremented model

    In step 3, I have to add new constraints and change existing ones. I firstly create a new variable to the array:


           IloIntVar novaColuna = IloIntVar(env, 0, 1);
           model.add(novaColuna);


    Then I add a new constraint and set the linear coefficients of existing constraints for the newly created variable.

    When I go to step 4 to solve the extended model, cplex returns the error 1217 when I try to get the dual variables. Error code 1217 estates that "No solution exists", even though it returns me the Optimal Status and an optimal value.

    Anyone knows what might I be doing wrong? I have turned off presolve for the  linear relaxation. Why, after modifying the model and calling cplex.solve(), do I get the 1217 error code? When I export the model to a text file, something like that appears in the end of the file:

    Original model:

    Bounds
    0 <= id_00 <= 1<br /> 0 <= id_01 <= 1<br /> (...)
    0 <= id_13 <= 1<br />End


    Extended model


    Bounds
    0 <= id_00 <= 1<br /> 0 <= id_01 <= 1<br /> (...)
    0 <= id_13 <= 1<br /> 0 <= id_14 <= 1<br />Generals
    id_14
    End


    The exported model seem perfectly fine for me.

    Thank you very much for any help,
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Column generation - problem when adding and modifying constraints

    Posted 11/06/09 08:53 AM

    Originally posted by: SystemAdmin


    [DanielJunglas said:]

    It looks like your updated model is infeasible.
    What is the return value of cplex.solve() when you solve the updated model?
    What if you export the updated model and solve it separately (in the interactive for example)?
    Is it declared infeasible?

    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Column generation - problem when adding and modifying constraints

    Posted 11/06/09 09:31 PM

    Originally posted by: SystemAdmin


    [chicoscience said:]

    Hello Daniel, thank you for your answer.

    The cplex.solve() method returns TRUE.

    If I import the extended model to cplex, the output is this one:


    Tried aggregator 1 time.
    LP Presolve eliminated 38 rows and 1 columns.
    Reduced LP has 694 rows, 629 columns, and 12580 nonzeros.
    Presolve time =    0.02 sec.
    Initializing dual steep norms . . .

    Iteration log . . .
    Iteration:     1   Dual objective     =             0.000000
    Perturbation started.
    Iteration:    52   Dual objective     =             0.000000
    Iteration:   114   Dual objective     =             0.000001
    Iteration:   178   Dual objective     =             0.000002
    Iteration:   246   Dual objective     =             0.000003
    Iteration:   322   Dual objective     =             0.000009
    Iteration:   402   Dual objective     =             3.865699
    Iteration:   464   Dual objective     =             4.636635
    Iteration:   526   Dual objective     =             6.825656
    Iteration:   590   Dual objective     =             7.172383
    Iteration:   652   Dual objective     =             8.882960
    Iteration:   714   Dual objective     =            10.249329
    Iteration:   776   Dual objective     =            13.320844
    Iteration:   838   Dual objective     =            21.465574
    Iteration:   900   Dual objective     =            42.040640
    Iteration:   969   Dual objective     =           141.000191
    Removing perturbation.

    Dual simplex - Optimal:  Objective =    1.4100000000e+02
    Solution time =    0.16 sec.  Iterations = 1015 (0)


    However, if I solve my extended model after adding a new variable, a new constraint and setting linear coefficients, I get this output:


    Tried aggregator 1 time.
    MIP Presolve eliminated 39 rows and 1 columns.
    MIP Presolve modified 312 coefficients.
    Reduced MIP has 693 rows, 629 columns, and 12163 nonzeros.
    Presolve time =    0.00 sec.
    MIP emphasis: balance optimality and feasibility
    Root relaxation solution time =    0.15 sec.


    It returns the same objective value to me, however I do not have access to dual variables since exception 1217 is throwed when trying to read them.

    It is very odd, I must be doing something wrong. In summary, the first time I solve the model, I can get the dual variables. The second time, I get optimal status, I get the right objective value, but the output is different and I can't get the duals. I am even declaring a new IloCplex object in concert to solve the model. The first output was run in cplex environment, the second output with concert technology.
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Column generation - problem when adding and modifying constraints

    Posted 11/06/09 11:29 PM

    Originally posted by: SystemAdmin


    [chicoscience said:]

    Just one curiosity:

    If I simply add a new variable:

    IloIntVar novaColuna = IloIntVar(env, 0, 1, buffer);
    model.add(novaColuna);

    and resolve the model calling cplex.solve(), this problem happens. I don't need to setLinearCoefs for it to happen, just need to add a variable.
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Column generation - problem when adding and modifying constraints

    Posted 11/07/09 12:41 AM

    Originally posted by: SystemAdmin


    [MaryFenelon said:]

    Addition of even a single IloInt changes the problem from a continuous linear programming problem, where duals are defined, to a mixed integer programming problem, where they are not.  It is possible to get duals for a related continuous problem, that where the integer variables have been fixed to the values in an integer solution, by calling the solveFixed() method.  Look in the CPLEX User Manual section "Using the MIP solution."
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Column generation - problem when adding and modifying constraints

    Posted 11/07/09 05:35 PM

    Originally posted by: SystemAdmin


    [chicoscience said:]

    I can't believe I was that stupid. I can't believe I wasn't noticing that I was adding an integer variable and not a continuous variable. Dear Mary Fenelon, thank you very much for pointing that out to me, that was such a ridiculous mistake from my part! I corrected it and now it is working fine.
    #CPLEXOptimizers
    #DecisionOptimization