Location, pricing and the problem of Apollonius

In Euclidean plane geometry, Apollonius’ problem is to construct a circle in a plane that is tangent to three given circles. We will use a solution to this ancient problem to solve several versions of the following geometric optimization problem. Given is a set of customers located in the plane, each having a demand for a product and a budget. A customer is satisfied if her total, travel and purchase, costs do not exceed the budget. The task is to determine location of production facilities in the plane and one price for the product such that the revenue generated from the satisfied customers is maximized.


Introduction
Consider the following geometric Stackelberg game. A leader in the game is a company producing a single product in large quantities in uncapacitated production facilities. The company has to determine location of m facilities in a Euclidean plane and a selling price p per unit of the product, one for all facilities. Followers in this game are n customers of the company. Let J be the set of these customers. Each customer j ∈ J is situated in the plane and her coordinates are given by a point x j ∈ Q 2 . Each customer j ∈ J is single-minded, i.e., she is willing to purchase either her full demand d j ∈ Z + , known to the company, or nothing. Moreover, each customer j ∈ J announces to the company her budget b j ∈ Z + indicating that the product will be purchased only if the sum of travel and purchase costs does not exceed the budget, i.e., where c j > 0 is the customer travel cost per distance unit, || · || is the Euclidean norm and y is the closest to the customer facility. Here, we also assume that the travel costs are known to the company. If the budget constraint (1) for a customer j ∈ J is satisfied, we refer to this customer as a winner. The winner purchases the product and the company generates revenue of d j × p from that winner. The problem is to find a revenue maximizing strategy for the leader, i.e., to determine location of facilities and the price such that the total revenue generated from the winners is maximized. Further, we denote the set of facilities by I , the location of facility i ∈ I by y i ∈ R 2 , a feasible strategy of the leader by (y, p), and the set of winners under this strategy by J (y, p) ⊆ J . We refer to this problem as the location-pricing problem. Furthermore, without loss of generality, we assume c j = 1 for all customers j ∈ J , otherwise we normalize the instance dividing the demands and the budgets by the customer travel costs.
In this paper, we first address the location-pricing problem with one facility and three customers, each having unit demand. This problem is solved by using a solution to the Apollonius' problem. Then, we gradually extend the algorithm to the case with n customers having arbitrary demands and further to the case of m facilities. We admit that none of our algorithms is practical as even for a single facility case the run-time is of order O(n 4 ). We see the contribution of this paper as rather theoretical. We argue that the approach and the algorithm is not extendable to the case of price differentiating facilities. We conclude with discussion and some open problems.
To provide a reader more insight on item-pricing problems and related Stackelberg games we refer to the introductions in [3,4,9]. For surveys on the solution methods developed for the geometric k-median and facility location problems we refer to [1,2,6,8]. Before this paper, we were not aware of papers combining combinatorial pricing and geometric location problems.

A single facility case with three customers
Consider a simple special case of the location-pricing problem with one facility and three customers, all having unit demands, i.e., d 1 = d 2 = d 3 = 1. Notice, in any optimal solution, the budget constraint of at least one of the customers must be tight, otherwise the company can increase the revenue by increasing the price. Thus, for three customers we have three distinct cases: one-, two-, or all three budget constraints are tight. We present derivations for the latter case with all three budget constraints being tight. The other two cases are even simpler though treated similarly.
First, we provide some geometric intuition behind the solution to the problem. With no purchase costs, each customer j ∈ J can afford traveling within a circle B j of radius b j centered at x j . In turn, if per-unit price of the product is p, every winner j travels within a circle of radius b j − p centered at x j . By assumption, all three customers are the winners and all three budget constraints are tight. Therefore, the facility is located in the intersection of the circles B 1 ∩ B 2 ∩ B 3 at distances exactly b j − p from points x j , j ∈ {1, 2, 3}, respectively. In this case, the solution pair (y, p) is also a solution to the famous ancient Apollonius' Problem [7]: Given three circles, B 1 , B 2 , B 3 , in a plane with centers x 1 , x 2 , x 3 and of radii b 1 , b 2 , b 3 , respectively, find a circle B 0 tangent to all three given circles. Here, a solution to the Apollonius problem is a circle B 0 of radius p centered at y (Fig. 1). Generally, any three distinct circles have eight different circles that are tangent to them. The number eight comes from the fact that solution circles can enclose or exclude the three given circles in eight different ways: 1) B 0 does not enclose the whole interior of neither of the given circles; 2-4) B 0 encloses the entire interior of exactly one of the circles, B 1 or B 2 or B 3 ; 5-7) B 0 encloses the entire interior of exactly two out of three circles; 8) B 0 encloses all three given circles. The solution to the location-pricing problem is clearly the first of the eight options.
The solution to the Apollonius' Problem, and therefore to the special case of the location-pricing problem, can be derived algebraically as a solution to the sys- y p tem of three quadratic (budget) equations; see e.g. [14]. Using literally the same technique, one can solve the generalized Apollonius' Problem, or equivalently, the location-pricing problem with arbitrary positive demands d 1 , d 2 , d 3 , as in the following theorem.
in general positions, the following system of equalities has at most one solution, and this solution is expressible in a closed analytic form.
Notice, the solution location y is not necessary in Q 2 because of the use of square roots in computing the Euclidean distances. Thus, we might have a problem specifying the output. There are two solutions to this problem. First, as in Arora [1] and as in many other papers on computational geometry, we can bypass this by using the Real RAM model introduced by Shamos [13]. Alternatively, we can encode the facility location using just the rational numbers under the square roots and computing a rational proxy to the facility with arbitrary good precision.

