Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Initial Solution

    Posted Wed April 06, 2011 03:53 PM

    Originally posted by: SystemAdmin


    Hi, I´m working with a very difficult formulation for a scheduling problem and I need to insert a initial solution for improve my results, I already read and implement the example of the OPL with de vectors in the main script and It was great , but what I actually discover and where resides my question, is that when a decision variable is set as float or float+, the OPL doesn´t take the initial solution and starts whit no initial solution, my question is: The problem is only of OPL or is a problem of CPLEX, and there is a way to resolve these problem?
    Regards
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Initial Solution

    Posted Wed April 20, 2011 04:35 PM

    Originally posted by: SystemAdmin


    In the warm star example, why if I make these modifications to the decisions variables the program don´t take the initial solution:

    range r = 1..10;
    dvar float+ x[r];
    dvar float+ y[r];
    // The following array of values (defined as data) will be used as
    // a starting solution to warm-start the CPLEX search.
    float valuesi in r = (i==5)? 10.5 : 0;
    minimize
    sum( i in r ) x[i] + sum( j in r ) y[j];
    subject to{
    ctSum:
    sum( i in r ) x[i] >= 10.5;
    forall( j in r )
    ctEqual:
    y[j] == j;
    }

    main{
    thisOplModel.generate();
    var def = thisOplModel.modelDefinition;
    // Default behaviour
    writeln("Default Behaviour");
    var opl1 = new IloOplModel(def, cplex);
    opl1.generate();
    cplex.solve();
    writeln(opl1.printSolution());
    // Setting initial solution
    writeln("Setting initial solution");
    var opl2 = new IloOplModel(def, cplex);
    opl2.generate();
    var vectors = new IloOplCplexVectors();
    // We attach the values (defined as data) as starting solution
    // for the variables x.
    vectors.attach(opl2.x,opl2.values);
    vectors.setVectors(cplex);
    cplex.solve();
    writeln(opl2.printSolution());

    opl1.end();
    opl2.end();
    0;
    }

    You can see in the results that the program don´t take the initial solution:

    Default Behaviour
    // solution (optimal) with objective 65.5
    // Quality There are no bound infeasibilities.
    // There are no reduced-cost infeasibilities.
    // Maximum Ax-b residual = 0
    // Maximum c-B'pi residual = 0
    // Maximum |x| = 10.5
    // Maximum |slack| = 0
    // Maximum |pi| = 1
    // Maximum |red-cost| = 1
    // Condition number of unscaled basis = 1.0e+000
    //

    x = [0
    0 0 0 0 0 0 0 0 10.5];
    y = 1 2 3 4 5 6 7 8 9 10;

    Setting initial solution
    // solution (optimal) with objective 65.5
    // Quality There are no bound infeasibilities.
    // There are no reduced-cost infeasibilities.
    // Maximum Ax-b residual = 0
    // Maximum c-B'pi residual = 0
    // Maximum |x| = 10.5
    // Maximum |slack| = 0
    // Maximum |pi| = 1
    // Maximum |red-cost| = 1
    // Condition number of unscaled basis = 1.0e+000
    //

    x = [0
    0 0 0 0 0 0 0 0 10.5];
    y = 1 2 3 4 5 6 7 8 9 10;
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Initial Solution

    Posted Wed March 28, 2012 02:03 PM

    Originally posted by: SystemAdmin


    Changing the dvars from int+ (non-negative integers) to float+ (non-negative real numbers) changes the problem. You can see this in the results:
    x[10] = 10.5
    

    which is not an integer.

    Setting the initial solution is different from fixing the decision variables. In the second run, "values" is still used as the initial guess. The optimization algorithm then determines that x(10)=10.5 and all others =0 has a higher objective function.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Initial Solution

    Posted Wed March 28, 2012 04:09 PM

    Originally posted by: SystemAdmin


    Note that the integer+ problem gives an objective function of 65, and your float+ problem gives an objective function of 65.5.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer