Decision Optimization

 View Only
Expand all | Collapse all

How to represent constraints in two-stage stochastic model where I have different sets for different scenarios

  • 1.  How to represent constraints in two-stage stochastic model where I have different sets for different scenarios

    Posted Mon June 21, 2021 01:52 PM
    Edited by System Fri January 20, 2023 04:43 PM
    In the attached photos, V is a set of suppliers, Vs is a set of undisrupted suppliers in scenario s (subset of V) and Vs bar is a set of disrupted suppliers in scenario s (subset of V). Q, QB, z are 1st-stage decision variables, while QM and QB are 2nd-stage variables. The others are input data.

    I have constraints where forall loop only applies to certain suppliers (disrupted or undisrupted suppliers), not the whole set V. I tried to represent this characteristic by using a binary input parameter dr[scenario][supplier] (dr[s][i] = 1 if supplier i is disrupted in scenario s; 0 otherwise), while still using set V.
    Specifically, I multiply both sides of the constraints with (1 - dr) when only undisrupted suppliers are considered, and with dr when only disrupted suppliers are considered. For example, I'll have:

    forall(s in scenario, i in supplier){
    sum(k in product) (1 - dr[s][i]) * CAPC[i][k] * (Q[i][k] + QB[s][k][i]) <= (1 - dr[s][i]) * CAP[i];
    }
    Does the multiplication of parameter dr make sense or OPL CPLEX will automatically ignore these "dr" before solving (since they are identical in both sides of the constraint) and it will run for all element in V, which isn't what I want. If my approach is wrong, then how can I represent those constraints in OPL CPLEX? 

    I'm only a beginner so I'd appreciate it if anyone can help. I'll provide necessary files if you need them.
    Best regards.
    ------------------------------
    Giang Dang
    ------------------------------
    #DecisionOptimization


  • 2.  RE: How to represent constraints in two-stage stochastic model where I have different sets for different scenarios

    Posted Tue June 22, 2021 05:16 AM
    Hi,

    what you try to do is slicing by removing disrupted suppliers.
    Instead of using multiply in the constraint you could simply slice within the forall:
    forall(s in scenario, i in supplier:dr[s][i] = 0){
    sum(k in product)  CAPC[i][k] * (Q[i][k] + QB[s][k][i]) <=  CAP[i];
    }


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



  • 3.  RE: How to represent constraints in two-stage stochastic model where I have different sets for different scenarios

    Posted Tue June 22, 2021 10:10 PM
    Thank you very much Mr. Fleischer. I'll make some modification in my code.

    ------------------------------
    Giang Dang
    ------------------------------