gams modeling - sharifie.sharif.ir/~ali.ekhlasi/gams_ekhlassi.pdf · j = {dubai, tehran} k =...
TRANSCRIPT
Sharif University of TechnologyIndustrial Engineering
GAMS Modeling
Operation Research 2
Ali EkhlassiSpring 2020
Prof. Mohammad Modarres
Factories RetailersDistributor
Three-layer Supply Chain
2
Factories DistributorWarehouse
Three-layer Supply Chain
LG
Samsung
Apple
Tabriz
Esfahan
ShirazTehran
Dubai
Supply: 100
50
40
Demand: 60
40
70
3
Factories RetailersDistributor
Three-layer Supply Chain
LG
Samsung
Apple
Tabriz
Esfahan
ShirazTehran
Dubai
X Yمتغیرهای تصمیم
4
Factories RetailersDistributor
Three-layer Supply Chain
LG
Samsung
Apple
Tabriz
Esfahan
ShirazTehran
Dubai
𝑋𝑖𝑗 Yi j
i = {Samsung, LG, Apple}
j = {Dubai, Tehran}
5
Factories RetailersDistributor
Three-layer Supply Chain
LG
Samsung
Apple
Tabriz
Esfahan
ShirazTehran
Dubai
𝑋𝑖𝑗 Yi j
i = {Samsung, LG, Apple}
j = {Dubai, Tehran}
6
Factories RetailersDistributor
Three-layer Supply Chain
LG
Samsung
Apple
Tabriz
Esfahan
ShirazTehran
Dubai
𝑋𝑖𝑗 𝑌𝑗𝑘
i ji = {Samsung, LG, Apple}
j = {Dubai, Tehran}
k
k = {Tabriz, Esfahan, Shiraz}7
Three-layer Supply Chaini = {Samsung, LG, Apple}
j = {Dubai, Tehran}
k = {Tabriz, Esfahan, Shiraz}
Factories DistributorWarehouse
LG
Samsung
Apple
Tabriz
Esfahan
ShirazTehran
Dubai
50
40
Demand: 60
40
70
Supply: 100
8
Three-layer Supply Chaini = {Samsung, LG, Apple}
j = {Dubai, Tehran}
k = {Tabriz, Esfahan, Shiraz}
Factories DistributorWarehouse
LG
Samsung
Apple
Tabriz
Esfahan
ShirazTehran
Dubai
50
40
Demand: 60
40
70
Supply: 100
9
تابع هدف Min z
Three-layer Supply Chaini = {Samsung, LG, Apple}
j = {Dubai, Tehran}
k = {Tabriz, Esfahan, Shiraz}
Factories DistributorWarehouse
LG
Samsung
Apple
Tabriz
Esfahan
ShirazTehran
Dubai
50
40
Demand: 60
40
70
Supply: 100
تابع هدف Min z = 5 × 𝑋𝑠𝑎𝑚,𝑑𝑢𝑏𝑎𝑖 + 9 × 𝑋𝑠𝑎𝑚,𝑡𝑒ℎ𝑟𝑎𝑛 + 4 × 𝑋𝐿𝐺,𝑑𝑢𝑏𝑎𝑖 + …+ 10 × 𝑋𝑎𝑝𝑝𝑙𝑒,𝑡𝑒ℎ𝑟𝑎𝑛+ 3 × 𝑌𝑑𝑢𝑏𝑎𝑖,𝑡𝑎𝑏𝑟𝑖𝑧 + 3 × 𝑌𝑑𝑢𝑏𝑎𝑖,𝑒𝑠𝑓𝑎ℎ𝑎𝑛 + …+ 3 × 𝑌𝑡𝑒ℎ𝑟𝑎𝑛,𝑠ℎ𝑖𝑟𝑎𝑧
𝑋𝑖𝑗 𝑌𝑗𝑘
10
Three-layer Supply Chaini = {Samsung, LG, Apple}
j = {Dubai, Tehran}
k = {Tabriz, Esfahan, Shiraz}
Factories DistributorWarehouse
LG
Samsung
Apple
Tabriz
Esfahan
ShirazTehran
Dubai
50
40
Demand: 60
40
70
Supply: 100
تابع هدف Min z = 5 × 𝑋𝑠𝑎𝑚,𝑑𝑢𝑏𝑎𝑖 + 9 × 𝑋𝑠𝑎𝑚,𝑡𝑒ℎ𝑟𝑎𝑛 + 4 × 𝑋𝐿𝐺,𝑑𝑢𝑏𝑎𝑖 + …+ 10 × 𝑋𝑎𝑝𝑝𝑙𝑒,𝑡𝑒ℎ𝑟𝑎𝑛+ 3 × 𝑌𝑑𝑢𝑏𝑎𝑖,𝑡𝑎𝑏𝑟𝑖𝑧 + 3 × 𝑌𝑑𝑢𝑏𝑎𝑖,𝑒𝑠𝑓𝑎ℎ𝑎𝑛 + …+ 3 × 𝑌𝑡𝑒ℎ𝑟𝑎𝑛,𝑠ℎ𝑖𝑟𝑎𝑧
𝑋𝑖𝑗 𝑌𝑗𝑘
Factory2warehouse = 5 94 76 10 11
Three-layer Supply Chaini = {Samsung, LG, Apple}
j = {Dubai, Tehran}
k = {Tabriz, Esfahan, Shiraz}
Factories DistributorWarehouse
LG
Samsung
Apple
Tabriz
Esfahan
ShirazTehran
Dubai
50
40
Demand: 60
40
70
Supply: 100
تابع هدف Min z = 5 × 𝑋𝑠𝑎𝑚,𝑑𝑢𝑏𝑎𝑖 + 9 × 𝑋𝑠𝑎𝑚,𝑡𝑒ℎ𝑟𝑎𝑛 + 4 × 𝑋𝐿𝐺,𝑑𝑢𝑏𝑎𝑖 + …+ 10 × 𝑋𝑎𝑝𝑝𝑙𝑒,𝑡𝑒ℎ𝑟𝑎𝑛+ 3 × 𝑌𝑑𝑢𝑏𝑎𝑖,𝑡𝑎𝑏𝑟𝑖𝑧 + 3 × 𝑌𝑑𝑢𝑏𝑎𝑖,𝑒𝑠𝑓𝑎ℎ𝑎𝑛 + …+ 3 × 𝑌𝑡𝑒ℎ𝑟𝑎𝑛,𝑠ℎ𝑖𝑟𝑎𝑧
𝑋𝑖𝑗 𝑌𝑗𝑘
i
j
12
Factory2warehouse = 5 94 76 10
Three-layer Supply Chaini = {Samsung, LG, Apple}
j = {Dubai, Tehran}
k = {Tabriz, Esfahan, Shiraz}
Factories DistributorWarehouse
LG
Samsung
Apple
Tabriz
Esfahan
ShirazTehran
Dubai
50
40
Demand: 60
40
70
Supply: 100
تابع هدف Min z = 5 × 𝑋𝑠𝑎𝑚,𝑑𝑢𝑏𝑎𝑖 + 9 × 𝑋𝑠𝑎𝑚,𝑡𝑒ℎ𝑟𝑎𝑛 + 4 × 𝑋𝐿𝐺,𝑑𝑢𝑏𝑎𝑖 + …+ 10 × 𝑋𝑎𝑝𝑝𝑙𝑒,𝑡𝑒ℎ𝑟𝑎𝑛+ 3 × 𝑌𝑑𝑢𝑏𝑎𝑖,𝑡𝑎𝑏𝑟𝑖𝑧 + 3 × 𝑌𝑑𝑢𝑏𝑎𝑖,𝑒𝑠𝑓𝑎ℎ𝑎𝑛 + …+ 3 × 𝑌𝑡𝑒ℎ𝑟𝑎𝑛,𝑠ℎ𝑖𝑟𝑎𝑧
𝑋𝑖𝑗 𝑌𝑗𝑘
F2W = 5 94 76 10
i
j
W2D = 3 4 72 5 3
j
k
13
Three-layer Supply Chaini = {Samsung, LG, Apple}
j = {Dubai, Tehran}
k = {Tabriz, Esfahan, Shiraz}
Factories DistributorWarehouse
LG
Samsung
Apple
Tabriz
Esfahan
ShirazTehran
Dubai
50
40
Demand: 60
40
70
Supply: 100
تابع هدف Min z = σ𝑖σ𝑗 𝐹2𝑊𝑖𝑗 × 𝑋𝑖𝑗 +
𝑋𝑖𝑗 𝑌𝑗𝑘
F2W = 5 94 76 10
i W2D = 3 4 72 5 3
j
k
14
Three-layer Supply Chaini = {Samsung, LG, Apple}
j = {Dubai, Tehran}
k = {Tabriz, Esfahan, Shiraz}
Factories DistributorWarehouse
LG
Samsung
Apple
Tabriz
Esfahan
ShirazTehran
Dubai
50
40
Demand: 60
40
70
Supply: 100
تابع هدف Min z = σ𝑖σ𝑗 𝐹2𝑊𝑖𝑗 × 𝑋𝑖𝑗 + σ𝑗σ𝑘𝑊2𝐷𝑗𝑘 × 𝑌𝑗𝑘
𝑋𝑖𝑗 𝑌𝑗𝑘
F2W = 5 94 76 10
i W2D = 3 4 72 5 3
j
k
15
Three-layer Supply Chaini = {Samsung, LG, Apple}
j = {Dubai, Tehran}
k = {Tabriz, Esfahan, Shiraz}
Factories DistributorWarehouse
LG
Samsung
Apple
Tabriz
Esfahan
ShirazTehran
Dubai
50
40
Demand: 60
40
70
Supply: 100
𝑋𝑖𝑗 𝑌𝑗𝑘
F2W = 5 94 76 10
W2D = 3 4 72 5 3
محدودیت ها
16
Three-layer Supply Chaini = {Samsung, LG, Apple}
j = {Dubai, Tehran}
k = {Tabriz, Esfahan, Shiraz}
Factories DistributorsWarehouses
LG
Samsung
Apple
Tabriz
Esfahan
ShirazTehran
Dubai
50
40
Demand: 60
40
70
Supply: 100
𝑋𝑖𝑗 𝑌𝑗𝑘
Factories
Warehouses
Distributors
F2W = 5 94 76 10
W2D = 3 4 72 5 3
محدودیت ها
17
Three-layer Supply Chaini = {Samsung, LG, Apple}
j = {Dubai, Tehran}
k = {Tabriz, Esfahan, Shiraz}
Factories DistributorsWarehouses
LG
Samsung
Apple
Tabriz
Esfahan
ShirazTehran
Dubai
50
40
Demand: 60
40
70
Supply: 100
𝑋𝑖𝑗 𝑌𝑗𝑘
Factories
Warehouses
Distributors
𝑋𝑠𝑎𝑚,𝑑𝑢𝑏𝑎𝑖 + 𝑋𝑠𝑎𝑚,𝑡𝑒ℎ𝑟𝑎𝑛 ≤ 100
𝑋𝐿𝐺,𝑑𝑢𝑏𝑎𝑖 + 𝑋𝐿𝐺,𝑡𝑒ℎ𝑟𝑎𝑛 ≤ 50
𝑋𝑎𝑝𝑝𝑙𝑒,𝑑𝑢𝑏𝑎𝑖 + 𝑋𝑎𝑝𝑝𝑙𝑒,𝑡𝑒ℎ𝑟𝑎𝑛 ≤ 40
F2W = 5 94 76 10
W2D = 3 4 72 5 3
محدودیت ها
18
Three-layer Supply Chaini = {Samsung, LG, Apple}
j = {Dubai, Tehran}
k = {Tabriz, Esfahan, Shiraz}
Factories DistributorsWarehouses
LG
Samsung
Apple
Tabriz
Esfahan
ShirazTehran
Dubai
50
40
Demand: 60
40
70
Supply: 100
𝑋𝑖𝑗 𝑌𝑗𝑘
Factories
Warehouses
Distributors
𝑋𝑠𝑎𝑚,𝑑𝑢𝑏𝑎𝑖 + 𝑋𝑠𝑎𝑚,𝑡𝑒ℎ𝑟𝑎𝑛 ≤ 100
𝑋𝐿𝐺,𝑑𝑢𝑏𝑎𝑖 + 𝑋𝐿𝐺,𝑡𝑒ℎ𝑟𝑎𝑛 ≤ 50
𝑋𝑎𝑝𝑝𝑙𝑒,𝑑𝑢𝑏𝑎𝑖 + 𝑋𝑎𝑝𝑝𝑙𝑒,𝑡𝑒ℎ𝑟𝑎𝑛 ≤ 40
i ij j
F2W = 5 94 76 10
W2D = 3 4 72 5 3
محدودیت ها
𝑗
𝑋𝑖𝑗 ≤ 100
19
Three-layer Supply Chaini = {Samsung, LG, Apple}
j = {Dubai, Tehran}
k = {Tabriz, Esfahan, Shiraz}
Factories DistributorsWarehouses
LG
Samsung
Apple
Tabriz
Esfahan
ShirazTehran
Dubai
50
40
Demand: 60
40
70
Supply: 100
𝑋𝑖𝑗 𝑌𝑗𝑘
Factories
Warehouses
Distributors
𝑋𝑠𝑎𝑚,𝑑𝑢𝑏𝑎𝑖 + 𝑋𝑠𝑎𝑚,𝑡𝑒ℎ𝑟𝑎𝑛 ≤ 100
𝑋𝐿𝐺,𝑑𝑢𝑏𝑎𝑖 + 𝑋𝐿𝐺,𝑡𝑒ℎ𝑟𝑎𝑛 ≤ 50
𝑋𝑎𝑝𝑝𝑙𝑒,𝑑𝑢𝑏𝑎𝑖 + 𝑋𝑎𝑝𝑝𝑙𝑒,𝑡𝑒ℎ𝑟𝑎𝑛 ≤ 40
𝑗
𝑋𝑖𝑗 ≤ 100 i = Samsung
F2W = 5 94 76 10
W2D = 3 4 72 5 3
محدودیت ها
20
i ij j
Three-layer Supply Chaini = {Samsung, LG, Apple}
j = {Dubai, Tehran}
k = {Tabriz, Esfahan, Shiraz}
Factories DistributorsWarehouses
LG
Samsung
Apple
Tabriz
Esfahan
ShirazTehran
Dubai
50
40
Demand: 60
40
70
Supply: 100
𝑋𝑖𝑗 𝑌𝑗𝑘
Factories
Warehouses
Distributors
𝑋𝑠𝑎𝑚,𝑑𝑢𝑏𝑎𝑖 + 𝑋𝑠𝑎𝑚,𝑡𝑒ℎ𝑟𝑎𝑛 ≤ 100
𝑋𝐿𝐺,𝑑𝑢𝑏𝑎𝑖 + 𝑋𝐿𝐺,𝑡𝑒ℎ𝑟𝑎𝑛 ≤ 50
𝑋𝑎𝑝𝑝𝑙𝑒,𝑑𝑢𝑏𝑎𝑖 + 𝑋𝑎𝑝𝑝𝑙𝑒,𝑡𝑒ℎ𝑟𝑎𝑛 ≤ 40
𝑗
𝑋𝑖𝑗 ≤ 100 i = Samsung
𝑗
𝑋𝑖𝑗 ≤ 50 i = LG
𝑗
𝑋𝑖𝑗 ≤ 40 i = Apple
F2W = 5 94 76 10
W2D = 3 4 72 5 3
محدودیت ها
21
i ij j
Three-layer Supply Chaini = {Samsung, LG, Apple}
j = {Dubai, Tehran}
k = {Tabriz, Esfahan, Shiraz}
Factories DistributorsWarehouses
LG
Samsung
Apple
Tabriz
Esfahan
ShirazTehran
Dubai
50
40
Demand: 60
40
70
Supply: 100
𝑋𝑖𝑗 𝑌𝑗𝑘
Factories
Warehouses
Distributors
𝑋𝑠𝑎𝑚,𝑑𝑢𝑏𝑎𝑖 + 𝑋𝑠𝑎𝑚,𝑡𝑒ℎ𝑟𝑎𝑛 ≤ 100
𝑋𝐿𝐺,𝑑𝑢𝑏𝑎𝑖 + 𝑋𝐿𝐺,𝑡𝑒ℎ𝑟𝑎𝑛 ≤ 50
𝑋𝑎𝑝𝑝𝑙𝑒,𝑑𝑢𝑏𝑎𝑖 + 𝑋𝑎𝑝𝑝𝑙𝑒,𝑡𝑒ℎ𝑟𝑎𝑛 ≤ 40
𝑗
𝑋𝑖𝑗 ≤ 100 i = Samsung
𝑗
𝑋𝑖𝑗 ≤ 50 i = LG
𝑗
𝑋𝑖𝑗 ≤ 40 i = Apple
Supply = 1005040
F2W = 5 94 76 10
W2D = 3 4 72 5 3
محدودیت ها
22
i ij j
Three-layer Supply Chaini = {Samsung, LG, Apple}
j = {Dubai, Tehran}
k = {Tabriz, Esfahan, Shiraz}
Factories DistributorsWarehouses
LG
Samsung
Apple
Tabriz
Esfahan
ShirazTehran
Dubai
50
40
Demand: 60
40
70
Supply: 100
𝑋𝑖𝑗 𝑌𝑗𝑘
Factories
Warehouses
Distributors
𝑗
𝑋𝑖𝑗 ≤ 100 i = Samsung
𝑗
𝑋𝑖𝑗 ≤ 50 i = LG
𝑗
𝑋𝑖𝑗 ≤ 40 i = Apple
𝑗
𝑋𝑖𝑗 ≤ 𝑆𝑢𝑝𝑝𝑙𝑦𝑖
A
i
Supply = 1005040
F2W = 5 94 76 10
W2D = 3 4 72 5 3
محدودیت ها
23
Three-layer Supply Chaini = {Samsung, LG, Apple}
j = {Dubai, Tehran}
k = {Tabriz, Esfahan, Shiraz}
Factories DistributorsWarehouses
LG
Samsung
Apple
Tabriz
Esfahan
ShirazTehran
Dubai
50
40
Demand: 60
40
70
Supply: 100
𝑋𝑖𝑗 𝑌𝑗𝑘
Factories
Warehouses
Distributors
Supply = 1005040
F2W = 5 94 76 10
W2D = 3 4 72 5 3
محدودیت ها
24
Three-layer Supply Chaini = {Samsung, LG, Apple}
j = {Dubai, Tehran}
k = {Tabriz, Esfahan, Shiraz}
Factories DistributorsWarehouses
LG
Samsung
Apple
Tabriz
Esfahan
ShirazTehran
Dubai
50
40
Demand: 60
40
70
Supply: 100
𝑋𝑖𝑗 𝑌𝑗𝑘
Factories
Warehouses
Distributors
𝑋𝑠𝑎𝑚,𝑑𝑢𝑏𝑎𝑖 + 𝑋𝐿𝐺,𝑑𝑢𝑏𝑎𝑖 + 𝑋𝑎𝑝𝑝𝑙𝑒,𝑑𝑢𝑏𝑎𝑖 ≥ 𝑌𝑑𝑢𝑏𝑎𝑖,𝑡𝑎𝑏𝑟𝑖𝑧 + 𝑌𝑑𝑢𝑏𝑎𝑖,𝑒𝑠𝑓𝑎ℎ𝑎𝑛 + 𝑌𝑑𝑢𝑏𝑎𝑖,𝑠ℎ𝑖𝑟𝑎𝑧
𝑋𝑠𝑎𝑚,𝑡𝑒ℎ + 𝑋𝐿𝐺,𝑡𝑒ℎ + 𝑋𝑎𝑝𝑝𝑙𝑒,𝑡𝑒ℎ ≥ 𝑌𝑡𝑒ℎ,𝑡𝑎𝑏𝑟𝑖𝑧 + 𝑌𝑡𝑒ℎ,𝑒𝑠𝑓𝑎ℎ𝑎𝑛 + 𝑌𝑡𝑒ℎ,𝑠ℎ𝑖𝑟𝑎𝑧
Supply = 1005040
F2W = 5 94 76 10
W2D = 3 4 72 5 3
محدودیت ها
25
Three-layer Supply Chaini = {Samsung, LG, Apple}
j = {Dubai, Tehran}
k = {Tabriz, Esfahan, Shiraz}
Factories DistributorsWarehouses
LG
Samsung
Apple
Tabriz
Esfahan
ShirazTehran
Dubai
50
40
Demand: 60
40
70
Supply: 100
𝑋𝑖𝑗 𝑌𝑗𝑘
Factories
Warehouses
Distributors
𝑖
𝑋𝑖𝑗 ≥
𝑘
𝑌𝑗𝑘 j = Dubai
j = Tehran
𝑖
𝑋𝑖𝑗 ≥
𝑘
𝑌𝑗𝑘
A
j
𝑖
𝑋𝑖𝑗 ≥
𝑘
𝑌𝑗𝑘
Supply = 1005040
F2W = 5 94 76 10
W2D = 3 4 72 5 3
محدودیت ها
26
Three-layer Supply Chaini = {Samsung, LG, Apple}
j = {Dubai, Tehran}
k = {Tabriz, Esfahan, Shiraz}
Factories DistributorsWarehouses
LG
Samsung
Apple
Tabriz
Esfahan
ShirazTehran
Dubai
50
40
Demand: 60
40
70
Supply: 100
𝑋𝑖𝑗 𝑌𝑗𝑘
Factories
Warehouses
Distributors
Supply = 1005040
F2W = 5 94 76 10
W2D = 3 4 72 5 3
محدودیت ها
27
Three-layer Supply Chaini = {Samsung, LG, Apple}
j = {Dubai, Tehran}
k = {Tabriz, Esfahan, Shiraz}
Factories DistributorsWarehouses
LG
Samsung
Apple
Tabriz
Esfahan
ShirazTehran
Dubai
50
40
Demand: 60
40
70
Supply: 100
𝑋𝑖𝑗 𝑌𝑗𝑘
Factories
Warehouses
Distributors
Supply = 1005040
F2W = 5 94 76 10
W2D = 3 4 72 5 3
𝑌𝑑𝑢𝑏𝑎𝑖,𝑡𝑎𝑏𝑟𝑖𝑧 + 𝑌𝑡𝑒ℎ𝑟𝑎𝑛,𝑡𝑎𝑏𝑟𝑖𝑧 ≥ 60
𝑌𝑑𝑢𝑏𝑎𝑖,𝑒𝑠𝑓𝑎ℎ𝑎𝑛 + 𝑌𝑡𝑒ℎ𝑟𝑎𝑛,𝑒𝑠𝑓𝑎ℎ𝑎𝑛 ≥ 40
𝑌𝑑𝑢𝑏𝑎𝑖,𝑠ℎ𝑖𝑟𝑎𝑧 + 𝑌𝑡𝑒ℎ𝑟𝑎𝑛,𝑠ℎ𝑖𝑟𝑎𝑧 ≥ 70
محدودیت ها
28
Three-layer Supply Chaini = {Samsung, LG, Apple}
j = {Dubai, Tehran}
k = {Tabriz, Esfahan, Shiraz}
Factories DistributorsWarehouses
LG
Samsung
Apple
Tabriz
Esfahan
ShirazTehran
Dubai
50
40
Demand: 60
40
70
Supply: 100
𝑋𝑖𝑗 𝑌𝑗𝑘
Factories
Warehouses
Distributors
F2W = 5 94 76 10
W2D = 3 4 72 5 3
𝑗
𝑌𝑗𝑘 ≥ 60 k = Tabriz
𝑗
𝑌𝑗𝑘 ≥ 40 k = Esfahan
𝑗
𝑌𝑗𝑘 ≥ 70 k = Shiraz
𝑌𝑑𝑢𝑏𝑎𝑖,𝑡𝑎𝑏𝑟𝑖𝑧 + 𝑌𝑡𝑒ℎ𝑟𝑎𝑛,𝑡𝑎𝑏𝑟𝑖𝑧 ≥ 60
𝑌𝑑𝑢𝑏𝑎𝑖,𝑒𝑠𝑓𝑎ℎ𝑎𝑛 + 𝑌𝑡𝑒ℎ𝑟𝑎𝑛,𝑒𝑠𝑓𝑎ℎ𝑎𝑛 ≥ 40
𝑌𝑑𝑢𝑏𝑎𝑖,𝑠ℎ𝑖𝑟𝑎𝑧 + 𝑌𝑡𝑒ℎ𝑟𝑎𝑛,𝑠ℎ𝑖𝑟𝑎𝑧 ≥ 70
Supply = 1005040
محدودیت ها
29
Three-layer Supply Chaini = {Samsung, LG, Apple}
j = {Dubai, Tehran}
k = {Tabriz, Esfahan, Shiraz}
Factories DistributorsWarehouses
LG
Samsung
Apple
Tabriz
Esfahan
ShirazTehran
Dubai
50
40
Demand: 60
40
70
Supply: 100
𝑋𝑖𝑗 𝑌𝑗𝑘
محدودیت ها
Factories
Warehouses
Distributors
Supply = 1005040
F2W = 5 94 76 10
W2D = 3 4 72 5 3
𝑗
𝑌𝑗𝑘 ≥ 𝐷𝑒𝑚𝑎𝑛𝑑𝑘
A
k𝑌𝑑𝑢𝑏𝑎𝑖,𝑡𝑎𝑏𝑟𝑖𝑧 + 𝑌𝑡𝑒ℎ𝑟𝑎𝑛,𝑡𝑎𝑏𝑟𝑖𝑧 ≥ 60
𝑌𝑑𝑢𝑏𝑎𝑖,𝑒𝑠𝑓𝑎ℎ𝑎𝑛 + 𝑌𝑡𝑒ℎ𝑟𝑎𝑛,𝑒𝑠𝑓𝑎ℎ𝑎𝑛 ≥ 40
𝑌𝑑𝑢𝑏𝑎𝑖,𝑠ℎ𝑖𝑟𝑎𝑧 + 𝑌𝑡𝑒ℎ𝑟𝑎𝑛,𝑠ℎ𝑖𝑟𝑎𝑧 ≥ 70
Demand = 604070
𝑗
𝑌𝑗𝑘 ≥ 60 k = Tabriz
𝑗
𝑌𝑗𝑘 ≥ 40 k = Esfahan
𝑗
𝑌𝑗𝑘 ≥ 70 k = Shiraz30
Three-layer Supply Chaini = {Samsung, LG, Apple}
j = {Dubai, Tehran}
k = {Tabriz, Esfahan, Shiraz}
Factories DistributorsWarehouses
LG
Samsung
Apple
Tabriz
Esfahan
ShirazTehran
Dubai
50
40
Demand: 60
40
70
Supply: 100
𝑋𝑖𝑗 𝑌𝑗𝑘Supply =
1005040
F2W = 5 94 76 10
W2D = 3 4 72 5 3
𝑗
𝑌𝑗𝑘 ≥ 𝐷𝑒𝑚𝑎𝑛𝑑𝑘
A
k
Demand = 604070
تابع هدف Min Z = σ𝑖σ𝑗 𝐹2𝑊𝑖𝑗 × 𝑋𝑖𝑗 + σ𝑗σ𝑘𝑊2𝐷𝑗𝑘 × 𝑌𝑗𝑘
Factories
Warehouses
Distributors
محدودیت ها
𝑖
𝑋𝑖𝑗 ≥
𝑘
𝑌𝑗𝑘
A
j
𝑗
𝑋𝑖𝑗 ≤ 𝑆𝑢𝑝𝑝𝑙𝑦𝑖
A
i
31
Modeli = {Samsung, LG, Apple}
j = {Dubai, Tehran}
k = {Tabriz, Esfahan, Shiraz}
Supply = 1005040
F2W = 5 94 76 10
W2D = 3 4 72 5 3
𝑗
𝑌𝑗𝑘 ≥ 𝐷𝑒𝑚𝑎𝑛𝑑𝑘
A
k
Demand = 604070
تابع هدف Min Z = σ𝑖σ𝑗 𝐹2𝑊𝑖𝑗 × 𝑋𝑖𝑗 + σ𝑗σ𝑘𝑊2𝐷𝑗𝑘 × 𝑌𝑗𝑘
Factories
Warehouses
Distributors
محدودیت ها
𝑖
𝑋𝑖𝑗 ≥
𝑘
𝑌𝑗𝑘
A
j
𝑗
𝑋𝑖𝑗 ≤ 𝑆𝑢𝑝𝑝𝑙𝑦𝑖
A
i
𝑋𝑖𝑗≥ 0 𝑋𝑖𝑗∈ int
𝑌𝑗𝑘≥ 0 𝑌𝑗𝑘∈ int
A
i,j
A
j,k
محدودیت عالمت
32
GAMS
i = {Samsung, LG, Apple}
j = {Dubai, Tehran}
k = {Tabriz, Esfahan, Shiraz}
Setsi index of factories /Samsung, LG, Apple/j index of warehouses /Dubai, Tehran/k index of distributors /Tabriz, Shiraz, Esfahan/
33
GAMS
i = {Samsung, LG, Apple}
j = {Dubai, Tehran}
k = {Tabriz, Esfahan, Shiraz}
ParametersSupply(i) amount of factory supply /Samsung 100, LG 50, Apple 40/Demand(k) amount of distributor demand /Tabriz 60, Esfahan 40, Shiraz 70/;
Supply = 1005040
Demand = 604070
Setsi index of factories /Samsung, LG, Apple/j index of warehouses /Dubai, Tehran/k index of distributors /Tabriz, Shiraz, Esfahan/
34
GAMS
i = {Samsung, LG, Apple}
j = {Dubai, Tehran}
k = {Tabriz, Esfahan, Shiraz}
Supply = 1005040
Demand = 604070
Table F2W(i,j) Shipping cost between factory and warehouseDubai Tehran
Samsung 5 9LG 4 7Apple 6 10;
Table W2D(j,k) Shipping cost between warehouse and distributorTabriz Esfahan Shiraz
Dubai 3 4 7Tehran 2 5 3;
F2W = 5 94 76 10
W2D = 3 4 72 5 3
ParametersSupply(i) amount of factory supply /Samsung 100, LG 50, Apple 40/Demand(k) amount of distributor demand /Tabriz 60, Esfahan 40, Shiraz 70/;
Setsi index of factories /Samsung, LG, Apple/j index of warehouses /Dubai, Tehran/k index of distributors /Tabriz, Shiraz, Esfahan/
35
GAMS
𝑋𝑖𝑗≥ 0 𝑋𝑖𝑗∈ int
𝑌𝑗𝑘≥ 0 𝑌𝑗𝑘∈ int
A
i,j
A
j,k
Variables z objective function;
Integer VariablesX(i,j) quantity of goods moved between factory and warehouseY(j,k) quantity of goods moved between warehouse and distributor;
X.up(i,j) = 1000;Y.up(j,k) = 1000;
36
GAMS
𝑋𝑖𝑗≥ 0 𝑋𝑖𝑗∈ int
𝑌𝑗𝑘≥ 0 𝑌𝑗𝑘∈ int
A
i,j
A
j,k
EquationsObj objective function
Factories(i) Factories production constraintWarehouses(j) warehouses constraintDistributors(k) Distributors demand constraint;
Obj .. z =e= sum( (i,j) , F2W(i,j) * X(i,j) ) + sum( (j,k) , W2D(j,k) * Y(j,k) );Factories(i) .. sum( j , X(i,j) ) =l= Supply(i); Warehouses(j) .. sum( i , X(i,j) ) =g= sum( k , Y(j,k) );Distributors(k) .. sum( j , Y(j,k) ) =g= Demand(k);
Z = σ𝑖σ𝑗 𝐹2𝑊𝑖𝑗 × 𝑋𝑖𝑗 + σ𝑗σ𝑘𝑊2𝐷𝑗𝑘 × 𝑌𝑗𝑘
𝑗
𝑌𝑗𝑘 ≥ 𝐷𝑒𝑚𝑎𝑛𝑑𝑘
A
k
𝑖
𝑋𝑖𝑗 ≥
𝑘
𝑌𝑗𝑘
A
j
𝑗
𝑋𝑖𝑗 ≤ 𝑆𝑢𝑝𝑝𝑙𝑦𝑖
A
i
Variables z objective function;
Integer VariablesX(i,j) quantity of goods moved between factory and warehouseY(j,k) quantity of goods moved between warehouse and distributor;
X.up(i,j) = 1000;Y.up(j,k) = 1000;
37
GAMS
Model Spring2020 /all/;Solve Spring2020 using MIP minimizing Z;
Display X.l, Y.l, Z.l;
38