The Warehouse Problem
The Warehouse Problem is a well-know optimization case found in many textbooks. The problem consists,
given a set of candidate warehouse
locations
and a set of
stores
to decide which warehouse to open and
which warehouse will server which store.
Input Data
Data is provided as follows:
For each warehouse, we require a tuple (name, capacity, fixed-cost), where
name
is the unique
name of the warehouse,
capacity
is the maximum number of stores it can supply and
fixed_cost
is
the cost incurred by opening the warehouse.
For each couple (warehouse, store) a
supply_cost
which estimates the cost of supplying this store
by this warehouse.
A compact way of representing the data is a Python
dictionary
: for each warehouse tuple, list all supply
costs for all stores.
Business Decisions
The problem consists in deciding which warehouse will be open and for each store, by which warehouse it
will be supplied.
Business Constraints
Decisions must satisfy the following (simplified) business constraints:
1. Unicity: each store is supplied by one unique warehouse
2. A store can only be supplied by an
open
warehouse
3. Capacity: the number of stores supplied by a warehouse must be less than its capacity
Business Objective
The goal is to minimize the total cost incurred by the decisions, which is made of two costs:
The
Total Opening Cost
is the sum of opening costs ranging over all open warehouses.
The
Total Supply Cost
is the sum of supply costs for all the chosen (warehouse, store) pairs
To begin with, let's define a small warehouse dataset: