Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Distribution problem in theme parks

    Posted 06/15/20 02:59 AM
    Hi, I want you to ask about something. 

    5 attractions in theme parks
    25 visitors in theme parks 
    time table: 1, 2 (just 1 hours)

    I assume that x[i][t] is 'Number of visitors at time interval t on attraction I',
    and y[i][j][t] is 'Flow from attraction i to cell j at time interval t'. 

    if x[1][1] = 7, x[2][1] = 8, x[3][1] = 2, x[4][1] = 3, x[5][1] = 5, 

    I want to distribute each visitors in attractions, so that 
    x[1][2] = 5, x[2][2] = 5, x[3][5] = 5, x[4][5] = 5, x[5][5] = 5, and finally I want to know the value of y[i][j][t].

    How can I solve this problem in CPLEX? Help me please...

    .mod is...

    //Data 
    range I = 1..5; // attractions 
    range t = 1..2; //timetable .


    //Parameters

    int x[I][t] = ...; //Number of visitors at time interval t on attraction I
    int m = 5; //Average 

    //Variables  
    dvar float y[i in I][j in I]; // Flow from cell i to cell j at time interval 1 



    dexpr float Variance = sum(i in I) (x[i][2 in t] - m)^2;

    //Objective function.

    minimize Variance/m;

    //Constraints 

    subject to{

    one: //Conservation of flow 
    forall(i in I)
    x[i][2 in t] - x[i][1 in t] - sum(k in I : k != i) y[k][i] + sum(j in I : j != i) y[i][j] == 0;

    two:
    forall(i in I, j in I : j != i)
    x[i][1 in t] + y[i][j] - x[i][2 in t] == 0;



    };

    ------------------------------
    Yonghwan Kim
    ------------------------------

    #DecisionOptimization


  • 2.  RE: Distribution problem in theme parks

    Posted 06/15/20 03:40 AM
    Can you please elaborate on what your issue is? Do you get an error? Are you not sure your model describes your problem well? Do you get unexpected solutions?

    ------------------------------
    Daniel Junglas
    ------------------------------



  • 3.  RE: Distribution problem in theme parks

    Posted 06/15/20 05:42 AM
    Edited by System Admin 01/20/23 04:13 PM
    I got unexpected solutions. I want to get solutions like y[1][4][1] = 2, y[2][3][1] = 3. 


    ------------------------------
    Yonghwan Kim
    ------------------------------



  • 4.  RE: Distribution problem in theme parks

    Posted 06/16/20 03:22 AM
    I can see the following problems:
    1. You have expressions like "[1 in t]" or "[2 in t]". That should read just "[1]" and "[2]".
    2. Your flow conversation looks incorrect to me. I think you need one constraints for nodes with t=1 and one for nodes with t=2.
    3. Why do you fix the values of y[i][t] in constraint "two"? With this constraint there is basically nothing left to optimize.


    ------------------------------
    Daniel Junglas
    ------------------------------