Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Upper Bound

    Posted Thu January 04, 2018 02:23 PM

    Originally posted by: Guerlain


    Hello

    I want to find the upper bound of my objective function for a VRP problem, had Cplex command to bring the upper bound ?


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Upper Bound

    Posted Thu January 04, 2018 02:42 PM

    HI

    see

    getBestObjValue
    {float} getBestObjValue()
    Accesses the currently best known bound on the optimal solution value of the problem.

    regards


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Upper Bound

    Posted Thu January 04, 2018 03:09 PM

    Originally posted by: Guerlain


    this command can be add to my model to get the best known bound ? I'm using ILOG Cplex to resolve my problem when I insert this command an error of syntax is made.


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Upper Bound

    Posted Thu January 04, 2018 04:32 PM

    Are you using OPL or a programming API (which one)?


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Upper Bound

    Posted Fri January 05, 2018 01:25 AM

    Hi,

    let me give you a small example derived from scalableWarehouse.mod

    // The scalable warehouse example has been artificially increased in size
    // so that the search is long enough for you to have time to interrupt it and look at feasible solutions.
    // The resulting size is greater than the size allowed in trial mode.
    // If you want to run this example, you need a commercial edition of CPLEX Studio to run this example.
    // If you are a student or teacher, you can also get a full version through the IBM Academic Initiative.
    int Fixed        = 50;
    int NbWarehouses = 50;
    int NbStores     = 100;

    //execute
    //{
    //cplex.bendersstrategy=3;
    //}

    //execute{
    //    cplex.bendersstrategy = 3;
    //}

    assert( NbStores > NbWarehouses );

    range Warehouses = 1..NbWarehouses;
    range Stores     = 1..NbStores;
    int Capacity[w in Warehouses] =
      NbStores div NbWarehouses +
      w % ( NbStores div NbWarehouses );
    int SupplyCost[s in Stores][w in Warehouses] =
      1 + ( ( s + 10 * w ) % 100 );
    dvar int Open[Warehouses] in 0..1;
    dvar float Supply[Stores][Warehouses] in 0..1;
    dexpr int TotalFixedCost = sum( w in Warehouses ) Fixed * Open[w];
    dexpr float TotalSupplyCost = sum( w in Warehouses, s in Stores )  SupplyCost[s][w] * Supply[s][w];
    //minimize TotalFixedCost + TotalSupplyCost;
    dvar float obj;
    minimize obj;
    subject to {
    ctObj:obj==TotalFixedCost + TotalSupplyCost;


      forall( s in Stores )
        ctStoreHasOneWarehouse:
          sum( w in Warehouses )
            Supply[s][w] == 1;
      forall( w in Warehouses )
        ctOpen:
          sum( s in Stores )
            Supply[s][w] <= Open[w] * Capacity[w];
    }


    main
    {
    thisOplModel.generate();
    cplex.intsollim=1;
    for(var i=1;i<=4;i++)
    {
        

        cplex.solve();
        writeln("sol ",i);
        writeln("getBestObjValue",cplex.getBestObjValue());
        writeln("getObjValue",cplex.getObjValue());
        
    }
    }

    gives

    sol 1
    getBestObjValue2633.333333333
    getObjValue2900
    sol 2
    getBestObjValue2633.333333333
    getObjValue2730
    sol 3
    getBestObjValue2633.333333333
    getObjValue2680
    sol 4
    getBestObjValue2643.333333333
    getObjValue2670

    regards


    #CPLEXOptimizers
    #DecisionOptimization