Introduction

Location–allocation problem is one of the most important issues in industrial engineering, which has many applications in the real-world industry; the simplest of location–allocation models is that a company, assuming that there is no rival in the market, wants to set up its own marketplace. In this model, the company will establish its center/centers in the best possible location by examining the candidate locations for deployment. As shown in the left side in Fig. 1, in this model, the company only establishes one center and serves all customers. The more complex type of this model is that the company wants to set up its center/centers on the market, knowing that the rival is present in the market or is going to locate in the near future. As shown in the right side in Fig. 1, in this model, due to rivals, the leading company first selects the best location for the establishment of its center/centers, and the Follower, based on the strategies of the rival company (Leader), finds the best place to deploy its center/centers. The model in this research is a multi-location model in a competitive market where the customers select the facilities that are the most attractive. The competitive market and the competition used in this research have the main concept of the Stackelberg game, which is formulated as a bi-level programming model. Customers prefer the closest facility and rate the facilities by their distance. The closest facility is ranked first, and the furthest is ranked last.

Fig. 1
figure 1

Competitive facility location in case of the presence or absence of rivals

The competitive facility location problem has four main characteristics, which help to classify the competitive facility location problems; these characteristics are (1) competing area (discrete, continuous, network), (2) the number of competitors, (3) pricing policy, and (4) customer behavior (Alekseeva et al. 2009). The competitive location problem between two rivals is divided into two different categories: (1) competitive location with simultaneous entry of two rivals and (2) competitive location with consecutive entry (Karakitsiou 2015). The model discussed in this paper is a competitive location with the consecutive entrance. Generally, two type of games can happen: (1) cooperative competitive location and (2) noncooperative competitive location. In the cooperative competitive location of the two rivals, when each of the rivals enters the market, they cooperate with each other that means both of them know the strategy of the other; thus, this concludes more profit. The noncooperative competitive facility location means that none of the competitors knows anything about the other competitor’s strategy, and each of the rivals tries to enter the market earlier than the other competitor so that he/she could use the advantages of being a Leader in entering the market; thus, he/she could make the maximum of market share. The goal of the competitors is to attract the most possible number of customers and meet their demands. To the best of our knowledge, attracting customers depends on many factors like the distance between customer and facility, size of the facility, quality of service and the validity and reliability of the facility (finally customer rates the facilities by these criteria), which all of these mentioned factors have been studied by previous researchers. The establishment of a facility as a supplier in the market depends on the available customers’ tendency information. These preferences will allow competitors to locate the most appropriate center/centers to provide customer service; thus, mutually the customer will patronize the most comfort facility (the facility with the highest rank). In this article, a binary bi-level location–allocation model has been presented. In the presented model, each of the Leaders and Followers tends to maximize its market share and profit.

This research has been investigated in eight sections; in the second part of the article, the literature on location–allocation and bi-level programming is reviewed. In “Bi-level location--allocation problem” section, the model of the bi-level programming for the binary location–allocation problem is discussed, in  “Full enumeration methods” section, three full enumeration procedures are discussed, and in “Finding a feasible solution using clustering algorithm” section and “Branch-and-bound procedure” section, we have presented a clustering-based algorithm for obtaining a good feasible solution and a developed branch and bound for binary bi-level problems, respectively. Finally, in “Sensitivity analysis and numerical examples” section and “Conclusion” section, the sensitivity analysis and the conclusions driven by this article are discussed.

Literature review

Location–allocation problem is one of the most applicable and important problems. As seen in the literature, for solving these types of problems different types of approaches like exact, heuristic and meta-heuristics have been used; for example, Ostresh (1975) has presented an efficient algorithm for solving the location–allocation problem with two centers which have been used by many researchers. In this research, the concept of competition has been used for the location–allocation problem. Moore and Bard (1990) presented an exact approach for solving a bi-level programming problem which was capable of solving the mixed-integer problems. Bard and Moore (1992) presented an exact branch-and-bound approach for solving binary bi-level problems. Hocking (2004) presented an exact method for solving bi-level programming problems using the branch-and-bound method for binary–binary models.