Discretization of the location-pricing problem
In fact, Theorem 1 allows us to restrict the search for optimal solutions to the locationpricing problem among finitely many location-pricing pairs, making the locationpricing problem a combinatorial optimization problem. Even stronger, the number of possibly optimal location-pricing pairs is cubic in the number of customers and independent on the number of facilities.

Theorem 2 (Location-Price Discretization) For any instance of the location-pricing problem with n customers, there is a set S of pairs
such that some pair (y, p) ∈ S is an optimal solution to the location-pricing problem.
Here, set P 3 is simply the union of radii p of solution circles of the Generalized Apollonius Problem from Theorem 1 for all possible triplets of winners in J . We shall argue that P contains an optimal price to the location-pricing problem.
Consider an optimal solution (y, p) of the location-pricing problem. We already argued that at least one of the budget constraints must be tight.
Assume that the budget constraint of only one customer j ∈ J is tight. Then the optimal location of the facility is y = x j and the optimal price is p = b j /d j . This forms the first set P 1 of possibly optimal prices and the corresponding set Y 1 = {x j : j ∈ J } of possibly optimal facility locations. Notice, the number of potentially optimal pairs here is linear in n. Similarly, P 2 and P 3 are formed when the number of tight budget constraints is 2 and 3, respectively. Since for P 2 and for P 3 we have to consider all possible pairs and triplets of tight budget constraints, respectively, the cardinality of P 2 is quadratic and the cardinality of P 3 is cubic in n.
In the case when more than three budget constraints are tight, the system of equations becomes overdetermined: we have only three variables, p and two coordinates of y, while the number of equations is at least four. In this case, if a solution to the system exists, it will be fully determined by a subset consisting of only three equations. This brings us back to the case with only triplets of budgetary constraints and the set of possibly optimal prices P 3 . Potentially optimal facility locations are found by solving the Generalized Apollonius Problem for y. Therefore, we have a cubic number of potentially optimal facility locations. This proves the theorem.
For a single facility case of the location-pricing problem we can straightforwardly enumerate all O(n 3 ) possible facility locations together with prices from P. For every location-pricing pair, the revenue is evaluated in O(n) time. Then, the maximum revenue solution is the optimal solution to the problem and we have proven the following theorem.

Theorem 3
The location-pricing problem with one facility and n customers can be solved in O(n 4 ) time.

Multiple facilities
Not surprisingly, the geometric location-pricing problem becomes intractable when the number of facilities becomes an input parameter.

Theorem 4 The location-pricing problem with m facilities and n clients is strongly NP-hard.
Proof Consider the following geometric minimum hitting set problem on unit disks: given n unit disks in the plane and a positive integer K , does there exist a hitting set of size K , i.e., a set of points in the plane such that every given disk contains at least one point of the set? Here, the disks are given by rational coordinates of their centers.
We reduce this minimum hitting set problem, known to be strongly NPcomplete [10][11][12], to the location-pricing problem with m = K + 1 facilities. Given n unit disks in the minimum hitting set problem, we construct the input of the locationpricing problem as follows. For every disk we create a disk customer located in the center of the disk. Every disk customer j has budget b j = 2, and unit demand and transportation costs, d j = c j = 1. Pick a point z on distance at least 3 from all disk customers. Create a controlling customer at point z, having budget of 1, travel costs of 1 and demand of M, where M is a sufficiently large number to be defined later. We claim that, for a suitable choice of M, a hitting set of size K exists if and only if the location-pricing problem on K + 1 facilities has a solution with revenue M + n.
We first argue that, for sufficiently large M, the optimal price is exactly one per unit of the product. For contradiction, consider two cases: the optimal price is p 0 > 1 and the optimal price is 0 < p 0 < 1.
Let the optimal price p 0 be strictly greater than 1. Then, the product is not affordable for the controlling customer, as her budget is 1. From the disk customers the company can get revenue at most 2n, as the budget of each disk customer is 2. On the other hand, if the company sets the price to be 1, it can generate revenue of M from the controlling customer alone. For M > 2n, this implies p 0 > 1 is a suboptimal price.
Let 0 < p 0 < 1, then at price p 0 , the company generates revenue p 0 M from the controlling customer and kp 0 from the disk customers, where k is the number of winners among the disk customers. By Theorem 2, we may assume that p 0 is at most p * = max{ p ∈ P : p < 1}. Thus, the optimal revenue is at most (n + M) p 0 ≤ (n + M) p * . On the other hand, the optimal revenue is at least M as the unit price is a feasible solution. Thus, M ≤ (n + M) p * or equivalently M ≤ np * /(1 − p * ). However, if we set M > np * /(1 − p * ), we have that the revenue of M generated by unit price is greater than the optimal revenue, a contradiction. Now, if the price is fixed at p = 1, the company gets revenue M from the controlling customer and revenue 1 from each disk customer who is the winner. Any disk customer cannot afford traveling further than one distance unit as her budget is 2 and for the product she already must pay 1. This implies that a customer is a winner if and only if a facility is located within radius 1 from the customer location, or equivalently, if a facility hits the customer's disk. Notice, one facility must be reserved to cover the controlling customer. Thus, to maximize the revenue, the other K facilities must hit the maximum number of n unit disks around the disk customers. Therefore, for n unit disks in the plane a geometric hitting set of size K exists if and only if the corresponding instance of the location-pricing problem has a solution of revenue M + n.
On the positive side, if the number m of facilities is fixed (a constant), we can enumerate all possible choices for m facilities among O(n 3 ) options of the set S as in Theorem 2. Again, choosing the maximum revenue option, we obtain an optimal solution to the problem. This result is reported in the following theorem.

