Warehouse Location Problem
BBasket is an Indian corporation which operates a chain of membership-only grocery clubs. Currently they have thousands of customers in the following locations: Bangalore, Chennai, Hyderabad and Pune. They want to open two warehouses from the given list of locations available to them : Anantapur, Mysore and Vellore. Following is the distance given between warehouse and the customer city. As an analyst, provide them a solution to have minimum total cost of serving all the customers. A customer location can be served by only 1 active warehouse. The table below shows distances between cities in kilometres.
W / C | Hyderabad | Chennai | Bangalore | Pune |
---|---|---|---|---|
Anantpur | 422 | 482 | 215 | 882 |
Mysore | 797 | 482 | 144 | 934 |
Vellore | 779 | 157 | 201 | 1138 |
Mathematical formulation / Pyomo components
Sets:
To define the indexes for the given problem
- Warehouse location,
- Customer location,
Parameters:
- Distance between each pair of warehouse-customer location -
- Maximum number of warehouses that can be opened - P
Decision variables:
- Binary/Boolean variable for warehouse supplying to a customer location
- Binary/Boolean variable for active warehouse location
Objective:
To minimize the sum of distances between the warehouses and customer locations
\begin{align}
\textrm {min}\sum \limits {w,c} \text {d}{w,c} * \text {x}_{w,c}
\end{align}
Constraints:
- One customer location can be satisfied by only one warehouse
- Customer location can get goods from only active warehouse
- Active warehouses should be less than or equal to the required number of warehouses
Step1:
Import Pyomo Environment
#Importing Pyomo environment and other required libraries
from pyomo.environ import *
import pandas as pd
Step2:
Specify / import data