A new heuristic for solving the p-median problem in the plane

https://doi.org/10.1016/j.cor.2012.07.012Get rights and content

Abstract

This paper presents a new local search for solving the continuous p-median problem in the plane. The basic idea is to first find a good starting solution by overlaying the area containing the set of demand points with a grid and solving heuristically the location problem on this grid. The solution is then used as an initial point for running an improved version of Cooper's well-known alternating local search.

Introduction

The p-median problem is probably the most widely used model in location analysis and the most researched one [1], [13], [20], [21], [34]. The problem is to locate p facilities to serve n demand points each with an associated weight. Each demand point patronizes the closest facility and the objective is to minimize the weighted sum of distances of all demand points. The more researched version of the problem is in a network environment where demand points are located on vertices and distances are measured as shortest distances between any two points on the network [13]. Hakimi [26], [27] proved that optimal locations of the facilities exist at the nodes of the network. In the discrete version of the p-median problem it is assumed that the locations of the facilities are restricted to a finite set of candidate sites. By the Hakimi property the p-median problem in a network environment is thus converted to a discrete problem.

The p-median problem in a planar environment is commonly called the continuous “location–allocation” problem [11], [12]. It is also referred to as the multisource Weber problem (e.g., see [7]). Some earlier papers on the subject are Babich [3], Love and Morris [33], Sherali and Shetty [43] for rectilinear distances, Cooper [11], [12], Chen [10], Drezner [16] for Euclidean distances, Sherali and Tuncbilek [44] for squared Euclidean distances, and Bongartz et al. [4] for general p distances. Love [32] solved the problem on a line using dynamic programming.

The state of the art on the Euclidean distance problem in the plane is the extensive work by Brimberg et al. [7]. Interested readers are also referred to survey papers of the p-median problem given in Mladenović et al. [37] for the discrete model and Brimberg et al. [6] for the continuous one. For a recent overview of solution approaches see Brimberg and Hodgson [8] and its list of references.

The problem is to find p locations for facilities in the plane. A set of n demand points each with an associated weight wi>0 is given. Each demand point gets its service from the closest facility to it. The objective is to minimize the total sum of weighted minimum distances to the facilities. Let di(Xj) be the distance between demand point i and facility j located at Xj=(xj,yj). The vector of unknown locations is X={X1,,Xp}, and thus, the objective function to be minimized isF(X)=i=1nwimin1jp{di(Xj)}

The nonconvexity of the objective function and the existence of multiple local minima were observed by Cooper, the originator of the model [11], [12], who proposed several heuristic approaches to solve it. The best known of these methods is the elegant alternating heuristic of Cooper, although at the time the author was not much impressed with it. This method takes advantage of the two simple sub-problems embedded in the model. That is, given the locations of the facilities (vector X), the demand points are simply allocated to their closest facility (with ties broken arbitrarily). Once the allocations or partition of the customer set is fixed, the problem reduces to p independent single facility problems with convex objective functions that can be solved numerically by an iterative process such as the Weiszfeld procedure [47], [48]. Thus, Cooper's alternating approach switches between location and allocation phases until no further improvement in the objective function is found.

Cooper's alternating local search starts by dividing the customer set into p subsets of approximately equal size. To overcome this rather messy initialization, Scott [42] suggested that the procedure start by randomly selecting p trial facility locations. The original intent of Cooper was to apply the algorithm once. Maranzana [35], working on a similar alternating scheme for the network version of the problem, was the first to propose a multi-start application of the local search, where repeated trials are conducted from different randomly generated initial solutions. The random multi-start version of Cooper's algorithm combined with Scott's starting solution remained the state-of-the-art for solving the planar problem, in spite of the development of several competing local searches. These include the work by Tornqvist et al. [46] who suggested employing a gradient search rather than alternating between location and allocation. Here the objective function is improved by moving the configuration of facility locations in the direction of steepest descent. Other gradient-based heuristics are found in Murtagh and Niwattisyawong [38], Chen [10], and the projection method of Bongartz et al. [4]. It was not until the advent of metaheuristics such as tabu search, variable neighborhood search and the genetic algorithm that better heuristics were developed to solve the problem, with significant improvements obtained especially on larger scale instances (e.g., see [7] for further details).

