1 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\in J\) is situated in the plane and her coordinates are given by a point \(x_j\in \mathbb {Q}^2\). Each customer \(j\in J\) is single-minded, i.e., she is willing to purchase either her full demand \(d_j\in \mathbb {Z}_+\), known to the company, or nothing. Moreover, each customer \(j\in J\) announces to the company her budget \(b_j\in \mathbb {Z}_+\) indicating that the product will be purchased only if the sum of travel and purchase costs does not exceed the budget, i.e.,

$$\begin{aligned} d_j\times p + c_j\times ||x_j-y|| \le b_j, \end{aligned}$$
(1)

where \(c_j>0\) is the customer travel cost per distance unit, \(||\cdot ||\) 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\in J\) is satisfied, we refer to this customer as a winner. The winner purchases the product and the company generates revenue of \(d_j\times 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\in I\) by \(y_i\in \mathbb {R}^2\), a feasible strategy of the leader by (yp), and the set of winners under this strategy by \(J(y,p)\subseteq 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\in 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.

2 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\in 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\cap B_2\cap B_3\) at distances exactly \(b_j-p\) from points \(x_j,\ j\in \{1,2,3\}\), respectively. In this case, the solution pair (yp) 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.

Fig. 1
figure 1

Appolonius problem

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 system 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.

Theorem 1

(Generalized Apollonius’ Problem) Given positive integers \(b_1,b_2,b_3,d_1,d_2,d_3\) and three points \(x_1,x_2,x_3 \in \mathbb {Q}^2\) in general positions, the following system of equalities has at most one solution, and this solution is expressible in a closed analytic form.

$$\begin{aligned} d_j\times p + ||x_j-y|| = b_j,\ \ \ j\in \{1,2,3\}. \end{aligned}$$
(2)

Notice, the solution location y is not necessary in \(\mathbb {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.

3 Discretization of the location-pricing problem

In fact, Theorem 1 allows us to restrict the search for optimal solutions to the location-pricing problem among finitely many location-pricing pairs, making the location-pricing 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 \((y,p)\in \mathbb {R}^2\times \mathbb {R}^+\) of size \(O(n^3)\) such that some pair \((y,p)\in S\) is an optimal solution to the location-pricing problem.

Proof

Let \(P=P_1 \cup P_2 \cup P_3\), where

$$\begin{aligned}&\displaystyle P_1 = \left\{ \frac{b_j}{d_j}:\ j\in J \right\} ,\\&\displaystyle P_2 = \left\{ \frac{b_j + b_k- ||x_j-x_k||}{d_j +d_k }:\ j,k \in J \right\} ,\\&\displaystyle P_3 = \bigcup _{J' \subset J:\ |J'|=3} \left\{ p \in \mathbb {R}_+ :\ \exists y \in \mathbb {R}^2 \text{ s.t. } b_j-||x_j-y||- d_jp=0,\ \forall j \in J' \right\} . \end{aligned}$$

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 (yp) 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\in 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\in 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. \(\square \)

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.

4 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 NP-complete [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 location-pricing 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^0M\) 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\in P:\ p<1\}\). Thus, the optimal revenue is at most \((n+M)p^0\le (n+M)p^*\). On the other hand, the optimal revenue is at least M as the unit price is a feasible solution. Thus, \(M\le (n+M)p^*\) or equivalently \(M\le 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\).\(\square \)

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.

Theorem 5

The location-pricing problem with m facilities and n customers can be solved in \(n^{O(m)}\) time.

5 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)\in \mathbb {R}^2\times \mathbb {R}^+\) of size \(O(n^2)\) such that some pair \((y,p)\in 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)\).\(\square \)

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: \(y_1\le y_2\le \ldots \le y_N\).

For every price \(p\in P\), we compute facility locations maximizing the total revenue. Let \(g(p,k,j),\ 0\le k < j\le 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=-\infty \) and \(y_{N+1}=+\infty \). Given \(p\in P\), all values for g can be computed in \(O(n^5)\) time. By Theorem 6, the number of possible prices is quadratic in n. Thus, computing all values for g for all possible prices p takes \(O(n^7)\) time.

Let \(f(p,i,j),\ i=1,2,\ldots ,m,\ j=1,2,\ldots , N,\) denote the maximal revenue generated at price p by all customers from the interval \((-\infty ,y_j]\) subject to allocation of the i-th facility at \(y_j\). To initialize the lookup table, we define the values \(f(p,1,j)=g(p,0,j)\) for all \(j=1,2,\ldots ,N\). The following recursive formula completes the dynamic programming table. For all \(i=2,3,\ldots m\) and \(j=1,2,\ldots ,N+1\) compute

$$\begin{aligned} f(p,i,j)=\max _{1\le k < j} \left\{ f(p,i-1,k)+g(p,k,j) \right\} \end{aligned}$$
(3)

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.

6 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\in \mathbb {R}_+\) be the price for the product at facility \(i\in \{1,2,\ldots ,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-\varepsilon \), where \(\varepsilon >0\) is a small number. Clients 4 and 5 are at \(x_4=x_5=3-\varepsilon \), both having budgets of 2. Let \(c_j=d_j=1,\ j\in \{1,2,3,4,5\}\). Denote, that \(Y = \{0,1-\varepsilon /2,2-\varepsilon ,3-\varepsilon \}\). If \(y_1,y_2\in Y\), then maximal revenue is \(8-3\varepsilon \). But we can get the revenue \(8-3\varepsilon /2\), when \((y_1,y_2)=(0,3-3\varepsilon /2)\) and \((p_1,p_2)=(1,2-\varepsilon /2\)). It’s mean, that we can’t move our discretization lemmas to the mill pricing (Fig. 2).

Fig. 2
figure 2

An example of location-pricing problem (2 facilities and 5 customers)

Fig. 3
figure 3

An example of location-pricing problem (3 facilities and 8 customers)

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.

7 Open problems

Interestingly, if the company is allowed to differentiate the prices among the facilities, even the problem on the line becomes highly non-trivial. This is due to the fact that the customers with sufficiently large budgets can afford traveling to further facilities, i.e., not the nearest ones, to get there the product at a lower price. Thus, our first open question is whether or not the problem on the line with price differentiation is polynomially solvable.

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(\cdot )\).