Location and pricing on the line
Consider a special case of the location-pricing problem, where all input points of the customers are co-linear resembling the real-life situations, e.g., on seashores, highways or assembly lines. In this case, the location-pricing problem can be solved in polynomial time.
The most important ingredient of the algorithm is again the discretization theorem.

Theorem 6 For any instance of the location-pricing problem with n co-linear customers, there is a set S of pairs (y, p)
∈ R 2 × R + of size O(n 2 ) such that some pair (y, p) ∈ S is an optimal solution to the location-pricing problem.
Proof The proof of this theorem repeats the lines of the proof of Theorem 2. Moreover, from the co-linearity of the customers we know that the locations of the facilities will also be co-linear with the customers. Thus, the locations of the customers as well as facility locations are specified by a single coordinate. Hence, a system with already three tight budgetary constraints becomes overdetermined as we have only two variables: one for price and one for a point coordinate. Therefore, we have to consider only the pairs of tight budgetary constraints that reduces the size of the set S to O(n 2 ).
Now, for an arbitrary number m of facilities, we can construct a dynamic program that finds the optimal solution, i.e., m location-pricing pairs, in polynomial time. Without loss of generality we assume that all customers are situated on a line. For simplicity, let set S be specified by y-coordinates of the points and the price set P. Let N denote the size of set S. Again, without loss of generality, we assume that coordinates of points in set S are arranged in non-decreasing order: For every price p ∈ P, we compute facility locations maximizing the total revenue. Let g( p, k, j), 0 ≤ k < j ≤ N + 1, denote the revenue generated by customers/winners from the interval [y k , y j ], i.e, the customers who can afford buying the product at price p at the nearest endpoint of the interval, either in y k or in y j . We assume here that y 0 = −∞ and y N +1 = +∞.
Then, f ( p, m, N + 1) is the maximum revenue generated at price p. Notice, filling-in the lookup table requires O(mn 5 ) time. Enumerating over all possible prices solves the location-pricing problem. Therefore, the dynamic programming takes O(mn 7 ) time and we have the following theorem.

Theorem 7
For any instance of the location-pricing problem with n co-linear customers, an optimal solution to the location-pricing problem can be constructed in O(mn 7 ) time.

Mill pricing
In this section we provide intuitive arguments and examples supporting the claim that our approach cannot be generalized to price discriminating strategies. In the nutshell this means that our approach is only applicable to the uniform pricing when all facilities are forced to set the same price. To this end, consider the case when the company may set different prices at different facilities. This pricing strategy is often referred to as mill pricing. Let p i ∈ R + be the price for the product at facility i ∈ {1, 2, . . . , m}. Clearly, if m = 1 the mill pricing and the uniform pricing are equivalent. Unfortunately, things become drastically different already for one-dimensional (line) case with only two facilities, i.e., m = 2. Consider the following instance of the problem. There are 5 customers on the line. Customers 1 and 2, each having budget of 1, are situated in the point x 1 = x 2 = 0. Client 3 with budget of 3 is at x 3 = 2−ε, where ε > 0 is a small number. Clients 4 and 5 are at x 4 = x 5 = 3 − ε, both having budgets of 2. Let c j = d j = 1, j ∈ {1, 2, 3, 4, 5}. Denote, that Y = {0, 1 − ε/2, 2 − ε, 3 − ε}. If y 1 , y 2 ∈ Y , then maximal revenue is 8 − 3ε. But we can get the revenue 8 − 3ε/2, when (y 1 , y 2 ) = (0, 3 − 3ε/2) and ( p 1 , p 2 ) = (1, 2 − ε/2). It's mean, that we can't move our discretization lemmas to the mill pricing (Fig. 2).
Another interesting instance is described in the Fig. 3. Here, the previous instance had symmetrically been extended to the right. There are 8 clients and 3 facilities (Fig.  3). In optimal solution the second facility is located in the middle of the figure, the first facility is located to the left of the leftmost client and the third facility is located to the right of the rightmost client.
The second open problem is to construct an FPT algorithm for the geometric location-pricing problem parametrized by the number m of facilities, i.e., running in time f (m) poly(n) for some function f (·).