It is interesting to note the similarity between Cooper's alternating method and the K-means algorithm widely used in statistics and clustering [29], [30]. This similarity was pointed out by Arthanari and Dodge [2]. Both heuristics apply the same idea of switching between location and allocation phases. However, in clustering and statistical models, the fixed points (referred to here as demand points) are considered homogeneous, and hence, all assigned a unit weight. Also the K-means algorithm uses squared Euclidean distance to measure the distance between the centers (facilities) and the fixed points. This makes the location phase much easier to solve, since the center of gravity of a given subset of fixed points may be found by simple closed formulas, instead of the more time-consuming numerical procedure for finding the median point when straight Euclidean distances are used.

The location–allocation problem defined in (1) is known to be NP-hard [36]. Therefore, approximate methods are needed to find ‘good’ solutions to problems of larger scale that may occur in practice. In this paper we present a new heuristic for solving (1). The main idea is to replace random starting points in Cooper's algorithm by high-quality starting points. This is accomplished by overlaying the area containing the demand points with a grid, and solving heuristically a relaxation of model (1) where the facility locations are restricted to the nodes of the grid. The mesh size must be selected with care in order to allow high quality starting solutions to be obtained. On the other hand, the grid should not be too fine since this will increase computation time unnecessarily. The solution found on the grid is used in the next phase as a starting point in a Cooper-type local search.

The heuristic presented here has a similar flavor as the p-median heuristic in [28]. In the latter case, the authors solve exactly a discrete version of (1) where the facility sites are restricted to the set of demand points. They complete the solution with a single adjustment in continuous space using the allocations obtained in the discrete phase. Although very good solutions are obtained (also see [7]), the computation time in the first phase quickly becomes excessive so that results are only reported for smaller instances. We believe our approach has several important advantages. First, the grid allows much more flexibility than the restriction to the set of demand points. Second, the heuristic solution of the discrete relaxation allows larger instances to be solved in reasonable time. Finally our approach terminates with a complete local search in continuous space instead of a single adjustment step.

The main heuristic presented here may be classified as a composite heuristic, in that it combines two heuristics in sequence. The first (discrete) phase is used to find a high-quality starting solution for the second phase where an improved alternating local search is applied to find a local optimum in the original continuous space. Of course we could consider several other possibilities for either phase. For example, there are greedy algorithms proposed in the literature for the network model that could be used alternatively in the first phase to find the starting solution. These include the algorithm by Kuehn and Hamburger [31] where facilities are added one at a time at the fixed points (or nodes) in a greedy way that causes the biggest reduction in the objective function each time; this process continues until p facilities are opened. An efficient implementation of this heuristic is given by Whitaker [49]. Another approach is the stingy approach (e.g., [22], [41]), which starts with more than p open facilities at the nodes and removes them one at a time in a way that increases the objective function as little as possible each time; this would continue until p facilities remain. In fact any heuristic applied to a discretized version of the continuous model could be selected for the initial phase, and there are several to choose from (e.g., see the survey paper by Mladenović et al. [37]). Furthermore, other techniques could be considered in the second phase for augmenting the alternating search, such as applying a “drop and add” step as discussed in Densham and Rushton [14] for the network model, and Brimberg et al. [7] for the continuous model, instead of the transfer follow-up procedure that we propose. But this deviates from the main purpose of the paper, which is to show that by combining a good starting solution with a simple local search, we may obtain very fast and competitive heuristics for the location–allocation problem in the continuous plane.

Another interesting question is whether the quality of the final solution (measured by the value of the objective function) depends on the quality of the initial solution. We found that there is a highly significant correlation between the quality of the starting solution and the final solution of Cooper's alternate method. This suggests that it is beneficial to generate good starting solutions for Copper's algorithm.

