Assistance with a mathematical modeling and optimization issue on AMPL

Job ID: 37803109

Budget: €8 – €30 EUR

Hello,

I am seeking assistance with a mathematical modeling and optimization problem that I have been unable to solve using AMPL. The problem involves allocating stock quantities across different warehouses to minimize total costs, which include storage, order preparation, and shipping costs. Despite my efforts and verifying the correctness of my model, the solution I obtain seems to be incorrect, particularly concerning the allocation and shipment of products from specific warehouses.

Problem Summary:
I have a set of products (SKUs), warehouses, destinations, and marketplaces. Each warehouse has associated costs for storage and order preparation, and there are specific shipping costs for sending products from warehouses to destinations via marketplaces. My objective is to minimize the total cost while fulfilling the demand for products at different destinations and adhering to certain constraints, such as the initial quantity of products and allowed warehouse-marketplace combinations.

Files:

• DAT file: Contains the data for the problem, including sets for SKUs, Warehouses, Destinations, Marketplaces, and parameters for costs, initial quantities, demands, etc.
• MOD file: Contains the model definition, including decision variables, the objective function, and constraints that need to be satisfied.
• RUN file: Used to execute the model with the given data.

Issue Encountered:
The solution I am getting does not seem to reflect an optimal allocation of products to warehouses, especially considering the constraints and the objective to minimize costs. The allocation and shipping decisions in the solution are not aligning as expected.

I am looking for someone with expertise in mathematical modeling and optimization, particularly with experience in AMPL, to review my model, identify any potential issues, and help me arrive at the correct solution.

Would you be able to assist with this problem?

For the DAT file:

set SKUs := sku1; # AV_JSC_WEA017_I17870_F9
set Warehouses := ZFS LDI ASN SAV ESL;
set Destinations := BE CH NL PL AT;
set Marketplaces := ZLBENL ZLCHDE ZLNL ZLPL ZLAT;

param AllowedWarehouseMarketplaceCombos: ZLBENL ZLCHDE ZLNL ZLPL ZLAT :=
ZFS 1 0 1 1 1 # ZLCHDE is not allowed for ZFS
LDI 1 1 1 1 1
ASN 1 1 1 1 1
SAV 1 1 1 1 1
ESL 1 1 1 1 1;

param initialQty :=
sku1 35;

param storageCost :=
ZFS 0.42 # daily 0.014
LDI 0.065
ASN 0.085
SAV 0.12
ESL 0.1;

param orderPrepCost :=
[ZFS, ZLBENL] 0 # Sheet printing 0 Picking 0 Order Prep 0 External courier 0
[LDI, ZLBENL] 0.8 # Sheet printing 0.15 Picking 0.1 Order Prep 0.2 External courier 0.35
[ASN, ZLBENL] 0.28 # Sheet printing 0.18 Picking 0.1 Order Prep 0 External courier 0
[SAV, ZLBENL] 0.48 # Sheet printing 0.18 Picking 0.1 Order Prep 0.2 External courier 0
[ESL, ZLBENL] 0.64; # Sheet printing 0.18 Picking 0.11 Order Prep 0.35 External courier 0

And for the MOD file:

# Model definition
set SKUs; # Available products
set Warehouses; # Warehouses for storage
set Destinations; # Final product destinations
set Marketplaces; # Online sales platforms

param initialQty{SKUs} >= 0; # Initial quantity of each product
param storageCost{Warehouses} >= 0; # Storage cost for each warehouse
param orderPrepCost{Warehouses, Marketplaces} >= 0; # Order preparation cost for each warehouse and marketplace
param shippingCost{SKUs, Warehouses, Destinations, Marketplaces} >= 0; # Shipping cost from warehouse to destination for each marketplace
param demand{SKUs, Destinations, Marketplaces} >= 0; # Expected demand for each product, destination, and marketplace
param AllowedWarehouseMarketplaceCombos{Warehouses, Marketplaces} binary; # Allowed warehouse-marketplace combinations

var Allocate{SKUs, Warehouses} >= 0; # Quantity of each product allocated in each warehouse
var Ship{SKUs, Warehouses, Destinations, Marketplaces} >= 0; # Quantity of each product shipped from each warehouse to each destination for marketplace

# Objective function
minimize TotalCost:
sum{s in SKUs, w in Warehouses} storageCost[w] * Allocate[s,w] +
sum{s in SKUs, w in Warehouses, d in Destinations, m in Marketplaces} (shippingCost[s,w,d,m] * Ship[s,w,d,m] + orderPrepCost[w,m] * Ship[s,w,d,m]);

# Constraints
subject to DemandFulfillment{s in SKUs, d in Destinations, m in Marketplaces}: # Ensure demand fulfillment
sum{w in Warehouses} Ship[s,w,d,m] >= demand[s,d,m];

subject to AllocationVsShipping{s in SKUs, w in Warehouses, m in Marketplaces}: # Ensure that shipping does not exceed allocation
sum{d in Destinations} Ship[s,w,d,m] <= Allocate[s,w];

subject to InitialQuantity{s in SKUs}: # Respect the initial available quantity of each product
sum{w in Warehouses} Allocate[s,w] = initialQty[s];

# Ensure that shipments are only allowed for allowed warehouse-marketplace combinations
subject to MarketplaceRestrictions{s in SKUs, w in Warehouses, d in Destinations, m in Marketplaces}:
Ship[s,w,d,m] <= Allocate[s,w] * AllowedWarehouseMarketplaceCombos[w,m];

Thank you for considering my request.