The **P-median problem** consists in finding the $P$ locations which minimize the average [[Distance Function|distance]] (or travel time) in a network. Only the nodes of the network need to be considered as locational candidates, since there is always at least one optimal solution that consists of placing such locations on the network nodes (as discovered by Hakimi in 1965).