The paper is organized as follows. In the next section, the details of our heuristic are presented. First we describe the alternating local search that is used after the grid search, and which incorporates several improvements to the original Cooper algorithm. We also propose heuristic algorithms for the grid search that follow the algorithms suggested in [15] for the multiple competitive location problem in the plane. Improvements are also given for the grid search and for the Weiszfeld procedure that is embedded in the alternating local search with the aim of making the new procedure as efficient as possible. Section 3 describes the computational experiments that were carried out. A discussion of the computational results is also provided. We finish with some conclusions and directions for further research.

Section snippets

The algorithms

We propose improvements to the alternate approach suggested by Cooper [11], [12]. We also propose heuristic algorithms that follow the algorithms suggested in Drezner et al. [15] for the solution of the multiple competitive location problems in the plane.

Computational experiments

Solution methods were programmed in Fortran using double precision arithmetic. The programs were compiled by an Intel 11.1 Fortran Compiler with no parallel processing and run on a desktop with the Intel 870/i7 2.93 GHz CPU Quad processor and 8 GB RAM. Only one thread was used.

Conclusions

This paper develops some powerful heuristics for solving the p-median problem in the plane. First we show that a simple add-on step (IALT) to the classical alternating algorithm attributed to Cooper [11], [12] (ALT), and still widely used as a local search (e.g., see [7]), greatly enhances this method. Furthermore, we provide some ideas to improve the efficiency of the local search. This improvement in efficiency is important, as the local search can be used many times as a subroutine in more

References (49)

  • J. Brimberg et al.

    Attraction probabilities in variable neighborhood search

    4OR—Quarterly Journal of Operations Research

    (2010)
  • J. Brimberg et al.

    A survey of solution methods for the continuous location–allocation problem

    International Journal of Operations Research

    (2008)
  • J. Brimberg et al.

    Improvements and comparison of heuristics for solving the uncapacitated multisource Weber problem

    Operations Research

    (2000)
  • J. Brimberg et al.

    Heuristics for location models

  • J. Brimberg et al.

    Degeneracy in the multi-source Weber problem

    Mathematical Programming

    (1999)
  • R. Chen

    Solution of minisum and minimax location–allocation problems with Euclidean distances

    Naval Research Logistics Quarterly

    (1983)
  • L. Cooper

    Location-allocation problems

    Operations Research

    (1963)
  • L. Cooper

    Heuristic methods for location–allocation problems

    SIAM Review

    (1964)
  • J. Current et al.

    Discrete network location models

  • Z. Drezner

    The planar two-center and two-median problems

    Transportation Science

    (1984)
  • Z. Drezner

    A note on accelerating the Weiszfeld procedure

    Location Science

    (1996)
  • Z. Drezner et al.

    The Weber problem

  • Z. Drezner et al.

    Asymptotic behavior of the Weber location problem on the plane

    Annals of Operations Research

    (1992)
  • S. Eilon et al.

    Distribution management

    (1971)
  • Cited by (47)

    • Multi-facility green Weber problem

      2020, Computers and Operations Research
      Citation Excerpt :

      Several solution approaches are proposed for this problem, see e.g., the study by Brimberg et al. (2008) for a review. In the literature, high quality solutions are obtained by different approaches such as the ones proposed by Brimberg and Drezner (2013), Cooper (1964), Drezner et al. (2015), Drezner et al. (2016), and Drezner and Salhi (2017). The “location-allocation” heuristic proposed by Cooper (1964) is a main ingredient in several solution approaches proposed for the multi-facility Weber problem and several other location-allocation problems.

    • The planar multifacility collection depots location problem

      2019, Computers and Operations Research
      Citation Excerpt :

      This location-allocation method was improved in many papers. The best results are found in Brimberg and Drezner (2013) which summarizes all previous improvements to this method. A sequence of improvements followed (Brimberg et al., 2012; 2014; Drezner et al., 2015a; 2015b; 2016) culminating in the best heuristic to date, partially based on this sequence of improvements (Drezner and Salhi, 2017).

    View all citing articles on Scopus
    View full text