Questions in GAMS

H

hi everyone, I hope you are doing well… can you help to answer these questions urgently please.. thanks in advance

@toto Chances to get help will increase when you put some effort in solving the tasks yourself. When you have done that and you still face challenges, I recommend to share your code here and describe precisely where you need help.

Hope you enjoy the challenge. Good Luck!

Part (a) – Algebraic Model & Solution

We have a two-stage transportation problem with fixed costsfor plants and warehouses (facility location problem).

Sets:

- \( P \) = Plants: \( \{1,2,3,4,5,6\} \)

- \( W \) = Warehouses: \( \{1,2,3,4\} \)

- \( C \) = Customers: \( \{1,2,3,4,5\} \)

Parameters:

- \( \text{pc}_{pw} \) = production & shipping cost from plant \( p \) to warehouse \( w \)

- \( \text{wc}_{wc} \) = shipping cost from warehouse \( w \) to customer \( c \)

- \( \text{demand}_c \) = demand of customer \( c \)

- \( \text{capPlant}_p \) = capacity of plant \( p \)

- \( \text{capWarehouse}_w \) = capacity of warehouse \( w \)

- \( \text{fixedPlant}_p \) = fixed cost of operating plant \( p \)

- \( \text{fixedWarehouse}_w \) = fixed cost of operating warehouse \( w \)

Variables:

- \( x_{pw} \ge 0 \) = units shipped plant \( p \) → warehouse \( w \)

- \( y_{wc} \ge 0 \) = units shipped warehouse \( w \) → customer \( c \)

- \( u_p \in \{0,1\} \) = 1 if plant \( p \) is open

- \( v_w \in \{0,1\} \) = 1 if warehouse \( w \) is open

Objective:

\[

\min \sum_{p,w} \text{pc}_{pw} x_{pw} + \sum_{w,c} \text{wc}_{wc} y_{wc} + \sum_p \text{fixedPlant}_p u_p + \sum_w \text{fixedWarehouse}_w v_w

\]

Constraints:

1. Plant capacity:

\[

\sum_w x_{pw} \le \text{capPlant}_p \cdot u_p \quad \forall p

\]

2. Warehouse capacity:

\[

\sum_c y_{wc} \le \text{capWarehouse}_w \cdot v_w \quad \forall w

\]

3. Warehouse balance:

\[

\sum_p x_{pw} = \sum_c y_{wc} \quad \forall w

\]

4. Demand satisfaction:

\[

\sum_w y_{wc} = \text{demand}_c \quad \forall c

\]

5. Non-negativity and binary for \( u_p, v_w \).

Total demand = ( 200+300+200+150+250 = 1100 ).

From cost inspection:

- Plant 5 has low costs to warehouses 1,2,3; high capacity (350).

- Plant 4 has low cost to W3, W1.

- Plant 2 low cost to W2, W3.

- Warehouse 4 has high fixed cost, but cheap to customers 2,4.

Warehouse 3 has low fixed cost.

A likely open set: Plants 2,4,5; Warehouses 2,3,4 maybe

Part (b) – Multi-product Multi-mode Model

We now have:

Sets:

- Products \( K = \{1,2,3\} \)

- Vehicle types \( V = \{1,2\} \) (e.g., Truck, Rail)

- Plants \( P \), Warehouses \( W \), Customers \( C \)

New parameters:

- \( \text{volume}_k \) = volume per unit of product \( k \)

- \( \text{capVehicle}_v \) = capacity of vehicle type \( v \)

- \( \text{vehicleCost1}_{pwv} \) = cost plant \( p \) → warehouse \( w \) using vehicle \( v \)

- \( \text{vehicleCost2}_{wcv} \) = cost warehouse \( w \) → customer \( c \) using vehicle \( v \)

- \( \text{demand}_{ck} \) = demand of product \( k \) by customer \( c \)

- \( \text{prodCap}_{pk} \) = capacity of plant \( p \) for product \( k \)

- \( \text{storeCap}_{wk} \) = storage capacity of warehouse \( w \) for product \( k \)

Variables:

- \( x_{pwvk} \) = units of product \( k \) shipped \( p \to w \) via vehicle \( v \)

- \( y_{wcvk} \) = units of product \( k \) shipped \( w \to c \) via vehicle \( v \)

- \( u_p, v_w \) binary as before.

Objective:

\[

\min \sum_{p,w,v,k} \text{vehicleCost1}_{pwvk} x_{pwvk} + \sum_{w,c,v,k} \text{vehicleCost2}_{wcvk} y_{wcvk} + \sum_p \text{fixedPlant}_p u_p + \sum_w \text{fixedWarehouse}_w v_w

\]

Constraints:

- Plant capacity per product:

\[

\sum_{w,v} x_{pwvk} \le \text{prodCap}_{pk} \cdot u_p

\]

- Warehouse storage capacity per product:

\[

\sum_{c,v} y_{wcvk} \le \text{storeCap}_{wk} \cdot v_w

\]

- Warehouse flow balance per product:

\[

\sum_{p,v} x_{pwvk} = \sum_{c,v} y_{wcvk} \quad \forall w,k

\]

- Demand:

\[

\sum_{w,v} y_{wcvk} = \text{demand}_{ck} \quad \forall c,k

\]

- Vehicle capacity (per shipment or per total volume) — if per trip, we’d need trip integer variables; here possibly total volume constraint:

\[

\sum_k \text{volume}_k \cdot x_{pwvk} \le \text{capVehicle}_v \cdot z_{pwv}

\]

where \( z_{pwv} \) = number of vehicles used \( p\to w \) type \( v \).

Optimal network diagramwould show flows \( x_{pwvk} \) and \( y_{wcvk} \) aggregated over products/vehicles.

Part (c) – Bi-objective Model

We add environmental impact from opening facilities.

From tables:

- Plant environmental impact \( \text{envPlant}_p \) = given (5,9,7,6,8,9)

- Warehouse environmental impact \( \text{envWarehouse}_w \) = given (8,7,9,5)

Second objective:

\[

\text{Minimize EnvImpact} = \sum_p \text{envPlant}_p \cdot u_p + \sum_w \text{envWarehouse}_w \cdot v_w

\]

objective approach:

Epsilon-constraint method:

Keep cost objective, add constraint:

\[

\sum_p \text{envPlant}_p u_p + \sum_w \text{envWarehouse}_w v_w \le \epsilon

\]

Vary \( \epsilon \) from min possible env impact to max, to get Pareto front.

Min env impact = open plants/warehouses with smallest env scores:

Plant 1 (5), Plant 4 (6) — but check capacity: total cap = 300+250=550, not enough for 1100 demand. So must include others.

Warehouses: W4 (5), W2 (7) maybe.

Pareto front will show trade-off: lower env impact may raise cost

@toto did you try to implement a model in GAMS? I doubt that anybody is willing to translate your markdown code for you.

I tried to apply it in the program, but my knowledge of using the software is limited. I watched YouTube tutorials, and I understand the software, but the application is difficult for me. The results are unclear, so I couldn’t solve it correctly, even though I urgently need the solution.

I implement it on the software، but it doesn’t run accurately.. can i sent the word doc. ?