According to the literature, the first work in the competitive location can be attributed to Laporte et al. (2015). Hotelling considered a market with the presence of two competitors with customers distributed uniformly. This is also known as the ice cream salesman problem (first introduced by Lash in 1954). In competitive environments, the reason for competition is to gain market share in order to maximize profit. In 1929, Hotelling provided a methodology in which each customer would be served by the nearest center. They also assumed the assumptions that all centers had the same attractions and that the purchasing power of all demand points was the same. Drezner (1994) considered the problem of competing with the definition of the utility function in continuous space and considered the level of attractiveness for each center and took into account the Hotelling model. In this model, each customer can patronize a center that is more attractive, and merely, the distance to the facility will not be the only important criterion for choosing the facility.

Huff (1964) presented a gravity model, according to which the probability for a customer wishing to be served by a center is a conformity of a function directly proportional to the attractiveness and reverse ratio of the distance from the customer.

Alekseeva et al. (2009) put forward the P-median problem that two decision makers (Leader and Followers) compete in attracting customers in a given market. In this case, the Leader sets up its facilities and is expected that the Follower reacts with the decision to locate its facilities in the market. In this article, each of the Leaders and the Followers is trying to maximize market share. The authors introduced the problem in two levels as a binary programming problem, and they also developed a hybrid memetic algorithm to solve the lower-level problem.

Küçükaydin et al. (2011) raised the issue in relation to a company that is attempting to enter the market by locating a new facility in which rival facilities are located. The goal of the new company is to find the location and set up the attractiveness for each of the facilities to maximize its profit; the present competitor in the market can react to the strategy of the new company by adjusting the attractiveness of the existing facility/facilities. In this paper, Huff’s gravity-based model has been used to model customers behavior. This model has been formulated as a mixed-integer nonlinear bi-level programming problem and has considered the company entering the market as a Leader and the rival competitor as the Follower. In order to find the optimal solution, this model has been transformed into a single-level problem so that it can be solved by general optimization methods.

Fernandez et al. (2017) have considered the location–allocation problem in a market with static competition and nonelastic demand, which means that the competition is already present in the market, and a new competitor who wants to enter the market looks for locations to deploy its facility in the presence of competitors. The problem is modeled in binary and partial binary models and solved by the proposed algorithm.

In Beresnevs article (2013), the problem of competitive location–allocation is considered with a bi-level concept. In their paper, each of the Leaders and Followers wants to maximize their profit. To solve this problem, a local search and a branch-and-bound method based on the bi-level concept are used.

In Qi et al. article (2017), the problem of competitive facility location with foresight has been modeled as a bi-level programming problem. In the mentioned research, unlike the classic model this paper considers a new kind of customer behavior in which the customers only patronize facilities within a range they feel is convenient. To solve this model, a two-stage hybrid Tabusearch is used.

In Beresnev and Melnikov article (2018), the researchers have modeled a capacitated competitive facility location problem between two parties, namely, Leader and Follower, trying to maximize their profits by servicing customers. The capacity is considered finite, and the problem here is to decide where each of the parties opens their facilities and how to assign them to service the assigned customers so that capacity constraints are satisfied. In the mentioned research, the Leaders problem is formulated as an optimistic bi-level mixed-integer programming problem; it is shown that it can be considered as a problem to maximize a pseudo-Boolean function. In order to find an optimal solution for this problem, they have considered a branch-and-bound algorithm where an estimating problem is utilized to calculate an upper bound for the objective function.

Nasiri et al. (2018) have introduced the capacitated competitive facility location problem; they have claimed that limitation in the capacity of facilities makes it more compatible with the real-world situation and the possibility that some of the customers do not get serviced increases the complexity of the problem. In order to solve and find a near optimal solution for this problem, they have developed two algorithms, GA and PSO. The results show that it is better for each of the Leaders and Followers to consider the competition present in the market; in case of ignoring, the profit for both of the Leader and Follower decreases significantly.

The problem discussed in this article is a competitive facility location–allocation problem modeled as a binary bi-level programming problem. In this article, each of the competitors, namely, Leader and Follower, tends to optimize their market share. In this paper, the customer preferences concept based on distance has been used. A clustering algorithm has been used to obtain an efficient initial solution. Full enumeration methods and a branch-and-bound procedure have been introduced for obtaining an exact solution for the binary bi-level location–allocation problem (Table 1).

Table 1 Literature review

The main contributions of this research are: linearizing the nonlinear model presented in the literature. Using the clustering-based algorithms in order to solve the bi-level location–allocation problem in large-sized problems and also using the exact algorithms and enumeration procedures to solve the small- and medium-sized problems, respectively, in the bi-level location–allocation problem.

