The Optimal Solution Set of the Multi-source Weber Problem

This paper considers the classical multi-source Weber problem (MWP), which is to find M new facilities with respect to N customers to minimize the sum of transportation costs between these facilities and the customers. We propose a modified algorithm in the spirit of Cooper’s work for solving the MWP including a location phase and an allocation phase. The task of location phase is to find the optimal solution sets of many single-source Weber problems (SWPs), which are reduced by the heuristic of the nearest center reclassification for the customers in the previous allocation phase. Some examples are stated to clarify the proposed algorithms. Moreover, we present an algorithm with O(dlogd)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$ O (d\log d) $$\end{document} time for finding the optimal solution set of SWP in the collinear case; where d is the number of customers.


Introduction
The single-source Weber problem (SWP), also known as the Fermat-Weber location problem, which is probably the first facility location problem historically, was studied as early as the 17th century. This is the simplest continuous facility location model; however, there were still questions, which were resolved only very recently. The Fermat-Weber location problem intends to find a point in R n that minimizes the sum of the weighted Euclidean distance from the d given points: where a j ∈ R n ( j = 1, 2, . . . , d) is the location of the jth customer, and s j > 0 ( j = 1, 2, . . . , d) is the weight corresponding to the customer a j . It is well-known that if the data points are not collinear, f is a strictly convex function and therefore has a unique optimal solution. In the collinear case, SWP can be reduced to a selecting problem (see [2,16,21]). Among the several schemes to solve SWP [3,7,8,10,14,18,22,28], one of the most popular methods was presented in [27], and has been discussed and developed widely in [1,6,12,15,17,19,26]. In [3] the objective function of SWP is approximated by a simple function, and an -approximation algorithm is presented for solving a new problem with this approximated function. In [18] the Newton-Bracketing (NB) method for convex minimization was utilized to solve the SWP. This paper presents a fast algorithm for solving SWP in the collinear case. The advantages of this algorithm are three folds: 1. It can find the optimal solution set (or the set of all optimal solutions) of SWP. 2. It is simple and easy to implement. 3. It requires little computational time.
There are several algorithms (see for instance [16]) to sort the points in R in nondecreasing order, to the best of our knowledge there exists no algorithm for sorting the points in R n , which are collinear. In our algorithm, for solving SWP, we will need to sort the points in R n . For this purpose, we present an algorithm in O(d log(d)) time.
Here, we consider the classical multi-source Weber problem (MWP) which plays an important role in the operations research and management science. The classical MWP is to find the locations of M new facilities to minimize the sum of the transportation costs between these facilities, and the N customers with known locations. We assume that the involved transportation costs are proportional to the corresponding distances. More specifically, the mathematical model of MWP is as follows: w i j = s j , j = 1, 2, . . . , N , where, (1) a j ∈ R n is the location of the jth customer, j = 1, 2, . . . , N ; (2) x i ∈ R n is the location of the ith facility to be determined, i = 1, 2, . . . , M; (3) s j 0 is the given demand required by the jth customer; (4) w i j 0 denotes the unknown allocation from the ith facility to the jth customer; and (5) · is the Euclidean norm in R n .
It is well-known that the objective function of the problem (1.1) is neither concave nor convex, and may have several local optimal solutions, see [9]. Furthermore, [25] demonstrates that the problem is NP-hard, even if all of the demand points are to be located on a straight line. Among the existing effective numerical algorithms for solving MWP is the Cooper's algorithm, which was presented originally in [9]. Its attractive characteristic is that each iteration consists of a location phase and an allocation phase. However, there are similar algorithms [14,18], based on Cooper's algorithm for solving MWP. According to [9], the Cooper's algorithm has a monotone nonincreasing convergent sequence for the objective function value. Nevertheless, it will not guarantee to converge to the global minimum. As the Cooper's algorithm is swift, straightforward and efficient, it has widely been used by other researchers either to generate efficient initial solutions or improve the obtained results even further [4,11,20].
In this paper, we present a modified algorithm in the spirit of Cooper's work for solving MWP, whose important characteristics are that it considers the optimal solution set and improves the desirability of the solutions in the Cooper's algorithm. Since the facilities are capacitated, it can easily be proved that in an optimal solution of the MWP, each customer is satisfied by its nearest facility. In the location phase of modified algorithm, we find the optimal solution set instead of an optimal solution in Cooper's algorithm. Then, in the allocation phase of the modified algorithm, we peruse that each customer is assigned to its nearest facility among all optimal solutions in the location phase that it leads to find near solutions to the best solutions of MWP.
The paper is organized as follows. In the next section, we will discuss the Cooper's algorithm as it will be used as a basis in the design of our algorithm. Section 3 provides some preliminaries which will be used in the sequel. In Sect. 4, we consider the SWP in the collinear case and an algorithm presents for solving this problem. In Sect. 5, a modified Cooper's algorithm in the spirit of the Cooper's work is developed. In Sect. 6, an application for the importance of finding the optimal solution set of MWP is presented.

