An Algorithm for Solving Generalized Single Row Facility Layout Problem

Layout design problem is to determine a suitable arrangement for the departments so that the total costs associated with the flow among departments become least. Single Row Facility Layout Problem, SRFLP, is one of the layout problems that have many practical applications. This problem and its specific scenarios are often used to model many of the raised issues in the field of facility location. SRFLP is an arrangement of n departments with a specified length in a straight line so that the sum of the weighted distances between the pairs of departments is minimized. This problem is NP-hard. In this paper, first, a lower bound for a special case of SRFLP is presented. Then, a general case of SRFLP is presented in which some new and real assumptions are added to generate more practical model. Then a lower bound, as well as an algorithm, is proposed for solving the model. Experimental results on some instances in literature show the efficiency of our algorithm.


Introduction
Layout design problem is to determine a suitable arrangement for the departments so that the total cost associated with the flow among departments becomes least. One of common layout problems is Single Row Facility Layout Problem (SRFLP). SRFLP was widely studied until the mid-nineties. Then, about the first years of the last decade, again an extensive research began in this field. Interestingly, research on many aspects of this problem is still open. SRFLP is a highly regarded problem in the field of facility layout   [1]. SRFLP can be defined as follows: The main goal is to determine the arrange-ment of rectangular departments with the same height along a straight line such that the total cost of relations between departments is minimized. The cost of the relationship between a pair of departments is proportional to the flow rate and the distance between the two departments center. The number of departments in this problem is known as SRFLP's size (Simmons, 1969) [2].
It is proved that SRFLP is an NP-complete problem (Suresh & Sahu, 1993) [3]. So it is almost impossible to find optimal solution in large-sized instances in a reasonable time. Thus, efforts to obtain near-optimal solutions or remodeling the problem has attracted lots of attentions. SRFLP's model is known as ABSMODEL and was introduced by Heragu and Kusiak (1991) [4].
The next section of this paper is a short literature review of SRFLP and its solution procedures. A special case of the model and its lower bound are discussed in the Section 3. In Section 4, a Cuckoo Optimization Algorithm for solving an extension of SRFLP is proposed. The experimental results are reported in Section 5. Finally, discussion, conclusion and some suggestions for future research are presented in the following sections.

Literature Review
SRFLP was first presented by Simmons entitled "one-dimensional space allocation problem". (Simmons, 1969) [2]. It is associated with large classes of problems. For these problems, many exact and heuristic approaches have been proposed. Some of these problems are related to each other. Some of these problems including SAP 1 and GLOP 2 have been mentioned in   [1]. In addition to these issues, the Quadratic Assignment Problem (QAP) is very similar to SRFLP. The objective function of QAP can be stated as:  . This is called Koopmans and Beckmann form of QAP (Koopmans & Beckmann, 1957) [5]. In a typical example of QAP, there are n departments and also n certain locations. There is a given amount of flow between each pair of departments i and j, namely ij a in Equation (1). For each pair of departments i and j, ( ) ( ) represents the distance between them. The communication cost of each pair of departments is equal to the product of flow and distance between them. The goal is to assign each department to a location so that the total cost of communications between departments is minimal (Picard & Queyranne, 1981) [6]. The main difference of QAP and SRFLP is that distances between locations are known in QAP, but in SRFLP is unknown due to uncertainty about the locations of the departments.
The graph bandwidth minimization is also a special case of the single-row layout problem. This is a graph in which each edge has been assigned a number as a weight of the edge and there is a specific mathematical function that assigns each vertex a certain value. The weight of each edge is the same as the amount of the flow between departments. In this case, the absolute value of the difference between two vertices labels is in accordance with the related departments distance. This problem is listed as one of the famous problems in graph theory and various algorithms have been developed to solve it.

