Originally posted by: JorisK
I have an optimization problem for which it is easy to find a feasible solution (but hard to find an optimal one). As such I provide an initial feasible solution as a warm start to the solver. Problem: when I use a LazyCutCallback, my warmstart is completely ignored. Is there a way to fix this (cplex 12.6.3, C++)?
Without a LazyCutCallback:
1 of 1 MIP starts provided solutions.
MIP start 'm1' defined initial solution with objective 40609.0000.
With a LazyCutCallback:
Lazy constraint(s) or lazy constraint callback is present.
Disabling dual reductions (CPX_PARAM_REDUCE) in presolve.
Disabling non-linear reductions (CPX_PARAM_PRELINEAR) in presolve.
Tried aggregator 2 times.
MIP Presolve eliminated 2 rows and 0 columns.
Aggregator did 78 substitutions.
Reduced MIP has 3042 rows, 57837 columns, and 118638 nonzeros.
Reduced MIP has 1521 binaries, 0 generals, 0 SOSs, and 0 indicators.
Presolve time = 0.05 sec. (50.47 ticks)
Tried aggregator 1 time.
Reduced MIP has 3042 rows, 57837 columns, and 118638 nonzeros.
Reduced MIP has 1521 binaries, 0 generals, 0 SOSs, and 0 indicators.
Presolve time = 0.03 sec. (31.37 ticks)
Probing time = 0.04 sec. (33.60 ticks)
Clique table members: 78.
MIP emphasis: balance optimality and feasibility.
MIP search method: traditional branch-and-cut.
Parallel mode: none, using 1 thread.
Root relaxation solution time = 1.05 sec. (2034.50 ticks)
Delayed MIP starts found nothing.
Code for MIP start:
IloNumVarArray startVar(env);
IloNumArray startVal(env);
for(int i=1; i<tdTSP->nrVertices; i++){
startVar.add(xVars[i-1][i-1]);
startVal.add(1);
}
cplex.addMIPStart(startVar, startVal,IloCplex::MIPStartEffort::MIPStartRepair);
startVal.end();
startVar.end();
To ensure that my LazyCutCallback is implemented correctly, i.e. that it doesn't cut off my initial solution, I added xVars[i-1][i-1].setLB(1); to the previous for loop, thereby fixing the initial solution. In this case, the solver instantly returns this solution as the optimal solution.
Currently, if I don't use a LazyCutCallBack, cplex uses my initial solution and is able to improve upon this solution. If I however add the LazyCutCallback, then cplex doesn't use my initial solution. When the time limit is reached, cplex reports that it couldn't find any solution! This is obviously undesirable. Any suggestions on how to fix this?
#CPLEXOptimizers#DecisionOptimization