Originally posted by: duyuquan2006
Hi Daniel,
According to the log info of CPLEX, the number of binaries is 0 (See the following log info). However, the value of "getNbinVars" is 216 (You can also see the info below). I checked my code,I just changed the IloBoolVarMatrix of the MIP model to IloNumVarMatrix objects(see my following code), and did nothing else.
Tried aggregator 2 times. MIP Presolve eliminated 673 rows and 933 columns. Aggregator did 18 substitutions. Reduced MIP has 1076 rows, 805 columns, and 3225 nonzeros. Reduced MIP has 0 binaries, 0 generals, 0 SOSs, and 0 indicators. Probing time = 0.00 sec. Tried aggregator 1 time. Presolve time = 0.05 sec. Probing time = 0.00 sec. MIP emphasis: balance optimality and feasibility. MIP search method: dynamic search. Parallel mode: deterministic, using up to 4 threads. Root relaxation solution time = 0.00 sec. Nodes Cuts/ Node Left Objective IInf Best Integer Best Bound ItCnt Gap * 0 0 integral 0 3179.0000 3179.0000 287 0.00% Elapsed real time = 0.09 sec. (tree size = 0.00 MB, solutions = 1) Root node processing (before b&c): Real time = 0.06 Parallel b&c, 4 threads: Real time = 0.00 Sync time (average) = 0.00 Wait time (average) = 0.00 ------- Total (root+branch&cut) = 0.06 sec. Number of integer variables is :0 Number of binary variables is :216 Number of SOS variables is :0 Number of SemiInt variables is :0 Number of SemiCont variables is :0
The code relaxing the 0-1 variables is :
IloNumVarMatrix SIGMA(env,N);
//IloBoolVarMatrix in the MIP model IloNumVarMatrix DELTA(env,N);
//IloBoolVarMatrix in the MIP model IloNumVarMatrix PHI(env,N2);
//IloBoolVarMatrix in the MIP model IloNumVarMatrix PSI(env,N2);
//IloBoolVarMatrix in the MIP model
for (
int i=0;i<N;i++)
{ SIGMA[i]=IloNumVarArray(env,N,0,1); DELTA[i]=IloNumVarArray(env,N,0,1);
if (i<N2)
{ PHI[i]=IloNumVarArray(env,maxElem_bigK+EXPANDTW,0,1); PSI[i]=IloNumVarArray(env,maxElem_bigK+EXPANDTW,0,1);
}
}
#CPLEXOptimizers#DecisionOptimization