CPLEX 色々

探索ノード数を得る

    IloCplex cplex(model);
...
    cplex.solve();
    cout << "Nodes: " << cplex.getNnodes() << endl;

カット数を得る

    cout << "Cuts: " << cplex.getNcuts(IloCplex::CutClique) << endl;
ruby -ne 'puts "IloCplex::" + $_.split("=")[0].strip + ","'
    int num_cuts = 0;
    for (IloCplex::CutType c : {
             IloCplex::CutCover,
             IloCplex::CutGubCover,
             IloCplex::CutFlowCover,
             IloCplex::CutClique,
             IloCplex::CutFrac,
             IloCplex::CutMCF,
             IloCplex::CutMir,
             IloCplex::CutFlowPath,
             IloCplex::CutDisj,
             IloCplex::CutImplBd,
             IloCplex::CutZeroHalf,
             IloCplex::CutLocalCover,
             IloCplex::CutTighten,
             IloCplex::CutObjDisj,
             IloCplex::CutLiftProj,
             IloCplex::CutUser,
             IloCplex::CutTable,
             IloCplex::CutSolnPool}) {
      num_cuts += cplex.getNcuts(c);
    }
    cout << "Cuts: " << num_cuts << endl;

厳密解を求めさせる

    cplex.setParam(IloCplex::Param::MIP::Tolerances::MIPGap, 0.0);

並列を封じる

    cplex.setParam(IloCplex::Param::Threads, 1);