Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Relaxation

    Posted Fri November 14, 2008 11:43 AM

    Originally posted by: SystemAdmin


    [shadi said:]

    hi,
    i have a cp model that find all the feasible bus duty for each trip (slave model), this model must find atleast one duty for each trip Otherwise the master model will not find a solution,
    i want to relax some variables in case that the cp model cant find atleast one feasible solution and to generate again the cp model (with the new relaxed values) until i find atleast one feasible solution.

    Kshieboun Shadi



    #DecisionOptimization
    #OPLusingCPOptimizer


  • 2.  Re: Relaxation

    Posted Fri November 14, 2008 01:36 PM

    Originally posted by: SystemAdmin


    [jfk said:]

    hello there,
    it is interesting that you want to relax variables (I suppose you are talking about their upper-lower bounds). how are the constraints? Anyway...
    1. you could start to solve a problem with large enough domains for its variables and then you could take the upper bounds (UB - or lower bounds (LB)) of the variables in that solution and start another problem where you gradually decrease these bounds (based on some logic) to be close to their original UB,LB values.
    2. or you could introduce bound variables for each variable which has the domain of [UB,LargeNumber] or [SmallNumber,LB] , e.g. if the variable is x and its domain is [12,25] then you could have LBx = [SmallNumber,12] and UBx=[25,LargeNumber] and LBx<=x<=UBx. Then you can compose some goal function from the LBx, UBx to tighten x's LB,UB as much as possible<br />3. the feasibility of no.2 depends on the number of variables you have. If they are too numerous no.2 might be not a good option.

    cheers

    p.s.
    I gave some answer (which might not be any help, btw) without any reference to OPL, so I guess, your question is less OPL specific and more on general modeling, don't you think?
    #DecisionOptimization
    #OPLusingCPOptimizer


  • 3.  Re: Relaxation

    Posted Fri November 14, 2008 01:50 PM

    Originally posted by: SystemAdmin


    [shadi said:]

    Dear Katai,
    i want to give an example in order to understand me better.
    in my cp model i have a constraint as following:

    constraints {
      drivingTime  == sum (i in tripRng)
                  ((locationSeq[i-1] != locationSeq[i])*(ArrTime[tripSeq[i]]-DepTime[tripSeq[i]]));

    drivingTime>100;
    }

    i want my model to use this value (100) in order to find at least one feasible soultion (tripSeq[]), but if it cant find so to relax the 100 and to make it 95, and after that 90...

    Kshieboun Shadi




    #DecisionOptimization
    #OPLusingCPOptimizer


  • 4.  Re: Relaxation

    Posted Fri November 14, 2008 03:39 PM

    Originally posted by: SystemAdmin


    [Didier Vidal said:]

    Shadi,

    An idea to relax a constraint is to introduce a 'penalty cost' in your objective and to minimize it.
    Here is an example, to illustrate the idea :

    // A penalty measure of a constraint 'drivingTime > 100'
    dexpr int drivingTimePenalty = maxl(0, 100-drivingTime);

    minimize <otherCosts> + drivingTimePenalty ;
    constraints {
      drivingTime  == sum (i in tripRng)
                  ((locationSeq[i-1] != locationSeq)*(ArrTime[tripSeq]-DepTime[tripSeq]));

      // let's assume that 80 is a hard limit, but ideally, the driving time should be higher than 100
      drivingTime>80;
    }



    Didier.

    #DecisionOptimization
    #OPLusingCPOptimizer


  • 5.  Re: Relaxation

    Posted Sat November 15, 2008 01:44 PM

    Originally posted by: SystemAdmin


    [shadi said:]

    Dear Didier,

    this is a good idea but using this strategy i cant receive many duties for each trip, becuase each time i just get the optimal solution (in the slave model), so in the master model i will not have many choices in order to choose the final optimal solution.

    Kshieboun Shadi


    #DecisionOptimization
    #OPLusingCPOptimizer