SRFLP's Mathematical Models
Several different models for SRFLP has been proposed in previous studies. The first mathematical model was developed by Picard and Queyranne, (1981) [6]. In their paper, for the first time, it was quite clearly stated that any solution of SRFLP is, in fact, a permutation of the departments set. They used π π π π = as a permutation of departments indices. The inverse of this permutation: is the position of department i in the permutation π and ( ) , , B i j π is the set of indices of departments between i and j. The main goal of the model is to find the location of each department somehow to minimize the total weighted flow among departments calculated as follows: The above constraint is illustrated in Figure 1. Love & Wong (1976) [7] presented the first binary mixed integer program to solve SRFLP. Later, a quadratic model was presented by Kumar, Hadjinicola, and Lin (1995) [8]. A new MIP model for SRFLP was also presented by Amaral (2006) [9]. In this model, additional variables ij α were used. If department i is located left of the department j, then ij α is one. Otherwise, it is zero.
Another model of SRFLP was presented by Amaral (2009) [10]. In this model a three-dimensional variable ijk ζ was defined. The variable ijk ζ is one if department k lies between departments i and j and otherwise its value is zero. A complete review of presented models in the literature have been provided by Kothari and Ghosh (2012d) [1] and Keller and Buscher (2015) [11].

Solution Procedure
The exact methods for solving SRFLP, especially when n is big, are difficult and require a lot of computer memory. These methods are not able to solve largescale problems in a reasonable time. Exact method proposed so far includes branch and bound strategies (Simmons, 1969) [2], branch and cut strategies (André RS Amaral & Letchford, 2013) [12], cutting plane (André RS Amaral, 2009) [10], (Yen, 2008) [13], dynamic programming (Picard & Queyranne, 1981) [6] and semi-definite programming (Anjos, Kennings, & Vannelli, 2005;Anjos & Vannelli, 2008;Yen, 2008) [13] [14] [15]. The most efficient codes developed in literature was based on MIP model provided in 2008 that was able to solve SRFLP up to size 18 (Andre RS   [16]. In 2013, a significant improvement on the original codes was provided by Amaral and Letchford (2013) [12]. By proposing an algorithm based on branch and cut, solving time was also improved. In this method, problems up to size 30 departments were solved in reasonable time. Also, this algorithm presented a better upper and lower bounds on the main node. The algorithm was applied to three SRFLP with 110 departments and found that the gap between the lower and upper bounds on the running time of less than 2.5 days, was 3% to 4%.
Given that the SRFLP's exact algorithms are of high costs, researchers use heuristic methods to solve large size SRFLP. These heuristic algorithms are much faster than exact algorithms, but there is no guarantee that the optimal solution to the problem is found. Different algorithms presented in the literature are all trying to find near optimal solution in the least amount of time, and they differ in the type and structure of algorithm, such as being construction or improvement heuristic, the initial steps, search method of the feasible region, searching in a discrete or continuous space and stopping criteria.
All research on this topic was in a deterministic space until that Azadeh et al.
(2011) [17] considered the input data uncertain and presented a fuzzy multivariate approach for facility layout design with ambiguity. Rubio-Sánchez, et al.
(2016) [18] proposed an algorithm based on greedy randomized adaptive search procedure combined with path relinking to have a highly efficient search and stated that the proposed method outperformed all state-of-the-art methods until 2016. The exact and heuristic solutions that have been proposed to solve this problem are summarized in Table 1.

Single Row Equidistant Facility Layout Problem
Consider the SRFLP and suppose that all departments' length is the same, for example with constant length l and the flow between each two departments is an arbitrary number. This problem is called Single Row Equidistant Facility Layout Problem, SREFLP (Hungerländer, 2014) [58]. Without loss of generality, it is assumed that the department in the leftmost location is labeled by index 1 and the last department with the rightmost location is labeled with index n (number of departments). According to the new numbering, distance matrix of departments is shown in the below matrix.
Since the distance matrix is calculated based on the center to center, adjacent departments have the distance l. The distance between every other one departments is equal to 2l and so on. In this case, the problem will be finding the indices corresponding to the departments. Clearly, the optimal solution or the final layout of departments is not related to the length of departments. Note that the distance matrix between departments with a primary index (unchanged) will be a permutation of the above matrix. Now suppose that the matrix product of the flow matrix and the distance matrix is calculated. The sum of the values of the diagonal of the resulted matrix is equal to the objective function value. Let E be the matrix product of these two matrices (E = C × D). The sum of diagonal values of matrix E is calculated as follows: (note that C is a symmetric matrix and According to the SRFLP's definition, the right amount of Equation (2) is twice the amount of the objective function. The sum of the values of the diagonal of a matrix A is called the matrix trace and denoted by ( ) It is clear that the new flow matrix can be generated by arranging the rows and columns of the first flow matrix. Thus, this scenario of SRFLP can be described as finding the best permutation matrix which leads us to the smallest value of the trace of the matrix product of new distance matrix and the first flow matrix. In mathematical terms, the problem can be stated as min tr min tr = XCX D CX DX Here X is a permutation matrix which is unknown and should be find. In literature, this problem is called Quadric Assignment Problem (QAP) (Commander, 2005) [59].

SREFLP Lower Bound
Rendl and Wolkowicz, (1992) [ , , , n µ µ µ are eigenvalues of matrix C and Matrix D arranged in descending and ascending order, respectively. Λ and Σ are defined as follows: Later on, it is proved in Lemma 1 that if CD equals to DC, U and V can be selected in such a way that T = P U V is a permutation matrix. With the mentioned distance matrix, in a case that C is a coefficient of D, CD equals to DC.
If CD is not equal to DC, T = P U V is not a permutation matrix, and, therefore, it can be considered as a lower bound for the optimal solution. In this case − CD DC can be considered as an index for measuring the gap of the lower bound.
Suppose C = αD where D is a coefficient of C, therefore, U = V. For optimum permutation matrix: Thus, the exact solution of this version of SRFLP is achieved by replacing identity matrix for permutation matrix P. Note that, as it was mentioned in previous section, we have supposed that C is symmetric matrix and if it is not symmetric, for each element ij C the average value of ij C and ji C should be replaced. For every QAP scenario when C (after changing C to become symmetric) is a coefficient of D, the exact solution is known.
Example 1: Consider 5 departments with the same 4 meters length. Consider the flow matrix between departments as C.
Because the lengths of all departments are the same, the distance matrix is not related to the matrices arrangement. The distance matrix D is: American Journal of Operations Research Here, C is not symmetric and for each element ij C , the average value of ij C and ji C can be replaced. After doing the calculations, C changes to: As it can be seen, C is a coefficient of D with α = 0.5 and the best solution of this problem is shown in Figure 2. ( ) For matrix product of D and C, it can be stated that: ( ) Because P is a permutation matrix, it can be concluded that X is a diagonal matrix. Also, Λ is a diagonal matrix. In product of matrices, two adjacent diagonal matrices can be replaced by each other. Therefore, if P is a permutation matrix, then CD equals to DC.

Generalized Single Row Facility Layout Problem
The problem presented in this study is Generalized Single Row Facility Layout Problem (or GSRFLP). In SRFLP, each solution shows the sequence of locations of departments without considering cost factor. However, in real-world, the construction cost of a department can be different when the location is changed. On the other hand, the adjacency of two departments can be problematic. For example, the risk of fire or toxic gases produced in a department can be increased based on safety reason. In some situations, the minimum or maximum distance of two certain departments is pre-determined. Furthermore, in some cases, it may be necessary that two departments are located within a certain distance due to the shared resources allocate. The main difference of GSRFLP with SRFLP is consideration of departments' construction cost and safety factor. In this case, the cost of department construction is entered as a parameter through a matrix. The exact definition of the proposed GSRFLP is as follows: The goal is to determine the arrangement of rectangular departments with almost the same height along a straight line such that the total cost is minimized. Every two separate departments are related to each other. The relation between two departments is to move materials from one department to another and is calculated according to the distance between two departments. The cost of the relation between two departments is dependent on the distance between the two departments and the flow rate between them. The flow between two departments is defined as the number of times the materials between two departments is transferred.
In real-world cases, sometimes due to safety concerns, two departments should not be adjacent. Thus security factor is defined between each pair of departments. This parameter is imported as an input data through a matrix. Safety parameter ij b is defined between two departments i and j. It is multiplied by the relation cost between two departments i and j. If adjacency of two departments doesn't have any problem this parameter value equals to one, otherwise, it is less than one. The construction cost of departments is a matrix and considered as an input data. Also, the minimum or maximum distance of each two departments is pre-determined if necessary. The total cost is the sum of construction and transportation costs between departments.
Given that GSRFLP is more complex than SRFLP and since SRFLP is NPcomplete (Suresh & Sahu, 1993) [3], GSRFLP is also NP-Complete. Thus, no polynomialy exact algorithm has presented yet to solve the problem in a reasonable time for large-sized problems. In this study, an algorithm is also presented for solving a large size GSRFLP in a reasonable time.

Constraints of the GSRFLP Model
There are some general constraints in the model such as the distance between departments, no overlapping of departments, and placement of the departments in the given space, derived from Love & Wong (1976) [7] as follows: In Figure 3, the distance between the two departments is shown as a function of the departments' endpoints.
Minimum or maximum distance constraints: If necessary, the restriction related to the minimum or maximum distance between the departments can be written through the following inequalities: The construction costs constraints: The matrix CO is the construction cost matrix. The parameter iy co is the construction cost of department i, if the department i locates on the point y. The variable iy δ is defined as a binary variable which equals one, if the department i locates on the point y. Therefore, the following logical expression must be modeled: Since ij c and ij b are defined as parameters of the model, the product of two matrices C and B, can be replaced by a new flow matrix.  [62]. The COA was inspired by the life of a bird, called cuckoo. Characteristics of some species of this bird in egg laying in the nests of other bird spices and breeding was the basic motivation for the development of this new evolutionary optimization algorithm. The host may recognize some cuckoo eggs and kill them or it may abandon the nest and build a new nest elsewhere. The rest eggs that are not identified by the host, are fed by it. After hatching from eggs and growing up, the mature cuckoos follow the lifestyle of their mothers and lay eggs in other birds' nests. Also, grown up cuckoo societies immigrate toward the regions with better access to foods (Rajabioun, 2011) [61]. The mechanism of egg laying and immigration in COA help find local and global optimal solution of the problem. After multiple iterations of the algorithm, the cuckoos inhabit in the place with the best access to foods. This place is the best founded solution of the problem. For applying COA for SRFLP, it is necessary that the concepts of eggs, nest, step, objective function and search space be specified in details. Following, these concepts are described.

Definitions
Here, there are some basic definitions used in COA.
Nest: The number of nests is constant and equals to the number of initial population. In SRFLP, each nest is a sequence of departments.
Eggs: In the proposed algorithm, it is assumed that in each nest (solution), cuckoo puts one or more eggs. An egg is a new solution. In other words, in SRFLP an egg is equivalent to a permutation of the departments. The aim is to replace not good solutions by better ones.
Objective function: Every solution in the search space is equivalent to a numeric value for the objective function. So the quality of a possible answer is proportional to the objective function value. In COA, nests with eggs having a lower value for the objective function, are leading to new generation of population. The cuckoo egg quality is proportional to its ability to create new cuckoo.
Search Space: In COA, the search space represents a potential nest. In the current problem, all possible permutations of departments are possible solutions to the problem. By changing a possible solution, creating another solution is possible. Searching the problem space is achieved by each step being carried out through consecutive changes in the solution called "laying".
Laying: The changes in the arrangement are determined by exchanging the locations of two randomly selected departments or two sequentially adjacent departments. To produce new solutions, steps length will be applied in accordance with the theory of Lévy flight (Yang & Deb, 2009) [62]. In the proposed algorithm, the step length is defined as the number of consecutive changes of the arrangement of departments.

Levy Flight
In nature, some insects, birds and many other animals follow paths that have been modeled using Levy flight. They can find and hunt their bait or food without planning ahead. In fact, they use Levy flight as a pattern for searching foods. A Levy flight is a complex set of random walks in which the step-lengths have a Levy distribution (Roy & Chaudhuri, 2013) [63]. In a Levy flight, most steps have a small length and the walk is within a small area, but longer routes are taken occasionally. In Equation (20), step length is presented in accordance with Levy flight distribution, where s is the step length and ( ) , Levy s λ is the probability of having step with length s. As it can be seen, by increasing the step length, the probability reduces. As it is shown in Equation (21), constant C is determined in a way that the sum of the probabilities equals to 1. The search in the problem space is done according to the Levy flight theory. As a result, chance of taking a longer step is lower compared to a shorter step.

Distance Matrix Calculation
Given the importance of algorithm runtime, generating the neighborhoods of a solution is done in a way that would require less time to calculate the new distance matrix. If the neighborhood of a solution is generated by moving two adjacent departments or two random departments, then there is no need to calculate the distance matrix from the beginning, and with some changes in the distance matrix of the solution, the new distance matrix can be obtained.
By changing two adjacent departments i and j, without loss of generality, if we assume that after changing the location, department i is at the right side of department j, new distance of department k with departments i and j is as follows: Also, new distance of department k with department k' is as follows: , and By changing two random departments i and j, it can be stated that after changing the locations, new distance of department k (k ≠ i and j) with departments i and j is as follows: Also, new distance of department k with department k', when only one of k and k' (k and k' ≠ i and j) is between departments i and j is as follows: When departments k and k' are between departments i and j, or they are at the right and left side of departments i and j or vice versa, and when they are both at the right or left side of departments i and j, it can be shown that:

Algorithm Steps
This section represents an efficient algorithm, Algorithm 1, based on COA for solving GSRFLP. After initializing the algorithm's parameters, the first step is to generate cuckoos' population. Then, the cuckoos start to search for other birds' nest to lay their eggs. They choose nests with less probability of having their eggs recognized by the host to increase the probability of surviving. So at the second step, each cuckoo lay certain eggs in the host nest. Laying is done by consecutive changes of departments' arrangement. Each change in the arrangement is considered as length of one. Thus a step with length s is equivalent to s consecutive changes of departments' arrangement.
The host bird may recognize some cuckoo eggs and then it will either abandon the nest or kill the cuckoos. If a nest is not appropriate, the cuckoos will be killed by the host by probability of 1 a p − . In this step, the quality of the solu-tions is evaluated and then decision is made by replacing the eggs in the nest. The survived cuckoo eggs will grow up and immigrate to new better nests. They will follow lifestyle of their mothers. These steps are done in algorithm until stopping criteria reached. The steps of the algorithm are shown in Table 2.

Parameters Initialization
To set parameter for our algorithm, Taguchi method was used. Therefore, first, with some experiments, acceptable intervals for parameters were defined and then, for each parameter, 4 levels were designed. These levels were, for initial population number, 6, 8, 10 and 12, for Levy flight parameter (λ), 1.5, 2, 2.5, and 3, for number of eggs of each cuckoo (E), 1, 2, 3, and 4, and for maximum step length, 1, 2, 3, and 4. L16 was used for the 4-level design. Then, for each sets of parameters, 10 runs run on a sample from Heragu and Kusiak (1991) [4] with 30 departments. The designed Taguchi experiment was analyzed using Minitab 16.2.4. The Results of Taguchi analysis is shown in Figure 4. As it can be seen in Figure 4, the best initial number of population, Levy flight parameter (λ), number of eggs of each cuckoo (E), and maximum step length, were 10, 2.5, 4, and 3, respectively. Note that, there was a very small difference between value 3 and 4, for Levy flight parameter. But by considering run time, this parameter value was considered 3.   Another necessary step to implement the proposed algorithm was defining the initial population.
The initial population was produced as below: • First population: Initially, a new hypothetical length for each department was calculated based on its actual length and its flow with other departments, Then, based on the new hypothetical length, taking into account a constant value for the flow between departments, the optimal solution of SRFLP with a constant value for the flow between departments, was considered as the initial population.
• Second population: First, two departments with the highest flow, ij c , were selected and placed next to each other. Then, among the other departments, department with the maximum flow with selected departments (sum of flow) was selected and placed in the best location. This step continued until all departments were selected. • Other solutions required for initial population, were randomly generated.
The last step was to set a suitable stopping criteria for the algorithm. Based on some experiments on the instance of Heragu and Kusiak (1991) [4] with 30 departments, it was considered as the minimum of 3000 algorithm runs or no change in the best answer in 100 consecutive runs.

The Computational Results
In this section, the performance of our approach on several sets of GSRFLP instances is reported. The tests have been carried out on a portable computer with Intel(R) Core(TM) i3-2357M CPU with processor speed of 1.3 GHz and memory of two GB of Ram on MATLAB R2016b version 9.1.0.441655.
The algorithm was tested on sets of SRFLP instances by  [14] with some modifications due to the difference between SRFLP and GSRFLP.
This set consists of four groups with instances of size 60, 70, 75 and 80 and each group consists five instances.
Each problem ran ten times and the best solution of runs is considered as the final solution. Information related to these problems including name of the problem, the problem size (number of departments), the best answer found so far, the answer of the proposed algorithm, the running time in seconds for proposed algorithm, the difference between the obtained solution and best solution so far in percentage, is presented as the columns of Table 3. It is seen that the solutions for all instances have under 0.1% gap with the optimal value. Also, for 19 instances out of 20 instances, the proposed algorithm is able to find the best solution with approximately 0.0% gap. The execution time seems to be significantly efficient for large instances compared to literature (Kothari & Ghosh, 2014b) [64].
In Figure 5, the horizontal axis shows the name of the problem and the vertical axis shows the gap between the best eight random solutions and the first initial population with the best known solution of the problem. Despite this fact that the proposed initial population does not guarantee the suitability of the objective function's value in general, there is not even one case that best random population objective function value has been lower than the initially proposed population's one. On average, the minimum distance of the objective function on a random solution is 42% more than the proposed layout for initial population. In 18 from 20 instances the first initial population had less than 10% gap and in 5 from 20 instances it had less than 5% gap with the best found solution. Figure 5. Comparison between best answer of proposed initial population with random population.

Discussion
Single Row Facility Layout Problem, SRFLP, is one of the most interesting problems in the field of facility layout and it has many practical applications. SRFLP is NP-hard problem. In this paper, First, a new version of this problem, called Single Row Equidistant Facility Layout Problem, was introduced and its lower bound was calculated theoretically by proving a lemma. Then, another version of this problem, called Generalized Single Row Facility Layout Problem (or GSRFLP), was also presented and its model was discussed. Moreover, a Cuckoo Optimization Algorithm for solving GSRFLP is proposed. The experimental results indicate that the proposed cuckoo algorithm is capable of solving SRFLP and reached to satisfactory solutions in an acceptable time for small and large size instances.
The highest gap between optimal solution and proposed algorithm solution is less than 0.1%. Also, it could improve the execution time for large size problems. The algorithm starts with a suitable population with average of 6.7% gap with optimal solution. In summary, three difficult models, their lower bounds and solution methods are discussed in this paper.

Conclusions and Future Research
In this paper, a lower bound, as well as an algorithm, are proposed for solving special classes of SRFLP. Computational experiments were also carried on large size sets of instances. As future work, the lower bound of SRFLP can be extended to the other types of row layout problems including double row layout problem and GSRFLP. Another additional future work is to study solving larger instances of SRFLP and other layout problems by exact algorithms. Finally, special type of SRFLP with equal length of departments (SREFLP) can be an interesting topic for future research. Given known distance matrix in SREFLP, there would be cases with predetermined solutions.