Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Question regaring readMIPStarts

    Posted Mon March 21, 2011 01:07 PM

    Originally posted by: CPLEX12USER


    Hi

    I have been solving MIP using CPLEX11.1. I am using readMIPStart to read the MST file ( generated by previous iteration of optimization) and use the MIP start information for subsequent MIP optimization runs (AdvInd is turned on) . Currently I have linked the same code to CPLEX12.1 libraries. I see a huge differnce in optimization output. The difference was significantly reduced when i stopped reading the MIP start information and tried fresh solution. Initially I suspected if it could be because of usage of deprecated methods 'readMIPStart and writeMIPStart'. However, the problem surfaced even after changing it to upgraded methods 'readMIPStarts and writeMIPStarts'. Could you please help what the issue could be.

    Need to know why I see huge difference when I try using CPLEX12.1 and reading MIP initial solutions.

    I am using concert to solve the MIP.
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Question regaring readMIPStarts

    Posted Mon March 21, 2011 02:28 PM

    Originally posted by: SystemAdmin


    Now you have to explain a bit more what you mean with "huge difference in optimization output". Is the final objective value different? Or is the final solution vector different? Or is the running time for solving the model to optimality different?
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Question regaring readMIPStarts

    Posted Wed March 23, 2011 11:50 AM

    Originally posted by: CPLEX12USER


    Hi

    Here is the below sample code which can be used to recreate the issue. The problem was with objective value. When CPLEX11.1 gave optimal solutions, CPLEX12.1 gave only feasible solutions. On troubleshooting the problem, it appears to be like the problem lies in "IloCplex::IntSolLim" which is set to 1 here. when I increase this to 2, CPLEX12.1 gives optimal solution with objective same as CPLEX11.1. Appreciate your comments on same.

    I am looking for results similar to CPLEX11.1 without changing the code.

    I have attached the model and mst file used.

    #include <ilcplex/ilocplex.h>
    #include <iostream>
    using namespace std;

    static void usage (const char *progname);

    int main(int argc, char *argv[])
    {
    IloEnv env;
    try
    {
    IloModel model (env);
    IloCplex cplex (env);

    if ( argc != 2 ) {
    usage (argv[0]);
    throw(-1);
    }

    IloNumVarArray var(env);
    IloRangeArray rng(env);
    IloObjective obj;

    cplex.importModel (model, argv[1] ,obj,var,rng);
    cplex.extract(model);

    double gap = 0.05;

    cplex.readMIPStart("cplexmstfile.mst");

    cplex.setParam(IloCplex::TiLim,3000);
    cplex.setParam(IloCplex::EpGap ,gap);
    cplex.setParam(IloCplex::IntSolLim, 1);

    IloBool status = cplex.solve();
    cout << endl <<"Objective value is :" << cplex.getObjValue() << endl;
    if(status && cplex.solve())
    {
    switch (cplex.getStatus())
    {
    case IloAlgorithm::Feasible:
    cout << "feasible solution found..." << endl;
    break;
    case IloAlgorithm::Optimal:
    cout << "optimal solution found..." << endl;
    break;
    }

    cout << endl <<"Objective value second run is :" << cplex.getObjValue() << endl;
    cplex.writeMIPStart( "cplexmstfilesol.mst");
    }
    }
    catch (IloException& e) {
    cerr << "Concert exception caught: " << e << endl;
    }
    catch (...) {
    cerr << "Unknown exception caught" << endl;
    }

    // -- free memories
    env.end();
    }

    static void usage (const char *progname)
    {
    cerr << "Usage: " << progname << " filename" << endl;
    cerr << " where filename is a file with extension " << endl;
    cerr << " LP (lower case is allowed)" << endl;
    cerr << " Exiting..." << endl;

    }

    >D:\Linear-Program\Debug\Linear-Program.exe D:\Linear-Program\CPLEX12.lp
    Warning: more than one CPLEXSolution element in file, only first one proc
    essed.
    1 of 1 MIP starts provided solutions.
    MIP start 'incumbent' defined initial solution with objective 1.7351e+007
    .

    Objective value is :1.73507e+007
    Warning: No solution found from 1 MIP starts.
    Retaining values of one MIP start for possible repair.
    feasible solution found...

    Objective value second run is :1.73507e+007

    >D:\Linear-Program\Debug\Linear-Program.exe D:\Linear-Program\CPLEX12.lp
    Warning: more than one CPLEXSolution element in file, only first one read
    .
    MIP start values provide initial solution with objective 1.7351e+007.
    Tried aggregator 2 times.
    MIP Presolve eliminated 193 rows and 344 columns.
    MIP Presolve modified 651 coefficients.
    Aggregator did 2476 substitutions.
    Reduced MIP has 2305 rows, 4631 columns, and 7918 nonzeros.
    Presolve time = 0.06 sec.
    Clique table members: 828.
    MIP emphasis: balance optimality and feasibility.
    MIP search method: dynamic search.
    Parallel mode: none, using 1 thread.
    Root relaxation solution time = 0.04 sec.

    Nodes Cuts/
    Node Left Objective IInf Best Integer Best Node ItCnt
    Gap

    0 0 1.26979e+007 144 1.73507e+007 1.26979e+007 703
    26.82%

    Objective value is :1.73507e+007
    MIP emphasis: balance optimality and feasibility.
    MIP search method: dynamic search.
    Parallel mode: none, using 1 thread.

    Nodes Cuts/
    Node Left Objective IInf Best Integer Best Node ItCnt
    Gap

    0 0 1.27018e+007 25 1.73507e+007 Cuts: 251 790
    26.79%
    0 0 1.27018e+007 25 1.73507e+007 1.27018e+007 791
    26.79%

    Repeating presolve.
    Tried aggregator 2 times.
    MIP Presolve eliminated 1357 rows and 2534 columns.
    MIP Presolve modified 560 coefficients.
    Aggregator did 30 substitutions.
    Reduced MIP has 918 rows, 2067 columns, and 3564 nonzeros.
    Tried aggregator 1 time.
    MIP Presolve eliminated 42 rows and 0 columns.
    MIP Presolve modified 119 coefficients.
    Reduced MIP has 876 rows, 2067 columns, and 3480 nonzeros.
    Represolve time = 0.07 sec.
    MIP emphasis: balance optimality and feasibility.
    MIP search method: dynamic search.
    Parallel mode: none, using 1 thread.
    Root relaxation solution time = 0.03 sec.

    Nodes Cuts/
    Node Left Objective IInf Best Integer Best Node ItCnt
    Gap

    0 0 1.27018e+007 19 1.73507e+007 1.27018e+007 1094
    26.79%
    0 2 1.27018e+007 19 1.73507e+007 1.27018e+007 1094
    26.79%
    • 13 0 integral 0 1.27018e+007 1.27018e+007 1112
    0.00%

    Implied bound cuts applied: 40
    Mixed integer rounding cuts applied: 61
    Gomory fractional cuts applied: 38
    optimal solution found...

    Objective value second run is :1.27018e+007
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Question regaring readMIPStarts

    Posted Wed March 23, 2011 11:51 AM

    Originally posted by: CPLEX12USER


    attaching the mst file.
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Question regaring readMIPStarts

    Posted Wed March 23, 2011 11:53 AM

    Originally posted by: CPLEX12USER


    Apologise.. Attaching the right mst file. Please discard my earlier one.
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Question regaring readMIPStarts

    Posted Wed March 30, 2011 10:32 AM

    Originally posted by: SystemAdmin


    Are you sure you posted the correct MST file? The file cplexmstfile.mst contains only solution. On the other hand, the output you show warns about multiple solutions in one file.
    Moreover, I see that you still use readMIPStart() instead of readMIPStarts(). I think using readMIPStarts() would handle multiple solutions in one file properly.

    When I run your program with cplexmstfile.mst here then I end up with the optimal solution.
    Is this expected behavior or not?
    More precisely, what are you expecting to happen? Can your problem be solved by only writing the best MIP start (i.e. the optimal solution) to the MST file?
    #CPLEXOptimizers
    #DecisionOptimization