A company works with three suppliers and three retailers. Each supplier can supply each product, but the supply capacity is limited. Each retailer has a demand for each product, and the demand may not be met in full. The company wants to determine the quantity of each product to be purchased from each supplier to minimize the total cost, which includes the purchase cost, inventory holding cost, and lost sales cost.
The total cost is calculated as follows:
The purchase cost is the unit purchase cost of each product from each supplier.
The inventory holding cost is the inventory holding cost of each product at each retailer.
The lost sales cost is the lost sales cost of each unfulfilled demand at each retailer.
The company must ensure that the demand for each product at each retailer is met to some extent. The company must also ensure that the quantity of each product purchased from each supplier does not exceed the supply capacity of that supplier for that product. The company must also update the inventory level of each product at each retailer at the end of the period. The company wants to minimize the total cost while ensuring that the demand for each product at each retailer is met to some extent.
**I wrote this model file:**
`set Suppliers;`
`set Retailers;`
`set Products;`
`param Demand{Retailers, Products};`
`param SupplyCapacity{Suppliers, Products};`
`param UnitCost{Suppliers, Retailers};`
`param InventoryCost{Retailers, Products};`
`param InitialInventory{Retailers, Products};`
`param LostSalesCost{Retailers, Products};`
`param DemandProbability{Retailers, Products};`
`var QuantityPurchased{Suppliers, Retailers, Products} >= 0;`
`var InventoryLevel{Retailers, Products} >= 0;`
`minimize TotalCost:`
`sum{s in Suppliers, r in Retailers, p in Products}`
`(QuantityPurchased[s, r, p] * UnitCost[s, r] + InventoryLevel[r, p] * InventoryCost[r, p]);`
`subject to DemandSatisfaction{s in Suppliers, r in Retailers, p in Products}:`
`QuantityPurchased[s, r, p] >= Demand[r, p] * DemandProbability[r, p];`
`subject to SupplyCapacityConstraint{s in Suppliers, r in Retailers, p in Products}:`
`QuantityPurchased[s, r, p] <= SupplyCapacity[s, p];`
`subject to InventoryUpdate{r in Retailers, p in Products}:`
`InventoryLevel[r, p] = InitialInventory[r, p] + sum{s in Suppliers} QuantityPurchased[s, r, p] - Demand[r, p] * DemandProbability[r, p];`
and this is the data file:
`set Suppliers := Supplier1 Supplier2 Supplier3;`
`set Retailers := Retailer1 Retailer2 Retailer3;`
`set Products := ProductA ProductB ProductC;`
`param Demand :=`
`Retailer1 ProductA 1000, Retailer1 ProductB 800, Retailer1 ProductC 1200,`
`Retailer2 ProductA 900, Retailer2 ProductB 1000, Retailer2 ProductC 800,`
`Retailer3 ProductA 1200, Retailer3 ProductB 700, Retailer3 ProductC 1000;`
`param SupplyCapacity :=`
`Supplier1 ProductA 2000, Supplier1 ProductB 2500, Supplier1 ProductC 1500,`
`Supplier2 ProductA 1800, Supplier2 ProductB 2200, Supplier2 ProductC 2000,`
`Supplier3 ProductA 1500, Supplier3 ProductB 1800, Supplier3 ProductC 1700;`
`param UnitCost :=`
`Supplier1 Retailer1 4, Supplier1 Retailer2 17, Supplier1 Retailer3 15,`
`Supplier2 Retailer1 6.5, Supplier2 Retailer2 3.5, Supplier2 Retailer3 8,`
`Supplier3 Retailer1 9, Supplier3 Retailer2 8, Supplier3 Retailer3 4.5;`
`param InventoryCost :=`
`Retailer1 ProductA 1, Retailer1 ProductB 1.5, Retailer1 ProductC 0.8,`
`Retailer2 ProductA 0.9, Retailer2 ProductB 1.2, Retailer2 ProductC 0.7,`
`Retailer3 ProductA 1.2, Retailer3 ProductB 0.8, Retailer3 ProductC 1;`
`param InitialInventory :=`
`Retailer1 ProductA 100, Retailer1 ProductB 150, Retailer1 ProductC 80,`
`Retailer2 ProductA 120, Retailer2 ProductB 100, Retailer2 ProductC 70,`
`Retailer3 ProductA 80, Retailer3 ProductB 120, Retailer3 ProductC 100;`
`param LostSalesCost :=`
`Retailer1 ProductA 10, Retailer1 ProductB 8, Retailer1 ProductC 12,`
`Retailer2 ProductA 9, Retailer2 ProductB 10, Retailer2 ProductC 8,`
`Retailer3 ProductA 12, Retailer3 ProductB 7, Retailer3 ProductC 10;`
`param DemandProbability :=`
`Retailer1 ProductA 0.7, Retailer1 ProductB 0.8, Retailer1 ProductC 0.6,`
`Retailer2 ProductA 0.9, Retailer2 ProductB 0.7, Retailer2 ProductC 0.5,`
`Retailer3 ProductA 0.8, Retailer3 ProductB 0.6, Retailer3 ProductC 0.7;`
Results:
`QuantityPurchased [Supplier1,*,*] : `
`ProductA ProductB ProductC := `
`Retailer1 700 640 720 `
`Retailer2 810 700 400 `
`Retailer3 960 420 700 `
`[Supplier2,*,*] : `
`ProductA ProductB ProductC := `
`Retailer1 700 640 720 `
`Retailer2 810 700 400 `
`Retailer3 960 420 700 `
`[Supplier3,*,*] : `
`ProductA ProductB ProductC := `
`Retailer1 700 640 720 `
`Retailer2 810 700 400 `
`Retailer3 960 420 700 ;`
I want to know why each retailer is buying the same amount of each product from each supplier even though purchasing cost of each product from supplier is different for each retailer?