Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

Warm starting the solver for an LP column generation algorithm in c++

  • 1.  Warm starting the solver for an LP column generation algorithm in c++

    Posted Mon August 29, 2011 11:01 AM

    Originally posted by: Troy_Long


    I'm solving a rather larger model (~300K variables) and had a question concerning warm starting the model (since column generation is iterative).

    The model is in the form (z, x(multiple) variable vectors):

    min f(z)
    s.t. z=\sum_{x\in B} D(x)
    x,z>=0

    The columns are added as to the first equality constraint for z (new columns are added to B). Each iteration, I add one column to B then resolve the model. I'm using primal simplex for the RootAlg, since adding a column here only violates dual feasibility.

    I have two concerns. 1) How do I know that CPLEX is using previous solve information? If it isn't, what do I need to do so that it begins using the previous basis (I tried using writeBasis and readBasis, but I think that the addition of variables between iterations may be messing that up).

    2) (somewhat unrelated) When I'm generating some of the constraints to create f(z), the constraint generation time is extremely long (see below).

    The constraints that take forever (minutes) to generate are created to show the following (where z is a vector): z-eud = a*mean(z) + (1-a)*max(z). To do this, I use the following code, which creates the equality constraint in position 0, the mean in position 1, and the max in the remaining positions:
    IloRangeArray generateEUD(IloNumVarArray z){
    int size = 2+nSize;
    IloRangeArray constraint(env,size,-IloInfinity,IloInfinity);
    //equality
    constraint[0].setLB(0);
    constraint[0].setUB(0);
    constraint[0].setLinearCoef(mean,gamma);
    constraint[0].setLinearCoef(bound,(1-gamma));
    constraint[0].setLinearCoef(EUD,-1);
    //mean
    constraint[1].setLB(0);
    constraint[1].setUB(0);
    constraint[1].setLinearCoef(mean,-1);
    for(int i=0;i<nSize;i++){constraint[1].setLinearCoef(z[voxelIndexi],1.0/nSize);}
    //bound
    for (int i=0; i<nSize; i++) {
    constraint2+i.setUB(0);
    constraint2+i.setLinearCoef(bound,-1);
    constraint2+i.setLinearCoef(z[voxelIndexi],1);
    }
    return constraint;
    }

    Is there a way to make this much more efficient? Should I be setting the bounds initially for the max and then changed then for the first two positions?

    Cheers,
    Troy
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Warm starting the solver for an LP column generation algorithm in c++

    Posted Mon August 29, 2011 02:43 PM

    Originally posted by: SystemAdmin


    Regarding your first question: CPLEX will use advanced starting information by default. So, just adding a column and then calling the primal simplex will exactly do what you want. You can disable this behavior by setting the "advanced start indicator" parameter to 0. Maybe you should just try this to check that then the simplex logs really look differently.

    Regarding your second question: there are a number of threads in this forum that discuss the slow model modification of Concert in some situations and how to fix this. I do not know exactly right now what to do or where to find it, so you need to search yourself or hope that somebody else is able to give you a pointer.
    Tobias
    #CPLEXOptimizers
    #DecisionOptimization