Bi-level location–allocation problem

The model presented in this section is a binary nonlinear bi-level programming problem. Bi-level programming problems can be modeled in different states; the bi-level programming problem involves two objective functions, which can have different states depending on the form of the function of the upper and lower levels. The simplest form of the bi-level programming problem is when both of the objective functions are linear, but still, the linear–linear form of the bi-level programming problem is NP-hard (Hansen et al. 1992; Ostresh 1975).

The bi-level programming problem can be modeled in different types with respect to being linear, nonlinear and quadratic. Bi-level programming problems are very sensitive to constraints, so adding even a single constraint in the second-level can completely change the solution space. As indicated, the model presented in this paper is a nonlinear integer programming model that the basic concept of the model is taken from Beresnev (2013) and with the help of three constraints which will be described below; we have been able to linearize the nonlinearity of the model. Thus, as known, solving a linear model is much more efficient and reliable than solving nonlinear models. Followings are assumptions for the considered problem:

  1. 1.

    Each of the customers present in the market has a specific purchasing power, and no customer is earmarked for any facility.

  2. 2.

    A number of candidate points are considered for the location of new centers.

  3. 3.

    There are no centers of Leader or Follower present in the market.

  4. 4.

    The establishment of each new facility in the market is subject to the payment of fixed costs, both for the Leader and for the Follower.

  5. 5.

    There is no possibility of changing position and displacement for either Leader or Follower.

  6. 6.

    In this study, there are n demand points (customers) with the index j = 1,2, ..., n and m candidate points for the establishment of new centers with the index i = 1,2, ..., m.

  7. 7.

    The attractiveness of a center for a customer has a reverse ratio with distance. The nearest facility gets the highest rank, and the furthest facility gets the lowest rank.

Parameters considered in this problem are as follows:

\(f_i\)::

is the fixed cost for locating Leader’s facility in i.

\(g_i\)::

is the fixed cost for locating Follower’s facility in i.

\(p_{ij}\)::

is the profit of serving customer j with facility i.

\(r_{ij}\)::

is the rank that customer j gives to the facility i.

Decision variables considered in this problem are as follows:

\(x_i\)::

is 1 if Leader locates its facility at i and 0, otherwise.

\(x_{ij}\)::

is 1 if customer j is allocated to facility i located by the Leader and 0, otherwise.

\(z_i\)::

is 1 if Follower locates its facility at i and 0, otherwise.

\(z_{ij}\)::

is 1 if customer j is allocated to facility i located by the Follower and 0, otherwise.

Assume that facility i can be opened by both Leader and Follower. Therefore, for every i we assume \(f_i\) and \(g_i\) as the fixed cost for opening facility i by the Leader and the Follower, respectively. If for some reason the Leader or the Follower cannot open facility i, then we put \(f_i\) or \(g_i\) infinite.

Model 1: Nonlinear model

$$\begin{aligned}&{\max _{{x_i},{x_{ij}}}}\left\{ { - \sum \limits _{i \in I} {{f_i}} {x_i} + \sum \limits _{j \in J} {\left( {\sum \limits _{i \in I} {{p_{ij}}{x_{ij}}} } \right) } \left( {1 - \sum \limits _{i \in I} {{z_{ij}}} } \right) } \right\} \end{aligned}$$
(1)
$$\begin{aligned}&{x_i} + \sum \limits _{k:i{ > _j}k} {{x_{kj}} \le 1} \quad \quad i \in I,j \in J \end{aligned}$$
(2)
$$\begin{aligned}&{x_{ij}} \le {x_i} \quad \quad i \in I,j \in J \end{aligned}$$
(3)
$$\begin{aligned}&{\max _{{z_i},{z_{ij}}}}\left\{ - \sum \limits _{i \in I} {{g_i}{z_i}} + \sum \limits _{(i,j)} {{p_{ij}}{z_{ij}}}\right\} \end{aligned}$$
(4)
$$\begin{aligned}&{x_i} + \sum \limits _{k:i{ \ge _j}k} {{z_{kj}}} \le 1 \quad \quad i \in I,j \in J \end{aligned}$$
(5)
$$\begin{aligned}&{z_{ij}} \le {z_i} \quad \quad i \in I,j \in J \end{aligned}$$
(6)
$$\begin{aligned}&{x_i},{x_{ij}},{z_i},{z_{ij}} \in \{ 0,1\} \end{aligned}$$
(7)