A Review of Literature
In [9] an iterative heuristic method known as the alternate location-allocation algorithm for solving MWP is presented. This algorithm is efficient in terms of solution quality and computational effort. The base of the Cooper's algorithms is to decrease the objective function value of MWP in each iteration. Let N = {1, 2, . . . , N } and A = {a j | j ∈ N } denote the set of locations of all customers, and denote the disjoint partition of A at the kth iteration. At the (k + 1)th iteration of the Cooper's algorithm, the location phase finds the candidate of locations of facilities by solving the following SWPs: to minimize the total sum of transportation costs. Otherwise, the set of customers should be partitioned again according to the heuristic of the nearest center reclassification (N C R), i.e., the new partition i is the nearest facility for each customer in A k+1 i . Note that with the presupposition that each facility to be determined is capable of providing sufficient services for the targeted customers, the heuristic characteristic shared by all Cooper-type algorithms is that, finally, each customer (a j ) is served only by one of the facilities (the nearest one). This observation explains the disappearance of w i j in (2.1). The MWP has considerably been probed in the literature as a widely used optimization problem. A branch and bound algorithm has been developed in [24] to solve the problem. The exact methods are not capable of dealing with large-sized instances in a reasonable computational time, hence heuristic methods appeared to be the best way forward. In [13], MWP is solved by a p-median problem, and then the Cooper's algorithm is applied to find the proper locations for the facilities. In [4] a solution approach is presented by proposing a combination of the variable neighborhood search and the Cooper's algorithm. A two-phase heuristic method is investigated in [11], known as a cellular heuristic.

Preliminaries
In this section, we present some notations and auxiliary results that will be needed in what follows. Let a, b ∈ R n . We denote the line segment between a and b by [a, b]; i.e., The closed unit ball in R n is denoted by B. The optimal solution set of SWP is denoted by Let x ∈ R. We denote the largest integer less than or equal to x (or the floor function at x) by x . Let X be a non-empty closed set in R n . Let y be a point in X that is closest to x; we say that y lies in the projection of x onto X . The set of points in X closest to x is denoted by We recall the following results from [23]. Letx ∈ R n and φ : R n −→ R be a convex and Lipschitz function. In place of the gradient, we consider subgradients, those elements ξ of R n satisfying: The set of subgradients (called the subdifferential) is denoted by ∂φ(x).
In the following theorem, we summarize some results, which are used in what follows: Theorem 3.1 [23] Let φ : R n −→ R and ψ : R n −→ R be Lipschitz and convex functions. Then, the following assertions hold:

The Nonsmooth Approach to SWP
The objective function of SWP is a nonsmooth function with non-differentiable points a 1 , a 2 , . . . , a d , which makes it hard to solve. This section considers the case that the data points are collinear. By following the well-known lemma, we are able to recognize the collinearity of the given pints a 1 , a 2 , . . . , a d .
In the following theorem, we give a rearrangement of points to get a list of regular points. In this section, we suppose that a 1 , a 2 , . . . , a d are distinct and collinear.

Proof
The proof is trivial.
To regularize a 1 , a 2 , . . . , a d , Theorem 4.3 suggests a simple algorithm, which requires sorting the elements of one of the rows A as a k,1 , a k,2 , . . . , a k,d such that a k,1 = a k,2 .
Note that the list a k,1 , a k,2 , . . . , a k,d in Step 2 can be sorted in O(d log d) time using the merge sort algorithm in [16]. Therefore, the overall running time (or the time complexity) of the sort algorithm is O(n) + O(d log d) time. By considering the sort algorithm, we assume that the list a 1 , a 2 , . . . , a d is regular.
In the following theorem, we discuss the convexity and closedness of the optimal solution set of SWP.

