P Median Problem
P Median Problem
First draft: April 14, 2021 Last update: June 10, 2021
What is the p-median problem
I A NP-hard problem: very difficult to solve efficiently for large problem size.
I What is the problem: determine where to place the facilities to minimize the total
transportation cost of serving all customers.
I Related to previous lectures :
I the lecture on “Tower defence”.
I the lecture on “Set covering, location decision and urban planning”.
2 / 22
Problem setting
I There are n customers who are geographically apart.
I Each facility is assumed to have infinite service capacity. That is, we can simply assign
each customer to exactly one facility. Our objective is to minimize the weighted sum of
transportation cost to serve all customers.
3 / 22
Problem setting
I cij , the transportation cost from facility location i ∈ I to the customer location j ∈ J
4 / 22
How to model: formulate the decision variables
I Identify the goal: “minimizing the total transportation cost from facility location i to the
customer location”
I There are TWO decisions:
I Which customer to go to WHICH facility
I HOW MUCH the demand of the customer is served by the facility.
5 / 22
How to model: formulate the cost
I xij : the fraction of demand from customer j ∈ J being served by facility location i ∈ I
I cij : the unit transportation cost from facility location i ∈ I to the customer location
j∈J
I cij xij : the transportation cost from facility location i ∈ I to the customer location j ∈ J
for serving the fraction of demand
I dj cij xij : the transportation cost from facility location i ∈ I to the customer location
j ∈ J for serving all the demand
I Total cost between all customer and all facility location on full demand
XX
dj cij xij
i∈I j∈J
6 / 22
How to model: formulate the constraints
I Demand served cannot be negative
xij ≤ yi
7 / 22
The p-median problem
XX
min dj cij xij
i∈I j∈J
8 / 22
The p-median problem: why not this formulation?
XX
min dj cij xij
i∈I j∈J
9 / 22
Sample 2-median problem
10 / 22
Examples of other optimal solutions
11 / 22
Special case: the 1-median problem
XX
min dj cij xij
i∈I j∈J
I Facility location
I Clustering
I Vehicle routing
I Computer network
13 / 22
Problem twists (more in assignment 3)
I What if we want to minimize the “maximum distance between the customer and facility
instead”?
14 / 22
Capacitated p-median problem
I cij , dj
15 / 22
How to modify out p-median problem?
16 / 22
The formulation of capacitated p-median problem
XX
min dj cij xij
i∈I j∈J
17 / 22
What variant of the problem does this program model?
XX
min dj cij xij
i∈I j∈J
18 / 22
Binary capacitated p-median problem
I ui , xij , cij , dj
19 / 22
NP-hardness of the problem
I A problem is in NP if a solution is polynomial-time verifiable.
Problem is NP-hard if an algorithm for solving it can be used to solve any problem in NP with
at most polynomial overhead. 20 / 22
NP-complete dominating set problem
21 / 22
Reduction of p-median problem to Dominating set problem
I p-median problem is NP-hard even when the graph is planar of maximum degree 3, with
all edges of weight 1 and all demands 1.
I Can show that on such graph a problem of determining if there exists a dominating set of
size p is polynomial time reducible to the problem of finding a p-median in G.
I There exists a dominating set of cardinality p in G if and only if the otimal solution to the
p-median problem gives objective value n − p.
22 / 22