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[voxelIndex
i],1.0/nSize);}
//bound
for (int i=0; i<nSize; i++) {
constraint
2+i.setUB(0);
constraint
2+i.setLinearCoef(bound,-1);
constraint
2+i.setLinearCoef(z[voxelIndex
i],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