Theorem 4.4 The set is a closed and convex set. In particular, is a subset of
Proof It is easy to see that is a closed and convex set. Now we denote by h the straight line passing through a 1 , a 2 , . . . , a d , Since the list a 1 , a 2 , . . . , a d is distinct and regular, there exists k ∈ {1, 2, . . . , n} such that a k,1 < a k,2 < · · · < a k,d . Therefore, with at least one strict inequality. Multiplying the above inequalities by s j and adding them, we get This contradiction shows that x * can not be an optimal solution for SWP. Now suppose that x * ∈ h and x * / ∈ [a 1 , a d ]. To proceed, consider the two possible cases: (a) Therefore, Multiplying the above inequalities by s j and adding them, we obtain This is a contradiction. The case (b) can be done similarly to the case (a).
In the following theorem, a necessary and sufficient condition for computing the optimal solution set of SWP is presented.
Since f is a convex function, it follows that a p ∈ , which is a contradiction. Similarly, there exists q ∈ {1, 2, . . . , d} such that y * = a q .
We propose the following algorithms for solving SWP in the collinear case.

Input:
The number of customers d and positive multipliers s 1 , s 2 , . . . , s d .

Output:
The optimal solution set of SWP.
For k = r − 1 to 1 do: if |T k | s k , then set l = l + 1 and P(l) = k; else, if T k > s k , then stop.
[a P(1) , a P(l) ] is the optimal solution set of SWP.
The backward algorithm can be replaced by the forward algorithm.

Input:
The number of customers d and positive multipliers s 1 , s 2 , . . . , s d .

Output:
The optimal solution set of SWP.
For k = r + 1 to d do: [a P(1) , a P(l) ] is the optimal solution set of SWP.
Since the objective function is convex, the proof is complete.
The proof of Theorem 4.7 leads directly to the following result. In the collinear case, it is well-known that if a i be a median of the list a 1 , a 2 , . . . , a d , then a i is an optimal solution of SWP (see [2,16,21]). A necessary and sufficient condition of optimality is presented by Proposition 4.8 for SWP, whereas, Condition 4.2 is only a sufficient condition of optimality for SWP in the collinear case. The following example shows the difference between Condition 4.2 and the presented necessary and sufficient condition of optimality in Proposition 4.8. Therefore, x 1 = a 2 satisfies the Condition (4.2), and x 1 is an optimal solution of SWP. Now consider the results in Proposition 4.8, we have Therefore, |T 2 | 2 and x 1 is an optimal solution set of SWP. Now consider x 2 = (2.25, 4.5) T . Since there exists no a j ( j = 1, 2, . . . , 4) such that x 2 = a j , Condition (4.2) does not present any information of optimality at this point. Whereas, since x 2 ∈ [a 2 , a 3 ], from Proposition 4.8, it is necessary and sufficient to show that T 2 = w 2 for verifying the optimality condition at x 2 . Since T 2 = 2, it follows that x 2 is an optimal solution of SWP. Now consider x 3 = (3, 6) T . Since x 3 = a 3 , it is easy to see that i = 3. Since Hence x 4 does not satisfy in Condition (4.2). But Condition (4.2) is only a sufficient condition of optimality, therefore we can not say that x 4 is not an optimal solution of SWP.
Now let us analyze the running time of the backward (forward) algorithm.

