Introduction

A branch of location theory deals with locating the facilities of companies and firms that exist in a competitive market. The aim of these firms is to obtain the maximum benefit from all of their facilities. In a competitive facility location problem (CFLP), firms want to enter the market or launch new facilities to compete with other firms that already have facilities in the same market. In the first paper on competitive facility location, Hotelling (1990) presented a model for locating of two competitor facilities in a linear market. In his model, customers prefer the closest one. Huff (1964, 1966) developed this model and proposed Huff’s gravity model. According to Huff’s model, the probability that a customer patronizes a particular facility is proportional to the attractiveness of the facility (for example quality) and inversely proportional to the distance between a facility and a customer.

The CFLPs are classified from different views. For example, Rhim et al. (2003) classified these types of problems into two categories based on their complexity: (1) the number of entrants in the entry/location game (one or more than one entrants), and (2) the consideration of strategic variables (like price, production quantity and capacity) in post entry/location game. ReVelle and Eiselt (2005) divided the location space into two categories: (1) d-dimensional and (2) network. Each of these categories was subdivided into continuous and discrete problems. Also, according to Ashtiani et al. (2013) demand points are divided into inelastic or elastic, depending on whether the goods or services are essential or inessential. Furthermore, Kress and Pesch (2012) proposed another classification of CFLP that is related to game theory aspects. In this way, competition can be static or dynamic. In a static competition, the locations and characteristics of competitors are known in advance and assumed to be fixed, but in a dynamic competition when a firm loses its market share to a new competitor, it will mostly change its policy. A basic categorization of CFLP is proposed by Kucukaydin et al. (2011) that is based on the type of entry, namely simultaneous and sequential entry. In simultaneous-entry category, the competing firms simultaneously decide on their facility’s location, whereas in the sequential-entry category there exists a priority among competing firms in the market that can react to entrance of new firms. The latter category is based on Stackelberg’s equilibrium.

According to the Stackleberg’s equilibrium, the aim of two competitors, including the leader (the firms that enter into the market) and follower (the competitor firm that exists in the market), is to find an optimal strategy for themselves. This type of problem was proposed by Hakimi (1983) for the first time. He introduced the new relevant concepts consisting of (r|X p )-medianoid and (r|p)-centroid. The meaning of (r|X p )-medianoid problem is that the follower wants to locate r new facilities in order to maximize his objective function while the leader is locating p facilities at a set of points: X p . Also, the meaning of (r|p)-centroid is that the leader wants to find the optimal location for launching p new facilities while he knows that the follower will react to the leader’s action by locating r new facilities.

Bi-level optimization model is used to solve such problems in the literature. In a bi-level CFL optimization, there are two independent players, called leader and follower, who act in a sequential way with aim of maximizing their own objective functions. Here, the first level is according to the leader problem and the second level is about the follower problem. The leader makes a decision with the foresight or anticipation on the follower’s decisions. Drezner and Drezner (1998) proposed five heuristic procedures for the multiple CFLP. In their study, a firm with several facilities aims to locate a new facility in a competitive market where competing facilities already exist. In their work, they did not consider the reaction of competitors.

Bhadury et al. (2003) solved the centroid problem on a plane. The demand points were supposed to be discrete. Two metaheuristic methods were based on the alternating step. Saiz et al. (2009) proposed a branch-and-bound approach for a Huff-like Stackelberg location problem. Two competing firms intended to build a new facility in a planar market and a gravity model determines the market share captured by a firm in their study. Serra and ReVelle (1999) introduced a model for the case that a retail firm enters to a market, where a competing firm exists there. The aim of the new entrant firm is to determine the location and mill prices by forecasting the reaction of the competitor. They developed a Tabu Search algorithm to solve this problem. Redondo et al. (2009) studied a problem in continuous space which in a firm aims to set up new facilities in a competitive environment that other competitors offering the same product or service. The aim of their paper was to maximize the profit gained by the firm while both the location and the quality of the new leader’s facility has to be determined. They solved this problem using random data sets with a robust evolutionary algorithm. Redondo et al. (2010) studied a problem that similar facilities of the follower and the leader are presented in the market and the leader aims to set up a new facility in this planar market. In this problem, the follower will locate another single facility after the leader locates its own facility. The demands are fixed and split through a gravitational model between facilities in the market. Both the location and the quality of the new leader’s facility could be changed to maximize profit obtained by the leader after the follower’s reaction. Four heuristics, including two evolutionary algorithms, a grid search procedure, and an alternating method was presented to solve this problem.

Redondo et al. (2011) presented a global optimization memetic algorithm called UEGO-cent. SASS to cope with a hard-to-solve optimization problem: maximizing the profit obtained by the leader knowing that a competitor reaction will be locating another single facility after the leader locates a new facility.

Redondo et al. (2013) discussed about the (1|1)-centroid problem. This means that a firm (leader) wants to launch a single new facility in a planar market where similar facility of itself and also that of the competitor (follower) exist. The follower reacts into leader’s action by locating a new facility. The aim of both leader and follower was to maximize the total profit obtained by their facilities. They formulated this problem as a bi-level non-linear model that could find the location and quality of facilities of both leader and follower. Another model about competitive facility location is proposed by Kucukaydin et al. (2012). They formulated their model in a discrete space that the number of new facilities of both leader and follower firm is not fixed, but a subset of the same candidates is defined in advance. In their model the leader firm is a new entrant into the market and the follower as a competitor reacts to the new entrant via opening new facilities, closing their existing facilities or changing the level of attractiveness of its facilities in the market.

In this paper, a leader and follower CFLP is considered so that the leader firm owns facilities in the market and decides to develop its activities by launching new facilities and if necessary reconsidering the levels of quality of existing facilities. A bi-level model is designed for solving this problem in a discrete space. In this model, it is assumed that the competition is dynamic and customer demands are deterministic, and also the probable behaviors of customers are estimated based on Huff’s gravity rule. To the best of our knowledge the existence of multiple facilities for the leader firm and the quality levels of them have not been considered in previous researches. This makes the mathematical model more complex although the problem becomes more realistic and practical. In addition, despite the previous researches, there is no limit on the number of new facilities of both leader and follower firms but there is a limited budget available for launching new facilities.

