Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Change CPLEX parameters after a certain time limit has reached

    Posted 10/17/21 06:30 PM
    Hi,

    I would like to change certain parameters during the B&B process in Java API and was wondering what could be the most efficient way to do so. 

    Suppose I start my solution process by setting RINS parameter as 250 cplex.setParam(IloCplex.Param.MIP.Strategy.RINSHeur, 250)

    Then, I intend to update this parameter, say after 5 minutes later. My question might be more related to coding rather than CPLEX, but I thought that someone might have already done this in the CPLEX community. 

    I would appreciate any help.

    ------------------------------
    S Y
    ------------------------------

    #DecisionOptimization


  • 2.  RE: Change CPLEX parameters after a certain time limit has reached

    Posted 10/18/21 03:19 AM
    Hi,

    what you could do is set a time limit , solve and then solve again with the new value

    See in OPL what you also could do in java

    int nbKids=300;
    float costBus40=500;
    float costBus30=400;
     
    dvar int+ nbBus40;
    dvar int+ nbBus30;
     
    minimize
     costBus40*nbBus40  +nbBus30*costBus30;
     
    subject to
    {
     40*nbBus40+nbBus30*30>=nbKids;
    } 
    
    
    main
    {
      thisOplModel.generate();
      cplex.rinsheur=250;
      cplex.tilim=5*60;
      cplex.solve();
      cplex.rinsheur=100; // new value;
    }​


    ------------------------------
    [Alex] [Fleischer]
    [EMEA CPLEX Optimization Technical Sales]
    [IBM]
    ------------------------------



  • 3.  RE: Change CPLEX parameters after a certain time limit has reached

    Posted 10/18/21 09:09 AM
    Edited by System Admin 01/20/23 04:46 PM
    When I call cplex.solve() again, doesn't the B&B process start all over again? or Does it continue where it is left?

    As far as I know, when I add a new constraint to an existing model, it restarts the solution process. So wouldn't changing the CPLEX parameters in this way restart everything? 

    ------------------------------
    S Y
    ------------------------------



  • 4.  RE: Change CPLEX parameters after a certain time limit has reached

    Posted 10/18/21 09:16 AM
    Hi,

    it will go on from previous solution.

    See https://github.com/AlexFleischerParis/zooopl/blob/master/zoogetsolutiononebyone.mod

    regards

    ------------------------------
    [Alex] [Fleischer]
    [EMEA CPLEX Optimization Technical Sales]
    [IBM]
    ------------------------------



  • 5.  RE: Change CPLEX parameters after a certain time limit has reached

    Posted 10/18/21 09:21 AM
    Hi,

    Thanks for letting me know.

    Just to be on the same page, adding a new constraint restarts everything, doesn't it? I am not referring to any callback function. If I add a hard constraint into my model, that destroys the current tree and creates a new one from the scratch, right?

    ------------------------------
    S Y
    ------------------------------