Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Starting Solution Ignored

    Posted 03/15/13 04:43 AM

    Originally posted by: SystemAdmin


    Hi,

    I am trying to build a small main-script that uses a solution from a heuristic as a starting solution for my model.
    I built it analogous to the warmstarting example. Unfortunately the solver seems to ignore my solution and start solving from scratch.
    This seems to happen for the example too, as the printout when running the example is:
    Default Behaviour
    x = 10 0 0 0 0 0 0 0 0 0;
    y = 1 2 3 4 5 6 7 8 9 10;

    Setting initial solution
    x = 10 0 0 0 0 0 0 0 0 0;
    y = 1 2 3 4 5 6 7 8 9 10;
    whereas in the description of the example it should be:
    Setting an initial solution
    x = 0 0 0 0 10 0 0 0 0 0;
    y = 1 2 3 4 5 6 7 8 9 10;
    Does anyone know what I am doing wrong ?

    Thanks in advance !

    Stefan
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Starting Solution Ignored

    Posted 03/19/13 08:24 AM
    Hi,

    can you attach your model? (.mod and .dat files)

    regards
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Starting Solution Ignored

    Posted 03/19/13 09:42 AM

    Originally posted by: SystemAdmin


    Hi,

    I used the example as provided:

    //
    // Licensed Materials - Property of IBM
    //
    // 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55
    // Copyright IBM Corporation 1998, 2012. All Rights Reserved.
    //
    // Note to U.S. Government Users Restricted Rights:
    // Use, duplication or disclosure restricted by GSA ADP Schedule
    // Contract with IBM Corp.
    //

    range r = 1..10;
    dvar int+ x[r];
    dvar int+ 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 : 0;
    minimize
    sum( i in r ) x[i] + sum( j in r ) y[j];
    subject to{
    ctSum:
    sum( i in r ) x[i] >= 10;
    forall( j in r )
    ctEqual:
    y[j] == j;
    }

    main{
    thisOplModel.generate();
    var def = thisOplModel.modelDefinition;
    // Default behaviour
    writeln("Default Behaviour");
    var cplex1 = new IloCplex();
    var opl1 = new IloOplModel(def, cplex1);
    opl1.generate();
    cplex1.solve();
    writeln(opl1.printSolution());
    // Setting initial solution
    writeln("Setting initial solution");
    var cplex2 = new IloCplex();
    var opl2 = new IloOplModel(def, cplex2);
    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(cplex2);
    cplex2.solve();
    writeln(opl2.printSolution());

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

    Regards,

    Stefan
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Starting Solution Ignored

    Posted 03/20/13 08:47 AM
    Hi,

    with CPLEX 12.4, I get

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


    regards
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: Starting Solution Ignored

    Posted 03/21/13 07:14 AM

    Originally posted by: SystemAdmin


    hi,

    well with 12.4 it works for me too.

    regards stefan
    #DecisionOptimization
    #OPLusingCPLEXOptimizer