The model presented above is the bi-level location–allocation problem; in the illustrated model, the first level or Leader controls the decision variables \(x_i\) and \(x_{ij}\), and on the other side, the Follower controls the decision variables \(z_i\) and \(z_{ij}\). As can be seen, Eq. 1 shows the Leaders objective function that seeks to maximize its profit.

Equation 2 shows that the customer is attracted to the Leaders facility i if and only if the attractiveness of the center i is more attractive than other centers set up by the Leader, and if the attraction of the center is desired, it will be served by that facility; otherwise, it will be served by the other facilities opened by the Leader. In this equation, \({{k:i{ > _j}k}}\) means that out of two open facilities i and k, customer j prefers facility i with higher rank.

Equation 3 shows that the jth customer service can only occur when the ith center is deployed by the Leader. Equation 4 shows the Follower’s objective function trying to maximize his/her profit. Equation 5 shows that if a Leader deploys his/her location in i, the Follower will be attracted to the Follower’s facility if and only if the attractiveness of the center set by the Follower is greater than the degree of attractiveness deployed by the Leader; otherwise, if the amount of the attractiveness of the center set up by the Leader is greater or equal to the amount of attractiveness of the center set up by the Follower, then customer j will be attracted to the Leader’s facility i. In this equation, \({{k:i{ \ge _j}k}}\) means that out of two open facilities i and k, even in case of equal attraction, customer j prefers facility i.

Equation 6 shows that customer j can be serviced by the Follower only when the center i is deployed by the Follower. Equation 7 also shows that all the decision variables in this model are binary. The model presented above is an integer nonlinear programming problem regarded as an NP-hard model in the literature. NLP’s are not easy to solve, and the solutions are not completely reliable; in order to solve these optimization models easier in operations management, we try to linearize them. The reason for the nonlinearity of the model presented above is the nonlinear term in the Leader’s objective function.

The model presented below is the linearized form of Model (1), presented as Model (2). The linearization has been done using three equations: Eqs. 1314 and 15. Equation 13 shows that if a facility is located in location i, customers located in that area will be attracted to that facility if the attraction of that facility is more than the other facilities located by the Follower. Equation 14 shows that if the Follower establishes his/her own facility in center i, the customers located at i will only be attracted to the Followers facility if the attraction of the Followers facility is more than the attraction of the Leaders facility. Equation 15 shows that any customer must be served by at least one of the Leaders or Followers. These three constraints, while maintaining the main conditions of the original model, make the model turn into a linear model which helps to solve the model in a reasonable time. For this particular model, this claim has been shown by solving multiple problems with different sizes, and equal solutions have been obtained.

Model 2: Linearized model

$$\begin{aligned}&{\max _{{x_i},{x_{ij}}}} - \sum \limits _{i \in I} {{f_i}} {x_i} + \sum \limits _{(i,j)} {{p_{ij}}{x_{ij}}} \end{aligned}$$
(8)
$$\begin{aligned}&{x_i} + \sum \limits _{k:i{ > _j}k} {{x_{ij}} \le 1} \quad \quad i \in I,j \in J \end{aligned}$$
(9)
$$\begin{aligned}&{x_{ij}} \le {x_i}\quad \quad i \in I,j \in J \end{aligned}$$
(10)
$$\begin{aligned}&{\max _{{z_i},{z_{ij}}}}\left\{ - \sum \limits _{i \in I} {{g_i}{z_i}} + \sum \limits _{(i,j)} {{p_{ij}}{z_{ij}}}\right\} \end{aligned}$$
(11)
$$\begin{aligned}&{x_i} + \sum \limits _{k:i{ \ge _j}k} {{z_{kj}}} \le 1\quad \quad i \in I,j \in J \end{aligned}$$
(12)
$$\begin{aligned}&{z_i} + \sum \limits _{k:i{ > _j}k} {{z_{kj}}} \le 1\quad \quad i \in I,j \in J \end{aligned}$$
(13)
$$\begin{aligned}&{z_i} + \sum \limits _{k:i{ > _j}k} {{x_{kj}}} \le 1\quad \quad i \in I,j \in J \end{aligned}$$
(14)
$$\begin{aligned}&\sum \limits _{i \in I} {{x_{ij}} + {z_{ij}}} = 1\quad \quad j \in J \end{aligned}$$
(15)
$$\begin{aligned}&{z_{ij}} \le {z_i}\quad \quad i \in I,j \in J \end{aligned}$$
(16)
$$\begin{aligned}&{x_i},{x_{ij}},{z_i},{z_{ij}} \in \{ 0,1\} \end{aligned}$$
(17)