A developed hybrid algorithm including Tabu Search and exact method for solving this problem is proposed which is described in the Sect. 3. The remainder of this paper is organized as follows: in Sect. 2, the model formulation is presented and in Sect. 3, the developed algorithm for solving the proposed model is described. Numerical examples are given in Sect. 4. Finally, the conclusion and future work are provided in Sect. 5.

The model formulation

In this section, the proposed mathematical model is presented. There are two competitors as the leader and follower in the market. The leader firm that already has some facilities in the market decides to promote its business by launching new facilities or changing the quality levels of the existing facilities. In this market, there is a competitor firm that reacts to the leader’s action by launching new facilities or changing the quality levels of its existing facilities. It is assumed that the competition is dynamic and customer’s demands are deterministic, and also the probable behaviors of customers are estimated based on Huff’s gravity rule. In addition, there is no limit on the number of new facilities of both leader and follower firms, but there is a limited budget available for launching new facilities. This problem is formulated as bi-level nonlinear mixed integer model. The notation is as follows:

Parameters:

j::

Index of demand related to demand points (customers), j = 1, 2, …, n.

s::

Index of existing facilities of the leader firm, =1, 2, …, m 1.

i::

Index of potential points for new facilities of the leader firm, i = 1, 2, …, m 2.

k::

Index of existing facilities of the follower firm, =1, 2, …, r 1.

l::

Index of potential points for new facilities of the follower firm, l = 1, 2, …, r 2.

h j ::

Purchasing power of demand point j.

c s ::

Cost or revenue of changing the quality level of existing facility s of the leader firm.

c i ::

Unit quality cost of new facility i of the leader firm.

e k ::

Cost or revenue of changing the quality level of existing facility k of the follower firm.

e l ::

Unit quality cost of new facility l of the follower firm.

g s ::

Revenue of closing an existing facility s of the leader firm.

g k ::

Revenue of closing an exist facility k of the follower firm.

f i ::

Fixed cost of launching a new facility i of the leader firm.

f l ::

Fixed cost of launching a new facility l of the follower firm.

\( \bar{U}_{s} \)::

Maximum quality level of existing facility s of the leader firm.

\( \underset{\raise0.3em\hbox{$\smash{\scriptscriptstyle-}$}}{U}_{s} \)::

Minimum quality level of existing facility s of the leader firm.

\( \bar{Q}_{i} \)::

Maximum quality level of new facility i of the leader firm.

\( \bar{A}_{k} \)::

Maximum quality level of existing facility k of the follower firm.

\( \underset{\raise0.3em\hbox{$\smash{\scriptscriptstyle-}$}}{A}_{k} \)::

Minimum quality level of existing facility k of the follower firm.

\( \bar{M}_{l} \)::

Maximum quality level of new facility l of the follower firm.

B::

Total available budget for launching new facilities of the leader firm.

\( \tilde{B} \)::

Total available budget for launching new facilities of the follower firm.

d sj ::

Distance between existing facility s of the leader firm and demand point \( j \).

d ij ::

Distance between new facility i of the leader firm and demand point \( j \).

d kj ::

Distance between existing facility k of the follower firm and demand point \( j \).

d lj ::

Distance between new facility l of the follower firm and demand point \( j \).

M j ::

The market share obtained from customers in demand point j.

Variables:

T s ::