Theorem 4.10 Backward (forward) algorithm terminates after at most d iterations, and can be implemented to run in O(d) time.
Proof In the worst case, [a 1 , a 2 ] is the optimal solution set and we applied the backward algorithm beginning with r = d + 1. Therefore, the backward algorithm terminates with k = 1, which implies that the backward algorithm terminates after d iterations.
Let us denote the worst case of the running time of backward algorithm for d customers by g b (d). We obtain Similarly, in the worst case of the running time of forward algorithm for d customers (which denotes by g f (d)), the forward algorithm terminates after d iterations and We can decrease the overall running time by choosing a suitable initial iteration. For this intention, by Proposition 4.8, we suggest the following approach: Use the backward algorithm with r = d In the worst case of the running time of the above approach, d is odd, T d Note that we require (3n + 2)d − 1 operations to compute f (y) for any y ∈ R n , which is more than the required operations of the forward (backward) algorithm for n 2 or d 2.
In the next section, we present an example in which the Cooper's algorithm converges to a non-desirable solution. To get over this difficulty, we propose a modified Cooper's algorithm, which improves the Cooper's algorithm towards the desirability of solutions.
We see that F(x k+2 1 and x k+2 2 are more desirable than x k+1 1 and x k+1 2 . For simplicity, we denote by k i (i = 1, 2, . . . , M), the optimal solution set of the involved SWP in the location phase for the cluster A k i (i = 1, 2, . . . , M), i.e., In the location phase in the Cooper's algorithms, the locations of facilities are found by the algorithms in each iteration of the Cooper's algorithms; this may lead to a poor choice of the locations of facilities, which is unavoidable. Therefore, we need to compute the optimal solution set of the SWPs involved in the location phase. For this intention, if the customers in A k i (i = 1, 2, . . . , M) are collinear, then we use our scheme for computing k i (i = 1, 2, . . . , M); otherwise, the objective function of the SWP involved in the location phase for the cluster A k i (i = 1, 2, . . . , M) is strictly convex function, and k i (i = 1, 2, . . . , M) is singleton, which can be found by applying one of the known algorithms for solving SWP [1,12,14,18,19,27]. Suppose that the Cooper's algorithm is terminated with A k i (i = 1, 2, . . . , M), then our task is to compute k i (i = 1, 2, . . . , M) and find x k i ∈ k i (i = 1, 2, . . . , M) such that A k+1 l = A k l for some l ∈ {1, 2, . . . , M}, which leads to a decrease in the objective function value.
Moreover, we can use the modified Cooper's algorithm when the Cooper's algorithms are stopped with A k i (i = 1, 2, . . . , M).

Input:
The The desirable solution set of MWP.
For r = 1 to N set:
For r = 1 to N do: for j = 1 to N do: For r = 1 to N do: compute k+1 i,r for i = 1, 2, . . . , M; where, k+1 i,r is the optimal solution set for the cluster A k i,r , which is defined similar to (5.1).

Step 6.
Let: where, x k+1 i,r ∈ k+1 i,r for i = 1, 2, . . . , M. 1, 2, . . . , M), k := k + 1, and go to Step 1. Note that the modified Cooper's algorithm is basically equivalent to the original Cooper's algorithm, if in each iteration the optimal solution sets of involved SWPs are singletons. In particular, if t r = 0 for some r ∈ N in the (k + 1)th iteration, then k+1 i,r = k i,r . To simplify the modified Cooper's algorithm in Step 2, we present the following proposition, and its proof is easy. Proposition 5.2 Let a, b, c ∈ R n and list b, c be regular. Then, the following assertions hold: (2) Thus, One can apply the Proposition 5.2 to solve (5.2) exactly, which decreases sharply the computational time of the Modified Cooper's algorithm.

Application
We now proceed to present an application for the importance of finding the desirable solution set of MWP. Consider the following bi-level facility location problem: where, (1) y is the location of the wholesale market to be determined; (2) W i is the corresponding weight for the ith facility.
The aim of this model is to find the main source y * that allocates the demands of the retail markets x 1 , x 2 , . . . , x m with the hypothesis that the sum of transportation costs between these retail markets and the demand of the customers be minimized. It is worth mentioning that we need to find a desirable solution of MWP (6.2) for solving the Problem (6.1). Suppose that { 1 , 2 , . . . , M } is the optimal solution of MWP It is easy to see that y * = (0, 0) T is the optimal solution of Problem (6.3). Moreover, x * 1 = (0, 0) T and x * 2 = (8.5, 0) T are the optimal retail markets. Illustrations of solution method for solving Example 6.1 are presented in Fig. 1.

Conclusion
In this paper, first we proposed an algorithm for sorting the points in R n in the collinear case. Then, using the obtained result, we present an efficient algorithm for solving SWP in the collinear case. Moreover, we modified the Cooper's algorithm which has an advantage in the collinear case. A numerical comparison shows the superiority in efficiency and effectiveness of considering the optimal solution sets of SWPs. The numerical results show that the developed algorithms are suitable for the solution of reasonable MWP with the collinear case. An interesting future research topic is to see whether the results in Sect. 4 can be extended for constrained SWP in the collinear case.
Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.