Full enumeration methods

The simplest model of the bi-level programming which is the linear–linear bi-level programming problem is also NP-hard (Hansen et al. 1992; Ostresh 1975), so it is not simple to find the optimal solution and the exact solution in a short time, and we need to use algorithms such as branch and bound, branch and cut. Now, if one can find an initial solution or a suitable lower bound (a good approximation) for these algorithms, the search process will become much faster. The proposed bi-level model is solved using full enumeration methods, clustering (which provides a good initial response) and a branch-and-bound procedure. The pseudo-code for each of these algorithms is explained in the next sections.

The basis of the algorithms used for solving the bi-level programming problem is that the priority to take the first decision (action) is given to the Leader, the Leader, by looking at its objective function takes the best possible choice, based on this decision, the Follower takes its decision trying to optimize its objective function, given that, in this article our problem is a binary bi-level programming problem, the basis used for the full enumeration is that in a number of loops (the number of loops is the number of candidate locations for deployment), all possible states for the deployment of the Leader are examined; then, through all these points, the point which has the best objective function is chosen by the Leader. As illustrated below, for solving the binary bi-level location–allocation problem, three full enumeration procedures have been presented. These three full enumeration algorithms have a distinguished difference. The difference is that the first algorithm (FE1) is considered only the Leader location to be fixed in the Follower model, while the second method (FE2) considers both location and allocation variables of the Leader in the Follower model. It should be mentioned that the (FE3) procedure empowers the FE1 algorithm by removing some feasible and infeasible solutions, so it can reduce the computational time significantly.

Algorithm 1: Full Enumeration 1 procedure (FE1)

  • Step 0: The Leader’s decision for locating a facility is a binary variable. As a result, all possible states for the Leader’s location can be calculated.

  • Step 1: Put the value of the Leader’s solution in step 0 in the Follower’s model, and the value of the Follower’s decision variables (\(z_i\) and \(z_{ij}\)) can be obtained (X, Z), which is a feasible solution to the problem.

  • Step 2: Among all the solutions, the solution that has the best value of the Leader’s objective function is considered as the optimal solution.

Algorithm 2: Full Enumeration 2 procedure (FE2)

  • Step 0: The Leader’s decision for locating a facility and for allocating customers is binary variables. As a result, all possible states for the Leader’s location and allocation can be calculated.

  • Step 1: Put the value of the Leader’s solution in step 0 in the Follower’s model, and the value of the Follower’s decision variables (\(z_i\) and \(z_{ij}\)) can be obtained (X, Z), which is a feasible solution to the problem.

  • Step 2: Among all the solutions, the solution that has the best value of the Leader’s objective function is considered as the optimal solution.

Algorithm 3: Full Enumeration 3 procedure (FE3)

  • Step 0: The Leader’s decision variable is binary. As a result, you can calculate all possible states for the Leader’s location.

  • Step 1: If the number of center(s) built by the Leader is less than q center(s) (\({\sum x _i} \le q\) ), consider that solution. Otherwise, delete that solution. (Assuming that there is no competitor in the market, q is the maximum number of facilities that a Leader can build without facing any disadvantages or loss).

  • Step 2: Among all the solutions, the solution that has the best value of the Leader’s objective function is considered as the optimal solution.

Finding a feasible solution using clustering algorithm

Given that the more customer is closer to the facility and the attractiveness of that facility is higher for the customer, the concept of clustering can be used to reduce the size of the problem in a way that locations which are closer to each other and relatively have similar characteristics are put in a cluster. Given the fact that in the bi-level problems, the first level decides first, depending on the decisions of the first-level decision maker, the second level decides and makes its decisions. As a result, among the points in a cluster, the first level (Leader) selects a place for deployment of its center(s) which is more attractive for the customers and also has a lower cost for deployment.