\( \left\{ {\begin{array}{ll} {1,} & {{\text{If the existing facility of the leader firm is kept open in the site }}s} \\ {0,} & {\text{Otherwise}} \\ \end{array} } \right.. \)

U s ::

Quality level of existing facility of the leader firm in the site s.

X i ::

\( \left\{ {\begin{array}{ll} {1,} & {{\text{If}}\;{\text{a}}\;{\text{new}}\;{\text{facility}}\;{\text{of}}\;{\text{leader}}\;{\text{firm }}\;{\text{is}}\;{\text{launched}}\;{\text{in}}\;{\text{the}}\;{\text{site}}\;i} \\ {0,} & {\text{Otherwise}} \\ \end{array} } \right.. \)

Q i ::

Quality level of new facility of the leader firm in site i.

Z k ::

\( \left\{ {\begin{array}{ll} {1,} & {f\;{\text{the}}\;{\text{existing}}\;{\text{facility}}\;{\text{of}}\;{\text{the}}\;{\text{follower}}\;{\text{firm}}\;{\text{is}}\;{\text{kept}}\;{\text{open}}\;{\text{in}}\;{\text{the}}\;{\text{site}}\;k} \\ {0,} & {\text{Otherwise}} \\ \end{array} } \right.. \)

A k :

Quality level of existing facility of the follower firm in the site k.

Y l ::

\( \left\{ {\begin{array}{ll} {1,} & {{\text{If}}\;{\text{a}}\;{\text{new}}\;{\text{facility}}\;{\text{of}}\;{\text{the}}\;{\text{follower}}\;{\text{firm}}\;{\text{is}}\;{\text{launched}}\;{\text{in}}\;{\text{the}}\;{\text{site}}\;l} \\ {0,} & {\text{Otherwise}} \\ \end{array} } \right.. \)

M l :

Quality level of new facility of the follower firm in the site l.

Now the model can be formulated as the following bi-level non-linear mixed integer problem:

P:

$$ \begin{aligned} {\text{Max}}\quad & \mathop \sum \limits_{j = 1}^{n} h_{j} \frac{{\mathop \sum \nolimits_{s = 1}^{{m_{1} }} (U_{s} /d_{sj}^{2} ) + \mathop \sum \nolimits_{i = 1}^{{m_{2} }} (Q_{i} /d_{ij}^{2} ) }}{{ \mathop \sum \nolimits_{s = 1}^{{m_{1} }} (U_{s} /d_{sj}^{2} ) + \mathop \sum \nolimits_{i = 1}^{{m_{2} }} (Q_{i} /d_{ij}^{2} ) + \mathop \sum \nolimits_{k = 1}^{{r_{1} }} (A_{k} /\tilde{d}_{kj}^{2} ) + \mathop \sum \nolimits_{l = 1}^{{r_{2} }} (M_{l} /\tilde{d}_{lj}^{2} )}} + \mathop \sum \limits_{s = 1}^{{m_{1} }} g_{s} (1 - T_{s} ) \\ & \quad - \mathop \sum \limits_{s = 1}^{{m_{1} }} c_{s} (U_{s} - \underset{\raise0.3em\hbox{$\smash{\scriptscriptstyle-}$}}{U}_{s} T_{s} ) - \mathop \sum \limits_{i = 1}^{{m_{2} }} c_{i} Q_{i} - \mathop \sum \limits_{i = 1}^{{m_{2} }} f_{i} X_{i} . \\ \end{aligned} $$
(1)

S.T:

$$ U_{s} \le \bar{U}_{s} T_{s} \quad \forall s = 1,2, \ldots ,m_{1} , $$
(2)
$$ Q_{i} \le \bar{Q}_{i} X_{i} \quad \forall i = 1,2, \ldots ,m_{2} , $$
(3)
$$ \mathop \sum \limits_{i = 1}^{{m_{2} }} f_{i} . x_{i} \le \mathop \sum \limits_{s = 1}^{{m_{1} }} g_{s} (1 - T_{s} ) + B, $$
(4)
$$ U_{s} \ge 0\quad \forall s = 1,2, \ldots ,m_{1} , $$
(5)
$$ Q_{i} \ge 0\quad \forall i = 1,2, \ldots ,m_{2} , $$
(6)
$$ T_{s} \in \{ 0,1\} \quad \forall s = 1,2, \ldots ,m_{1} , $$
(7)
$$ X_{i} \in \{ 0,1\} \quad \forall i = 1,2, \ldots ,m_{2} , $$
(8)
$$ \begin{aligned} {\text{Max}}\quad & \mathop \sum \limits_{j = 1}^{n} h_{j} \frac{{\mathop \sum \nolimits_{k = 1}^{{r_{1} }} (A_{k} /\tilde{d}_{kj}^{2} ) + \mathop \sum \nolimits_{l = 1}^{{r_{2} }} (M_{l} /\tilde{d}_{lj}^{2} )}}{{\mathop \sum \nolimits_{s = 1}^{{m_{1} }} (U_{s} /d_{sj}^{2} ) + \mathop \sum \nolimits_{i = 1}^{{m_{2} }} (Q_{i} /d_{ij}^{2} ) + \mathop \sum \nolimits_{k = 1}^{{r_{1} }} (A_{k} /\tilde{d}_{kj}^{2} ) + \mathop \sum \nolimits_{l = 1}^{{r_{2} }} (M_{l} /\tilde{d}_{lj}^{2} )}} + \mathop \sum \limits_{k = 1}^{{r_{1} }} g_{k} (1 - Z_{k} ) \\ & \quad - \mathop \sum \limits_{k = 1}^{{r_{1} }} e_{k} (A_{k} - \underset{\raise0.3em\hbox{$\smash{\scriptscriptstyle-}$}}{A}_{k} Z_{k} ) - \mathop \sum \limits_{l = 1}^{{r_{2} }} e_{l} M_{l} - \mathop \sum \limits_{l = 1}^{{r_{2} }} \tilde{f}_{l} Y_{l} . \\ \end{aligned} $$
(9)

S.T.

$$ A_{k} \le \bar{A}_{k} Z_{k} \quad \forall k = 1,2, \ldots ,r_{1} , $$
(10)
$$ M_{l} \le \bar{M}_{l} Y_{l} \quad \forall l = 1,2, \ldots ,r_{2} , $$
(11)
$$ \mathop \sum \limits_{l = 1}^{{r_{2} }} \tilde{f}_{l} . Y_{l} \le \mathop \sum \limits_{k = 1}^{{r_{1} }} e_{k} .(1 - Z_{k} ) + \tilde{B}, $$
(12)
$$ A_{k} \ge 0 \quad \forall k = 1,2, \ldots ,r_{1} , $$
(13)
$$ M_{l} \ge 0\quad \forall l = 1,2, \ldots ,r_{2} , $$
(14)
$$ Z_{k} \in \{ 0,1\} \quad \forall k = 1,2, \ldots ,r_{1} , $$
(15)
$$ Y_{l} \in \{ 0,1\} \quad \forall l = 1,2, \ldots ,r_{2} . $$
(16)

In this model, the first level (constraint (1)–(8)) is along with the decision of the leader firm and the second level (constraint (9)–(16)) is related to the follower firm.

Expression (1) is the objective function that maximizes the leader firm’s profit and consists of five parts: The first part presents the value of obtained income from the available facilities and launching the new facilities. The second part shows the revenue derives from closing the existing facilities in the site s, and the third section demonstrates the income or the cost which results from the changing of quality level. If in the optimal function we have \( U_{s} = \underset{\raise0.3em\hbox{$\smash{\scriptscriptstyle-}$}}{U}_{s} \), it means that the present quality level of the facility in the site s remains unchanged. However, if the situation is \( \underset{\raise0.3em\hbox{$\smash{\scriptscriptstyle-}$}}{U}_{s} \le U_{s} \le \bar{U}_{s} \), the \( c_{s} (U_{s} - \underset{\raise0.3em\hbox{$\smash{\scriptscriptstyle-}$}}{U}_{s} ) \) income will be obtained. Also, if the situation is \( 0 \le U_{s} \le \underset{\raise0.3em\hbox{$\smash{\scriptscriptstyle-}$}}{U}_{s} \), the \( c_{s} (\underset{\raise0.3em\hbox{$\smash{\scriptscriptstyle-}$}}{U}_{s} - U_{s} ) \) revenue will be gained. The fourth and fifth sections of expression present the expenses of quality level and launching the new facilities, respectively.

Constraint (2) determines the upper limit for the quality level of the existing facilities that belongs to the leader. This constraint ensures that if no facility is opened at the site s, then the corresponding quality of facility remains zero and if a facility is opened, then its quality level cannot exceed the maximum level, and similarly the constraint (3) is about the quality level of new facilities that belong to the leader. Constraint (4) ensures that cost of launching new facilities of the leader will not exceed the summation of available budget and revenue that derives from closing the existing facilities of the leader firm. Constraints (5) and (6) show that the quality variables are non-negative variables. Furthermore, constraints (7) and (8) are the binary restriction on leader’s location variables. The description of second-level problem is same as the first level problem.

The described model is a (r|p)-centroid problem and a lot of medianoid problems have to be solved for solving it. These medianoid problems are possible reactions of the competitor, called “scenarios”. As the size of the problem increases, the number of scenarios that follower firm can take increases exponentially. For example, if the number of existing facilities of the follower firm is two (r 1 = 2) and the number of potential location for its new facility is three (r 2 = 3), then the follower firm has a total of 25 possible scenarios to react to the leader. It is impossible to examine all possible scenarios when the size of problem becomes larger, and exact methods (such as Branch and bound (B&B) or Robust Optimization) are not effective. In a number of papers, such as Kucukaydin et al. (2012) and Redondo et al. (2013), it is shown that solving this problem via B&B is excessively time-consuming though Ashtiani et al. (2013) solved only small size of such problems with robust optimization. In this paper a hybrid algorithm including Tabu Search and exact method is developed for solving the problem. This algorithm is described in Sect. 3.

The developed hybrid algorithm

Tabu Search (TS) is a meta-heuristic algorithm that can be superimposed on other procedures to prevent them from getting trapped in local optimal solutions. Diversification strategy guides prevent the algorithm from being trapped in premature local optima or cycling, and intensification strategy in case of finding a good solution keeps the search around its neighbors. TS algorithm is being applied for solving the first level and Branch and Bound for solving the second level of the proposed model. These two algorithms have been linked to solve the problem. To evaluate the quality of the algorithm, the results are compared with an upper bound that obtained from changing the bi-level problem into a one-level via Karush–Kuhn–Tucker (K.K.T) optimality conditions.

In the following, the operation of the proposed algorithm is described after noting the calculation of the upper bound.

Calculation of the upper bound

The K.K.T necessary and sufficient conditions for calculating the upper bound are as follows (Ghodsypour 2012):

Generally, a prerequisite for having X * as the optimal solution to the problem (the dependent issue or lower bound) is that X * meets the following necessary and sufficient conditions:

  • The necessary K.K.T conditions for effectiveness of X is

$$ g_{i} (x) \le 0\quad i = 1, 2, \ldots , m, $$
(17)
$$ \lambda_{i} . g_{i} (x) = 0\quad i = 1, 2, \ldots , m, $$
(18)
$$ \frac{\partial Z(x)}{{\partial x^{*} }} - \mathop \sum \limits_{i = 1}^{m} \lambda_{i} . \frac{{\partial g_{i} (x)}}{{\partial x^{*} }} = 0, $$
(19)
$$ \lambda_{i} \ge 0\quad i = 1, 2, \ldots , m. $$
(20)
  • The sufficient condition is as follows:

  • The objective function must be convex for maximizing and concave for minimizing problems.

  • The solution space has to be convex.

First of all, for providing the K.K.T conditions, some modifications in second-level problem have to be carried out as follows:

If it is assumed that in each scenario, the number of Y ls and Z ks for which their value is 1 be equal to p 1 and p 2, respectively, then the rest of Y ls and Z ks for which their value is 0 and the variables related to quality level that is M l and \( A_{k} \) will be excluded. By doing so the values r 1 and r 2 were replaced by the values p 1 and \( p_{2} \) in the objective function of the first-level problem. Furthermore in the second level problem, the expressions \( \mathop \sum \nolimits_{k = 1}^{{r_{1} }} g_{k} (1 - Z_{k} ) \) and \( \mathop \sum \nolimits_{l = 1}^{{r_{2} }} \tilde{f}_{l} Y_{l} \) are ignored due to stabilization of \( Y_{l} \) and Z k variables. Moreover, with the consolidation of Y l and Z k variables, the constraints of \( A_{k} \le \bar{A}_{k} Z_{k} \) and \( M_{l} \le \bar{M}_{l} Y_{l} \) will be changed into the format of \( A_{k} \le \bar{A}_{k} \) and \( M_{l} \le \bar{M}_{l} \).

Now, that necessary K.K.T conditions are provided, the bi-level problem is changed into a single-level problem (i.e. \( P_{\text{I}} \)):

P I:

$$ \begin{aligned} {\text{Max}}\quad & \mathop \sum \limits_{j = 1}^{n} h_{j} \left( {\frac{{\mathop \sum \nolimits_{s = 1}^{{m_{1} }} (U_{s} /d_{sj}^{2} ) + \mathop \sum \nolimits_{i = 1}^{{m_{2} }} (Q_{i} /d_{ij}^{2} )}}{{\mathop \sum \nolimits_{s = 1}^{{m_{1} }} (U_{s} /d_{sj}^{2} ) + \mathop \sum \nolimits_{i = 1}^{{m_{2} }} (Q_{i} /d_{ij}^{2} ) + \mathop \sum \nolimits_{k = 1}^{{p_{1} }} (A_{k} /\tilde{d}_{kj}^{2} ) + \mathop \sum \nolimits_{l = 1}^{{p_{2} }} (M_{l} /\tilde{d}_{lj}^{2} )}}} \right) \\ & \quad + \mathop \sum \limits_{s = 1}^{{m_{1} }} g_{s} (1 - T_{s} ) - \mathop \sum \limits_{s = 1}^{{m_{1} }} c_{s} (U_{s} - \underset{\raise0.3em\hbox{$\smash{\scriptscriptstyle-}$}}{U}_{s} T_{s} ) - \mathop \sum \limits_{i = 1}^{{m_{2} }} c_{i} Q_{i} - \mathop \sum \limits_{i = 1}^{{m_{2} }} f_{i} X_{i} . \\ \end{aligned} $$
(21)

S.T (2)–(8)

$$ \begin{aligned} & \mathop \sum \limits_{j = 1}^{n} h_{j} (1/\tilde{d}_{kj}^{2} )\frac{{\mathop \sum \nolimits_{s = 1}^{{m_{1} }} (U_{s} /d_{sj}^{2} ) + \mathop \sum \nolimits_{i = 1}^{{m_{2} }} (Q_{i} /d_{ij}^{2} )}}{{\left( {\mathop \sum \nolimits_{s = 1}^{{m_{1} }} (U_{s} /d_{sj}^{2} ) + \mathop \sum \nolimits_{i = 1}^{{m_{2} }} (Q_{i} /d_{ij}^{2} ) + \mathop \sum \nolimits_{k = 1}^{{p_{1} }} (A_{k} /\tilde{d}_{kj}^{2} ) + \mathop \sum \nolimits_{l = 1}^{{p_{2} }} (M_{l} /\tilde{d}_{lj}^{2} )} \right)^{2} }} \\ & \quad - e_{k} + \lambda_{1k} - \lambda_{2k} = 0\quad \forall k = 1,2, \ldots ,p_{1} , \\ \end{aligned} $$
(22)
$$ \begin{aligned} & \mathop \sum \limits_{j = 1}^{n} h_{j} (1/\tilde{d}_{lj}^{2} )\frac{{\mathop \sum \nolimits_{s = 1}^{{m_{1} }} (U_{s} /d_{sj}^{2} ) + \mathop \sum \nolimits_{i = 1}^{{m_{2} }} (Q_{i} /d_{ij}^{2} )}}{{\left( {\mathop \sum \nolimits_{s = 1}^{{m_{1} }} (U_{s} /d_{sj}^{2} ) + \mathop \sum \nolimits_{i = 1}^{{m_{2} }} (Q_{i} /d_{ij}^{2} ) + \mathop \sum \nolimits_{k = 1}^{{p_{1} }} (A_{k} /\tilde{d}_{kj}^{2} ) + \mathop \sum \nolimits_{l = 1}^{{p_{2} }} (M_{l} /\tilde{d}_{lj}^{2} )} \right)^{2} }} \\ & \quad - e_{l} + \lambda_{3l} - \lambda_{4l} = 0\quad \forall l = 1,2, \ldots ,p_{2} , \\ \end{aligned} $$
(23)
$$ - A_{k} \le 0 \quad \forall k = 1,2, \ldots ,p_{1} , $$
(24)
$$ M_{l} - \bar{M}_{l} \le 0 \quad \forall l = 1,2, \ldots ,p_{2} , $$
(25)
$$ - M_{l} \le 0 \quad \forall l = 1,2, \ldots ,p_{2} , $$
(26)
$$ \lambda_{1k} (A_{k} - \bar{A}_{k} ) = 0 \quad \forall k = 1,2, \ldots ,p_{1} , $$
(27)
$$ \lambda_{2k} ( - A_{k} ) = 0 \quad \forall k = 1,2, \ldots ,p_{1} , $$
(28)
$$ \lambda_{3l} ( M_{l} - \bar{M}_{l} ) = 0\quad \forall l = 1,2, \ldots ,p_{2} , $$
(29)
$$ \lambda_{ 4l} ( - M_{l} ) = 0\quad \forall l = 1,2, \ldots ,p_{2} , $$
(30)
$$ \lambda_{1k} , \lambda_{2k} \ge 0 \quad \forall k = 1,2, \ldots ,p_{1} , $$
(31)
$$ \lambda_{3l} , \lambda_{4l} \ge 0 \quad \forall l = 1,2, \ldots ,p_{2} . $$
(32)

As it is previously shown, by using the necessary K.K.T conditions, the bi-level problem is changed to a single-level problem. Now the necessary K.K.T conditions in the second-level problem will be examined.

The first sufficient condition is that the second-level objective function must be concave that is proved in Appendix.

The convexity of the solution space is the second sufficient condition for being X * as a global optimal solution that is obtained from the K.K.T conditions. Due to the existence of fractional and bilinear expressions in the constraints of the problem, it is not possible to comment on the convexity of the solution space with confidence. Therefore, solving this problem does not guarantee reaching the global optimum solution. Consequently, by estimating the fractional and bilinear expressions in linear terms, we can change the solution space into a linear format, and the convexity of the solution space is certain.

For this purpose, new variables are defined as follows:

$$ G_{1j} = \frac{{\mathop \sum \nolimits_{s = 1}^{{m_{1} }} (U_{s} /d_{sj}^{2} ) + \mathop \sum \nolimits_{i = 1}^{{m_{2} }} (Q_{i} /d_{ij}^{2} )}}{{\mathop \sum \nolimits_{s = 1}^{{m_{1} }} (U_{s} /d_{sj}^{2} ) + \mathop \sum \nolimits_{i = 1}^{{m_{2} }} (Q_{i} /d_{ij}^{2} ) + \mathop \sum \nolimits_{k = 1}^{{r_{1} }} (A_{k} /\tilde{d}_{kj}^{2} ) + \mathop \sum \nolimits_{l = 1}^{{r_{2} }} (M_{l} /\tilde{d}_{lj}^{2} )}} , $$
(33)
$$ G_{2j} = \mathop \sum \limits_{s = 1}^{{m_{1} }} (U_{s} /d_{sj}^{2} ) + \mathop \sum \limits_{i = 1}^{{m_{2} }} (Q_{i} /d_{ij}^{2} ) + \mathop \sum \limits_{k = 1}^{{r_{1} }} (A_{k} /\tilde{d}_{kj}^{2} ) + \mathop \sum \limits_{l = 1}^{{r_{2} }} (M_{l} /\tilde{d}_{lj}^{2} ), $$
(34)
$$ G_{1j} = \frac{{\mathop \sum \nolimits_{s = 1}^{{m_{1} }} (U_{s} /d_{sj}^{2} ) + \mathop \sum \nolimits_{i = 1}^{{m_{2} }} (Q_{i} /d_{ij}^{2} )}}{{G_{2j} }}. $$
(35)

In addition, the auxiliary variable s is added to constraints (24)–(27), and then variable s is with the equivalent terms in the constraints (28)–(31). For example, constraint (28) is changed into \( \lambda_{1k} s_{1k} = 0 \). Now, the active set strategy suggested by Grossmann and Floudas (1987) is used for linearizing this expression as:

$$ \lambda_{ 1k} - \alpha V_{ 1k} \le 0, $$
(36)
$$ s_{ 1k} - \alpha ( 1 - V_{ 1k} ) \le 0. $$
(37)

Similarly, this process is done for constraints (29)–(31). It should be mentioned that α is an upper bound on auxiliary variable s; therefore, its value is chosen to be the maximum quality variables along with existing and the new facilities of the follower firm. Variable V is a binary variable that when its value becomes 0, then the corresponding auxiliary variable s is 0 and the corresponding coefficient λ becomes less than an upper bound. On the contrary, if its value becomes 1, then coefficient λ is zero and auxiliary variable s becomes less than an upper bound.

Furthermore, we should describe the way that how the terms G 1j G 2j and \( \frac{{G_{1j} }}{{G_{2j} }} \) can be changed into linear terms. This method is proposed by Adjiman et al. (1998). In their paper, the overestimation of bi-linear terms (for example \( x_{1j} x_{2j} = w \)) was accomplished by including the following constraints:

$$ x_{1}^{L} x_{ 2} + x_{2}^{L} x_{ 1} - x_{1}^{L} x_{2}^{L} - w \le 0, $$
(38)
$$ x_{1}^{U} x_{ 2} + x_{2}^{U} x_{ 1} - x_{1}^{U} x_{2}^{U} - w \le 0, $$
(39)
$$ - x_{1}^{U} x_{ 2} - x_{2}^{L} x_{ 1} + x_{1}^{U} x_{2}^{L} + w \le 0, $$
(40)
$$ - x_{1}^{L} x_{ 2} - x_{2}^{U} x_{ 1} + x_{1}^{L} x_{2}^{L} + w \le 0. $$
(41)

Besides, the two below constrains are used to overestimate the fractional terms (like \( \frac{{x_{1j} }}{{x_{2j} }} = w \)):

$$ \frac{{x_{1}^{L} }}{{x_{2} }} + \frac{{x_{1} }}{{x_{2}^{U} }} - \frac{{x_{1}^{L} }}{{x_{2}^{U} }} - w \le 0, $$
(42)
$$ \frac{{x_{1}^{U} }}{{x_{2} }} + \frac{{x_{1} }}{{x_{2}^{L} }} - \frac{{x_{1}^{U} }}{{x_{2}^{L} }} - w \le 0, $$
(43)

where x L and x U are the lower and upper bound, respectively.

As a result the final model is as follows:

P II:

$$ {\text{Max}}\quad \mathop \sum \limits_{j = 1}^{n} h_{j} G_{1j} + \mathop \sum \limits_{s = 1}^{{m_{1} }} g_{s} (1 - T_{s} ) - \mathop \sum \limits_{s = 1}^{{m_{1} }} c_{s} (U_{s} - \underset{\raise0.3em\hbox{$\smash{\scriptscriptstyle-}$}}{U}_{s} T_{s} ) - \mathop \sum \limits_{i = 1}^{{m_{2} }} c_{i} Q_{i} - \mathop \sum \limits_{i = 1}^{{m_{2} }} f_{i} X_{i} . $$
(44)

S.T.

$$ U_{s} \le \bar{U}_{s} T_{s} \quad \forall s = 1,2, \ldots ,m_{1} , $$
(45)
$$ Q_{i} \le \bar{Q}_{i} X_{i} \quad \forall i = 1,2, \ldots ,m_{2} , $$
(46)
$$ \mathop \sum \limits_{i = 1}^{{m_{2} }} f_{i} . x_{i} \le \mathop \sum \limits_{s = 1}^{{m_{1} }} g_{s} (1 - T_{s} ) + B, $$
(47)
$$ U_{s} \ge 0\quad \forall s = 1,2, \ldots ,m_{1} , $$
(48)
$$ Q_{i} \ge 0\quad \forall i = 1,2, \ldots ,m_{2} , $$
(49)
$$ T_{s} \in \{ 0,1\} \quad \forall s = 1,2, \ldots ,m_{1} , $$
(50)
$$ X_{i} \in \{ 0,1\} \quad \forall i = 1,2, \ldots ,m_{2} , $$
(51)
$$ \mathop \sum \limits_{j = 1}^{n} h_{j} (1/\tilde{d}_{kj}^{2} )w_{2j} - e_{k} + \lambda_{1k} - \lambda_{2k} = 0\quad \forall k = 1,2, \ldots ,r_{1} , $$
(52)
$$ \mathop \sum \limits_{j = 1}^{n} h_{j} (1/\tilde{d}_{lj}^{2} )w_{2j} - e_{l} + \lambda_{3l} - \lambda_{4l} = 0\quad \forall l = 1,2, \ldots ,r_{2} $$
(53)
$$ A_{k} - \bar{A}_{k} + s_{1k} = 0\quad \forall k = 1,2, \ldots ,r_{1} , $$
(54)
$$ - A_{k} + s_{2k} = 0\quad \forall k = 1,2, \ldots ,r_{1} , $$
(55)
$$ M_{l} - \bar{M}_{l} + s_{3l} = 0\quad \forall l = 1,2, \ldots ,r_{2} , $$
(56)
$$ - M_{l} + s_{ 4l} = 0\quad \forall l = 1,2, \ldots ,r_{2} , $$
(57)
$$ \lambda_{ 1k} - \alpha V_{ 1k} \le 0\quad \forall k = 1,2, \ldots ,r_{1} , $$
(58)
$$ s_{ 1k} - \alpha ( 1 - V_{ 1k} ) \le 0\quad \forall k = 1,2, \ldots ,r_{1} , $$
(59)
$$ \lambda_{ 2k} - \alpha V_{ 2k} \le 0\quad \forall k = 1,2, \ldots ,r_{1} , $$
(60)
$$ s_{ 2k} - \alpha ( 1 - V_{ 2k} ) \le 0\quad \forall k = 1,2, \ldots ,r_{1} , $$
(61)
$$ \lambda_{ 3l} - \alpha V_{ 3l} \le 0\quad \forall l = 1,2, \ldots ,r_{2} , $$
(62)
$$ s_{ 3l} - \alpha ( 1 - V_{ 3l} ) \le 0\quad \forall l = 1,2, \ldots ,r_{2} , $$
(63)
$$ \lambda_{ 4l} - \alpha V_{ 4l} \le 0\quad \forall l = 1,2, \ldots ,r_{2} , $$
(64)
$$ s_{ 4l} - \alpha ( 1 - V_{ 4l} ) \le 0\quad \forall l = 1,2, \ldots ,r_{2} , $$
(65)
$$ G_{2j} = \mathop \sum \limits_{s = 1}^{{m_{1} }} (U_{s} /d_{sj}^{2} ) + \mathop \sum \limits_{i = 1}^{{m_{2} }} (Q_{i} /d_{ij}^{2} ) + \mathop \sum \limits_{k = 1}^{{r_{1} }} (A_{k} /\tilde{d}_{kj}^{2} ) + \mathop \sum \limits_{l = 1}^{{r_{2} }} (M_{l} /\tilde{d}_{lj}^{2} )\quad \forall j = 1,2, \ldots ,n, $$
(66)
$$ w_{1j} = \mathop \sum \limits_{s = 1}^{{m_{1} }} (U_{s} /d_{sj}^{2} ) + \mathop \sum \limits_{i = 1}^{{m_{2} }} (Q_{i} /d_{ij}^{2} )\quad \forall j = 1,2, \ldots ,n, $$
(67)
$$ G_{1j}^{L} G_{ 2j} + G_{2j}^{L} G_{ 1j} - G_{1j}^{L} G_{2j}^{L} - w_{ 1j} \le 0\quad \forall j = 1,2, \ldots ,n, $$
(68)
$$ G_{1j}^{U} G_{ 2j} + G_{2j}^{U} G_{ 1j} - G_{1j}^{U} G_{2j}^{U} - w_{ 1j} \le 0\quad \forall j = 1,2, \ldots ,n, $$
(69)
$$ - G_{1j}^{U} G_{ 2j} - G_{2j}^{L} G_{ 1j} + G_{1j}^{U} G_{2j}^{L} + w_{ 1j} \le 0\quad \forall j = 1,2, \ldots ,n, $$
(70)
$$ - G_{1j}^{L} G_{ 2j} - G_{2j}^{U} G_{ 1j} + G_{1j}^{L} G_{2j}^{L} + w_{ 1j} \le 0\quad \forall j = 1,2, \ldots ,n, $$
(71)
$$ \frac{{G_{1j}^{L} }}{{G_{2j} }} + \frac{{G_{1j} }}{{G_{2j}^{U} }} - \frac{{G_{1j}^{L} }}{{G_{2j}^{U} }} - w_{2j} \le 0\quad \forall j = 1,2, \ldots ,n, $$
(72)
$$ \frac{{G_{1j}^{U} }}{{G_{2j} }} + \frac{{G_{1j} }}{{G_{2j}^{L} }} - \frac{{G_{1j}^{U} }}{{G_{2j}^{L} }} - w_{2j} \le 0\quad \forall j = 1,2, \ldots ,n, $$
(73)
$$ \lambda_{1k} , \lambda_{2k} \ge 0\quad \forall k = 1,2, \ldots ,r_{1} , $$
(74)
$$ \lambda_{3l} , \lambda_{4l} \ge 0\quad \forall l = 1,2, \ldots ,r_{2} , $$
(75)
$$ G_{ 1j} , G_{ 2j} \ge 0\quad \forall j = 1,2, \ldots ,n, $$
(76)
$$ V_{1k} , V_{2k} \in \{ 0,1\} \quad \forall k = 1,2, \ldots ,r_{1} , $$
(77)
$$ V_{3l} , V_{4l} \in \{ 0,1\} \quad \forall l = 1,2, \ldots ,r_{2} . $$
(78)

In P II problem, we have

$$ G_{1j}^{L} = G_{2j}^{L} = 0; $$
$$ G_{1j}^{U} = 1; $$
$$ G_{2j}^{U} = \mathop \sum \limits_{s = 1}^{{m_{1} }} (\bar{U}_{s} /d_{sj}^{2} ) + \mathop \sum \limits_{i = 1}^{{m_{2} }} (\bar{Q}_{i} /d_{ij}^{2} ) + \mathop \sum \limits_{k = 1}^{{r_{1} }} (\bar{A}_{k} /\tilde{d}_{kj}^{2} ) + \mathop \sum \limits_{l = 1}^{{r_{2} }} (\bar{M}_{l} /\tilde{d}_{lj}^{2} ). $$

Now, considering the solution to the P II problem rather than obtaining the global optimum solution, a valid upper bound is found. The reason is that by replacing w 3j and w 4j with w 1j w 2j and \( \frac{{w_{1j} }}{{w_{2j} }} \) expressions, respectively, w 3j and w 4j are placed between the upper and lower bounds. Thus, the obtained answer is an upper bound. Finally, the upper bound can be used as a measure for examining the obtained solutions of the solved problem with the proposed hybrid model.

Hybrid algorithm

TS is a single-solution based meta-heuristic algorithm, which uses intermediate and long-term memories to achieve regional intensification and global diversification of the search. This meta-heuristic algorithm is employed for solving the proposed bi-level mixed-integer nonlinear model mentioned in Sect. 2. Each iteration, a solution for the first level of the proposed model is presented through TS that is coded in MATLAB software. This solution is the strategies that are chosen by the leader firm (i.e. opening a new facility in location i′ and changing the level of quality in existing facility i). Then, the second-level model (reactions of the follower) is solved via B&B using GAMS software. Finally, both of two variable sets are used to calculate the fitness function. This process continues by searching within neighbor solutions of the first-level variables to find better solutions, until stopping criteria are met. An overview of proposed algorithm is presented in Fig. 1.

Fig. 1
figure 1

Flowchart of the proposed algorithm

As shown in Fig. 1, TS algorithm starts with an initial solution. We have two types of variables in the first level: the first one is along with existing facilities and the second is along with new facilities of the leader firm. To find an initial solution in the first variable type, we consider that current condition is the initial value for variables X, U and T. In the second variable type, we calculate the average distance of each potential point for new facility site from the demand points set, and set the minimum of them (i′) as initial value for the variable X. So, the initial solution including only a single facility located at site, i′, is as follows:

$$ X_{{i^{'} }} = 1 \quad {\text{and}}\quad X_{i} = 0 ,\quad \forall \quad {\text{all}} \quad i \ne i^{'} $$

Also, we set \( Q_{{i^{'} }} = \bar{Q}_{i} \quad {\text{and}}\quad Q_{i} = 0,\quad \forall \quad {\text{all}}\quad i \ne i^{'} \). The structure of initial solution is depicted in Fig. 2.

Fig. 2
figure 2

The structure of a solution in TS

After calculating the fitness of the current solution, neighbor solutions are being explored. The neighbor solutions are generated from the current solution using these three operators:

  1. 1.

    “Add” (i.e. opening a new facility in potential points with a random value of quality level between [0, \( \bar{Q}_{i} \)]),

  2. 2.

    “Change” (i.e. alternating quality level of an existing facility while |Q new − Q| > ɛ), and

  3. 3.

    “Move” (i.e. closing an existing facility).

An example of these operators is shown in Fig. 3.

Fig. 3
figure 3

Representation of neighbor solution exploration operators

In a normal TS algorithm, to move from current solution to a neighbor solution, the objective function of all neighbor solutions must be evaluated. Since checking all of these solutions has computational cost, only objective function of randomly selected set through the neighboring solutions is examined. This random set is called a candidate list. If at least one of the new solutions is better than the current solution, the fitness function is updated and the stopping criteria are examined. Otherwise, a new candidate list is generated and exploration through this list continues to find a better solution. A tabu list is applied to prevent seeking reiterative solutions or getting trapped in cycling. In tabu list, location and quality level variables of existing and new facilities are saved. We have three types of tabu list and each of them belongs to add, change, and move operators. By doing so, if the characteristic of new solution coincided with those of solutions in the tabu list, then the new solution will be declared as tabu. Also, the aspiration criteria to make good moves even if those moves are in the tabu list are employed. In each iteration, the best neighbor solution becomes the current solution for the next iteration. Furthermore, when the objective function of current solution becomes better than the best fitness function, the best solution and the best fitness are updated. Before the algorithm stops, it should be checked whether intensification or diversification conditions are satisfied or not. The meaning of diversification conditions is that, if the best solution does not improve after several iterations, then the algorithm generates a set of new neighbor solutions and starts from this step again. Finally, two stopping criteria are being used:

  1. 1.

    The maximum number of iterations performed.

  2. 2.

    The maximum number of iterations without improvement. Numerical examples of proposed algorithm are shown in Sect. 4.

Numerical examples

The performance of proposed algorithm is evaluated by comparing it with an upper bound (UB) that is achieved in Sect. 3. Random data set instances are generated since we found no benchmark instances on CFLP in the literature. A small and a medium to large size data set are employed. In the small size, four data sets are used as follows:

  • The number of demand points is set to 10 and 20 (n = {10, 20});

  • The number of existing facilities and potential points for new facilities of the leader, m 1 = 1;

  • The number of potential points for new facilities of the leader, m 2 = 5;

  • The number of existing facilities and potential points for new facilities of the follower, r 1 = r 2 = 1, 2.

In medium- and large-scale of data sets the following data are applied:

  • n = {50, 60, 70, 80, 90, 100};

  • m 2 = {8, 12, 16};

  • and m 1 = r 1 = r 2 = {2, 3, 4}.

The location of demand point of existing and potential points for new facilities of both leader and follower firms are generated from a discrete uniform distribution defined in the interval [0, 100]. Table 1 shows the details of other data generation characteristics:

Table 1 The values of data that are generated randomly

TS algorithm is coded in MATLAB® R2010a and GAMS 23.5 is applied for solving the second-level model and the upper bound. The computations are run on a PC with Intel® cori5 Due 2.67 GHz CPU and 4.0 GB RAM working under Windows 7. Tables 2, 3 and 4 show the corresponding CPU time and the objective value (OV) for each instance, and the best objective value (OVbest) over three runs. The percentage of deviation of the best objective value from upper bound (PDbest) is computed as follows:

Table 2 Performance of the TS algorithm in comparison with the upper bound for small instances
Table 3 Performance of the TS algorithm in comparison with the upper bound for medium instances
Table 4 Performance of the TS algorithm in comparison with the upper bound for large instances
$$ {\text{PD}}_{\text{best}} = 100 \times \frac{{({\text{UB}} - {\text{OV}}_{\text{best}} )}}{\text{UB}}. $$

As shown, the percentage of deviation between the best objective values and the upper bound is less than 1% for eight instances. For 21 instances out of 32, this value is between 1–5%, and just in 3 cases, the difference is more than 5%. It can be noted that this deviation could be due to the deviation of upper bound from global optimal solution. Any way, we can claim that this algorithm can effectively find high-quality solutions in a reasonable time.

Conclusion

In this paper, a leader–follower CFLP which takes into account the reactions of the follower firm is studied. The problem is formulated as bi-level mixed integer nonlinear model. Since there could be too many scenarios that the follower firm is able to react to the leader firm’s action, it is impossible to check all of these scenarios. A hybrid algorithm is proposed to solve this problem. The performance of this algorithm is compared with an upper bound that is achieved from applying the K.K.T conditions to the bi-level problem. Computational results show that our algorithm can find solutions that are near the upper bound in a reasonable time.

As future research, it would be attractive to consider more than one competitor in the market. Also, other meta-heuristic algorithm such as SA or VNS can be employed and their results can be compared with the results of our algorithm. Non deterministic demand of the customers is another issue that would make the CFLP more realistic and practicable.