Algorithm 4: Clustering procedure

  • Step 0: Enter the coordinates of the candidate locations as inputs and go to the next step.

  • Step 1: Make the distance matrix (Euclidian) and go to the next step.

  • Step 2: Based on the distance criterion, rank each candidate location. Rank the closest facility 1 and so on till the last facility. Rate all points and go to the next step.

  • Step 3: Considering the cost of deployment in i and the acquired profit from it, find the maximum number of possible deployments for the Leader without facing any disadvantages or loss and set to P and go to the next step.

  • Step 4: Cluster the candidate points to 1,2, ..., p and go to the next step.

  • Step 5: Get the centers of each cluster (for example, in the 7 cluster mode, get the centers for each of the seven clusters) among the candidate points; the point with the lowest distance to the center of the cluster is set as the location of the Leader’s facility. Take the next step.

  • Step 6: Repeat step 5 for all clusters and get the Leader’s location for each of the clusters.

  • Step 7: Calculate the value of the objective function for the solutions given in step 6, and the solution with the best value of the Leader’s objective function is considered as the Leader’s center.

  • Step 8: Fix the solutions found at step 7 in the Leader’s model and solve the Follower’s model, good initial solution is obtained.

Branch-and-bound procedure

One of the procedures for solving IP problems in an exact manner is solving them using algorithms like branch-and-bound, branch and cut, dynamic programming algorithm. To the best of our knowledge, one of the most commonly used algorithms for solving the Bi-level programming problems as mentioned in the literature is the branch-and-bound algorithm. The main concept of the branch-and-bound algorithm used in this paper is taken from Hocking (2004), which has shown that this algorithm reaches the optimal solution in an absolutely efficient and acceptable time. A branch-and-bound procedure has been presented in this paper to solve the binary Bi-level location–allocation problem. The main feature of the proposed branch-and-bound algorithm, compared to the classical branch-and-bound scheme, is it is not necessary to optimize the model after each branch and an approximation is used; thus, compared to the classical branch-and-bound scheme, the computational time is lower. The pseudo-code for the branch-and-bound algorithm explained above is presented below:

Algorithm 5: Branch-and-bound procedure

  • Step 0: Enter the lower bound equal to infinite and the marginal of the location and allocation variables. In this problem, the marginal of the location and the allocation variables are the cost for locating the facility and the profit gained from allocating customers, respectively; note that costs and profits are represented as negative and positive numbers, respectively.

  • Step 1: Solve Model(1) without Eq. 4 by setting the Leader’s variables at binary and relaxing the Follower’s variables between 0 and 1, and maximizing the Leader’s objective function. Upper bound calculated in this step is an upper bound for the Leader.

  • Step 2: The upper bound calculated in step 1 is set at node 0 (the top most node), and the allocation variables are set to one and zero, respectively, like the general branch-and-bound scheme. In location–allocation problems, locating has a cost and allocating has profit so fathoming only becomes possible if the allocation variables are set to take value first in the branch and bound.

  • Step 3: Wherever the value of a variable is fixed to one, the marginal value of that variable is added to the upper bound, and wherever the variable is fixed to zero, no value is added. In each level, the best value is selected to continue the branching (best first procedure).

  • Step 4: Step 3 is continued until the last level is reached and the upper bound is calculated. The variables that have been fixed are the Leader’s action. These variables are fixed in the model explained in step 1 and the Followers objective function is maximized and the Followers variables are executed from the model. This solution is a lower bound for the model.

  • Step 5: Calculate all the nodes and any node having a worse lower bound than the best lower bound found will be fathomed. The best lower bound found will be the solution to the problem.

As explained above, the algorithm used in this paper is based on the first allocation and then location concept, meaning that the first branches are made on allocation variables (positive sign variables) and then location variables (negative sign variables). The reason is the sign of marginals of the variables, because if the branching starts with the negative sign variables, the fathoming would not be possible, but if the branching starts with the positive sign variables, only at the start of the branching for the negative variables the fathoming would be possible, but fathoming by infeasibility is still possible for both explained procedures.

Sensitivity analysis and numerical examples

In this research, some instances with different sizes have been used in order to analyze the algorithms and to test the validity of the transformed model in a linear form. The instances were adopted based on the reported dataset in http://www.math.nsc.ru/AP/benchmarks/S.

Linear model validity

In order to verify the validity of the linearized model presented as Model (1), various sizes of instance introduced have been solved. The remarkable points of this analysis are (1) the nonlinear model gets stuck in the local optimal; thus, solving it using the linear model obtains the optimal solution. (2) The linear model is solved at the average of at least 50% faster than the nonlinear model (Fig. 2 and Table 2).

Table 2 Linear model validity
Fig. 2
figure 2

Efficiency of linear model

As shown in Table 2 and Fig. 3, our claim has been proved and the linear model while containing the optimal solution solves the model at the average of at least 50% faster.

Comparison of branch and bound with FE1 and FE2

The easiest and of course the most overwhelming way to solve a bi-level programming problem is solving it using the full enumeration methods mentioned in the literature, but as mentioned, even for the small-sized problems it takes a lot of time to solve that is why researchers in the literature have tried to solve these types of problems using any of the exact and efficient algorithms like branch and bound and branch and cut. In order to solve the bi-level location–allocation problem using any of these, they need to be modified and the aspects and features of the problem have to be considered, and also exact inequalities, bounding and fathoming must be applied; thus, the branch-and-bound procedure introduced above in this paper is examined and compared with FE1 and FE2. As shown in Table 3 and Fig. 3, as the number of candidate location increases, even though the number of variables solved by the proposed branch-and-bound/FE2 algorithm decreases compared to the FE1 procedure, the growth rate for the number of integer problems that need to be solved by the branch-and-bound/FE2 algorithm increases more than the FE1 approach; thus, it is intelligible that the FE1 method compared to the proposed branch and bound/FE2 is more efficient.

Table 3 Comparison of branch and bound with FE1 and FE2
Fig. 3
figure 3

Comparison of the number of variables and the time the problem solves between branch-and-bound and FE1 procedures

Comparison of FE1 and FE3 method

As shown in Table 4, solving this problem becomes much overwhelming as the size increases, but by using the FE3 procedure not only it gives the same optimal solution but reduces the solution time by the average of at least 20%. In Table  4, Leader’s objective function and Follower’s objective function are presented as LOF and FOF, respectively. As shown in Tables 3 and 4, for small- and medium-sized problems the FE3 procedure has been better than FE1, FE2 and the branch-and-bound procedure. With a glance at Fig. 4, it could be understood that by increase in the number of candidate locations, the difference between solution time for the FE1 procedure and solution time for the FE3 procedure increases, considering that both reach the optimal solution. Thus, it could be understood that using the FE3 procedure for these types of problems is more efficient.

Table 4 Comparison of FE1 and FE3 method
Fig. 4
figure 4

Solution time comparison for FE1 and FE3 procedures

Clustering and FE3 method comparison

As shown in Table 5, by increase in the size of the problem, the clustering procedure gives a reliable and a good feasible solution at a very short time (less than one second); thus, it is better to use the clustering procedure for big size problems. The feasible solution found by clustering procedure could be used as a lower bound on other exact algorithms like branch and bound and even as an initial solution for the bi-level meta-heuristic procedures (Fig. 5).

Table 5 Comparison of FE3 and clustering method
Fig. 5
figure 5

Solution time for the FE3 procedure

Conclusion

In this paper, a nonlinear bi-level location–allocation problem considered in the literature was linearized, and to solve the problem, four exact procedures and a good heuristic procedure were proposed and analyzed. Exact solution approaches include three full enumeration-based algorithms as well as a branch-and-bound-based solution algorithm. The proposed heuristic algorithm is based on the clustering method. The mathematical model for the problem has been presented in both nonlinear and the linear forms, and it is shown that the linearization has been very efficient. Considering achieved results from the computational study, it is demonstrated that in comparison of FE1 and FE2 procedure with the branch-and-bound method, the FE1 is more efficient; thus, in the following, FE1 procedure is compared with the FE3 procedure and the FE3 procedure solves the instances at least 20% faster. Considering these comparisons, it is notable that for small- and medium-sized problems it is better to use the FE3 algorithm which gives an exact solution in an acceptable time. By these explanations, it is tangible that in order to solve large-sized problems, there are two options left: the FE3 and the heuristic procedure; thus, the FE3 and the clustering procedure are compared, and following the results, it is more efficient to solve large-sized instances of bi-level location–allocation problems with clustering method which results in a good efficient solution with good convergence rate in a very short time, so it could be concluded that for every small- and medium-sized instance, the FE3 procedure gives an exact solution in an acceptable time and for large-sized problems it is better to use the clustering procedure. As a matter of future research, it is recommended to: (1) improve the branch-and-bound algorithm by using the clustering solution as a lower bound, (2) use the solution of the clustering algorithm as an initial solution for the bi-level meta-heuristic procedures and (3) use customer preferences other than the distance preference.