## Tabu Search Quadratic Assignment Problem Matlab Matrix

^{1}Faculty of Computing, Universiti Teknologi Malaysia (UTM), 81310 Johor Bahru, Johor, Malaysia^{2}School of Quantitative Sciences, UUM College of Arts and Sciences, Universiti Utara Malaysia, 06010 Sintok, Kedah, Malaysia^{3}Faculty of Information and Communication Technology, Universiti Teknikal Malaysia Melaka, Hang Tuah Jaya, 76100 Durian Tunggal, Melaka, Malaysia

Copyright © 2016 Wee Loon Lim et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

The quadratic assignment problem (QAP) is an NP-hard combinatorial optimization problem with a wide variety of applications. Biogeography-based optimization (BBO), a relatively new optimization technique based on the biogeography concept, uses the idea of migration strategy of species to derive algorithm for solving optimization problems. It has been shown that BBO provides performance on a par with other optimization methods. A classical BBO algorithm employs the mutation operator as its diversification strategy. However, this process will often ruin the quality of solutions in QAP. In this paper, we propose a hybrid technique to overcome the weakness of classical BBO algorithm to solve QAP, by replacing the mutation operator with a tabu search procedure. Our experiments using the benchmark instances from QAPLIB show that the proposed hybrid method is able to find good solutions for them within reasonable computational times. Out of 61 benchmark instances tested, the proposed method is able to obtain the best known solutions for 57 of them.

#### 1. Introduction

The quadratic assignment problem (QAP) belongs to the class of combinatorial optimization. This problem concerns assigning a number of facilities to the same number of locations, with the objective to find a way of assignment such that the total cost involved is minimized. The total cost of the QAP is the product of flow and distances between the facilities.

Sahni and Gonzalez [1] have shown that QAP is NP-hard. Therefore, unless , it is impossible to find optimal solutions in polynomial time. The complexity of QAP draws the interest of researchers worldwide over the past few decades. More than 300 papers have been published for the theory, applications, and solution techniques for the QAP [2]. Despite the extensive research done, QAP remains one of the most difficult combinatorial optimization problems. Generally, QAP instances with problem size 30 cannot be solved within reasonable computational times. In the literature, a lot of heuristic approaches to the QAP have been proposed. Some of the common methods are simulated annealing, tabu search (TS), genetic algorithm (GA), and ant colony optimization [3–10].

Among the exact methods for QAP, branch and bound (BB) algorithm is the most efficient [11, 12]. Currently, the largest instance solved by BB algorithm is of size 36 [4]. Solving QAP instances of size 20 was impossible before 1990s. It was until 1994 when Mautor and Roucairol [13] gave the exact solutions for nug16 and els19. The BB algorithm of Brixius and Anstreicher [14] solved the nug25 instance after 13 days of CPU time using sequential processing. The kra30a was solved by Hahn and Krarup [15] after 99 days of work with a sequential workstation. Nystrom [16] provided the exact solutions for the ste36b and ste36c after 200 days of work using a distributed environment. The nug30 remained unsolved until 2002 when Anstreicher et al. [17] reported the exact solution with seven days of work using 650 processors. Basically, the exact methods require much more computational resources and time than the heuristic algorithms. This is the reason we did not use exact methods in this study.

The QAP has a wide variety in the real-world applications with facility layout problem being the most popular applied area. These include campus planning, backboard wiring, hospital planning, zoning in a forest, and the placement of electronic components. Besides, the QAP is also used for typewriter keyboard design, development of control boards, turbine runner problem, ranking of archaeology data, scheduling of production lines analysis of chemical reactions, data analysis, economic problems, VLSI circuit and system design, website structure, and optimizing of Arabic keyboard design. Comprehensive review of QAP can be referred to in [2, 18].

Biogeography is a study of the geographical distribution of biological organisms. The science of biogeography can be referred to in the work of two naturalists in the nineteenth century named Wallace [19] and Darwin [20]. In the 1960s, MacArthur and Wilson [21] started to work on mathematical models of biogeography. Their study focused on the distribution of species among neighboring habitats and how species migrate from one habitat to another. However, it was until 2008 when Simon [22] presented a new optimization method based on it, namely, biogeography-based optimization (BBO). In his work, Simon applied BBO to the problem of sensor selection for aircraft engine health estimation and the performance of BBO is at a par with other population-based methods such as ant colony optimization, differential evolution, GA, and particle swarm optimization (PSO). The good performance of BBO on the sensor selection problem proves that it can be successfully applied to practical problems.

In his next paper, Simon [23] showed that BBO outperforms GA when both of them have a low mutation rate. Furthermore, BBO has shown a good performance when being applied to real-world optimization problems such as classification of satellite images, groundwater detection, and the solving of complex economic load dispatch [24–26].

The good performance of BBO on complex optimization problems inspired us to apply this iterative and population-based method to QAP. A classical BBO algorithm uses migration and mutation operators as its intensification and diversification strategy, respectively. During the iterated process of BBO algorithm, migration operator tends to improve every solution within the population while mutation operator increases the diversity among them. However, quite often the mutation operator will ruin the quality of solutions.

In order to overcome the weakness of mutation operator, we propose to replace it with a tabu search procedure. TS is a heuristic procedure for solving the optimization problems. A typical TS starts with defining a neighborhood, in which a given solution may move to and produce a new one. TS will evaluate each of the neighboring solutions and choose the move that improves the objective function the most. If there is no improving move, TS will choose one that weakens the objective function the least. The main difference of TS from other local search techniques is that it will use memory to store the recent moves. These moves are then forbidden and thus avoiding the search procedure to return to the local optimum just visited.

The characteristics of TS described above make it a suitable replacement for the mutation operator of classical BBO. Not only the diversity of the population is maintained but at the same time it prevents the quality of solutions within the population from being ruined. We choose to incorporate the robust tabu search (RTS) of Taillard [27] into our BBO algorithm for QAP because it is efficient and requires fewer parameters in its implementation.

In this paper, we propose a BBO algorithm hybridized with tabu search (BBOTS) for QAP. We apply it to the benchmark instances obtained from QAPLIB [28] with size ranging from 12 to 80. The experimental results demonstrate that the proposed algorithm outperforms the classical BBO algorithm with mutation operator. Our hybrid algorithm is able to solve most of the benchmark instances of QAP tested.

#### 2. Problem Definition

The QAP is an assignment model in which a set of facilities is supposed to be allocated to a set of locations, with each location having exactly one facility. The objective is to find a way of assignment such that the total cost involved is minimized. The total cost is calculated by multiplying the flow and the distances between facilities.

Let be the number of facilities and locations, given two matrices as follows:, where is the flow from facility to facility ;, where is the distance from location to location .The Koopmans-Beckmann [29] form of the QAP can be formulated as follows:where is the set of all permutations of the integers . Each product of is the cost for assigning facility to location and facility to location . There are several ways in mathematics to represent an assignment. Throughout this paper, we use the representation of assignment by permutation.

#### 3. Methods

In this section, we will first introduce BBO as general. This includes explaining the terminology used and its difference with another popular population-based optimization method, the GA. Next, we will explain the proposed algorithm in detail. We developed two BBO algorithms for QAP:(i)a classical BBO algorithm with mutation operator,(ii)a BBO algorithm hybridized with tabu search.Computational experiments were carried out to show the difference in performance between them. Note that the implementation of both algorithms is identical, except for the mutation step. Therefore, all the other steps of the algorithms are explained only once.

##### 3.1. Biogeography-Based Optimization

BBO is a new algorithm inspired by biogeography, which studies the geographical distribution of biological organisms. MacArthur and Wilson [21] worked together on the mathematical models of biogeography in the 1960s. They focused primarily on the distribution of species among neighboring habitats and how species migrate from one habitat to another. Since then, biogeography has become a major area of research. However, it was until 2008 when Simon [22] generalized it to obtain a general-purpose optimization algorithm.

Just like other biology-based algorithms, for example, GA and PSO, BBO is a population-based algorithm in which a population of candidate solutions is used in the searching procedure for global optima. BBO has certain common features with another popular optimization algorithm, the GA. In GA, an individual within the population is called a chromosome and has its own fitness value. Likewise in BBO, each individual is termed as a habitat and has its habitat suitability index (HSI) to evaluate its quality as a solution. Since we are dealing with a minimization problem, a low-HSI habitat represents a good solution and a high-HSI habitat is a poor solution instead. Each chromosome in GA consists of genes, while, for BBO, each habitat is characterized by Suitability Index Variables (SIVs). There are two main operators in GA, which are crossover and mutation. Meanwhile, in BBO, the main operators are migration and mutation. The migration operator consists of emigration and immigration. It is used to improve and evolve the habitats (solutions to the optimization problem) in the population. Solution features (SIVs) emigrate from low-HSI habitats (emigrating habitats) to high-HSI habitats (immigrating habitats). In other words, high-HSI habitats accept new features from low-HSI habitats through the immigration process. There are different alternatives for migration and mutation process of BBO. The way we implement these two operators are explained in detail in the later part. Table 1 compares the characteristics of BBO and GA.

**Table 1: **Comparison of characteristics for BBO and GA.

The classical BBO algorithm proposed by Simon [22] can be described with the algorithm in the following.

*A Classical BBO Algorithm*(1)Initialize the BBO parameters (this includes deriving a representation scheme for habitats, which is problems dependent, and also initializing the maximum migration rate, maximum mutation rate, and elitism parameter).(2)Initialize a random set of habitats, corresponding to the potential solutions.(3)Associate each habitat with immigration and emigration rate based on their HSI.(4)Probabilistically perform migration to modify each one-elite habitat. Then, recompute each HSI.(5)Associate each habitat with mutation rate based on their species count.(6)Probabilistically perform mutation to modify each nonelite habitat. Then, recompute each HSI.(7)Go to step (3) for the next iteration. Repeat until a predefined number of generations are reached, or after an acceptable solution is found.

##### 3.2. The Proposed Algorithm

###### 3.2.1. Representing Scheme of Habitats

As mention earlier, a habitat is represented by a permutation of integer , in which is the number of facilities and locations, that is, the problem size. For example, (2, 5, 1, 4, 3) is a possible habitat for an instance of QAP with problem size of 5. In this case, “2” of (2, 5, 1, 4, 3) means facility 1 is placed at location 2, and it is a SIV of this habitat. Likewise, “5” means facility 2 is placed at location 5 and so on.

###### 3.2.2. Initialization of the BBO Algorithm

The BBO algorithm starts with a population of randomly generated habitats. In our algorithm, a habitat is represented by a permutation of integers. A permutation is randomly generated and will only be inserted if it does not exist in the population yet. This is to avoid having duplicate habitats in the initial population and hence enhancing the diversity.

###### 3.2.3. Selection Strategy for Migration

In BBO, a good habitat (solution) is one with low HSI. Good habitats tend to share their features with poor habitat. This is done by migrating SIVs from emigrating habitats to immigrating habitats. In order to perform migration, we will first use immigration rates () of a habitat to decide whether to modify it, then we use emigration rates () of other habitats to decide which of them should migrate a SIV to the first habitat.

According to the biogeography, the SIVs of a good habitat (with low HSI) tend to emigrate to a poor habitat (with high HSI). Therefore, a good habitat has relatively high and low , while a poor solution has relatively low and high .

The immigration rate and the emigration rates are calculated with the following equations, respectively,

In the equations, represents the rank of a habitat after sorting them in accordance to their HSI. Habitats with high HSI (a poor solution) have lower rank while habitats with low HSI will have higher rank. In other words, the habitats are sorted from the worst to the best. In the equations, is the number of habitats in the population, while is the maximum immigration rate and the maximum emigration rate which are both usually set to 1.

Figure 1 illustrates the model for immigration and emigration rates [22]. In the figure, is a relatively poor solution, while is a relatively good solution. Although in the figure the immigration and emigration rate are considered linear, they can actually be replaced with curves in which better performance might be attained. In fact, Mussetta and Pirinoli [30] have shown that a variation of BBO with quadratic migration model and restart procedure outperforms the classical BBO when being applied to several benchmark functions. The selection strategy is summarized with the algorithm in Algorithm 1.

**Algorithm 1: **Selection strategy of migration operator.

**Figure 1: **Model for immigration and emigration rates.

###### 3.2.4. Selection Strategy for Mutation

In BBO, each habitat has an associated probability for them to exist as a solution to the given problem. The probability that whether mutation occurs in a habitat is called the mutation rate. To determine the mutation rate for each habitat, we must first evaluate the species count probability with the following equation:in which and are evaluated bywhere . The mutation rate is inversely proportional to the species count probability; therefore, we havewhere is the maximum mutation rate and the largest species count probability. The details on how to derive the above formulae can be referred to in [22].

###### 3.2.5. Migration Operator

As mentioned earlier, the SIVs from a good habitat tend to migrate into a poor habitat. This migration operator is performed probabilistically based on immigration and emigration rates. In this section, we will explain how the migration is implemented in our BBOTS algorithm.

Consider dealing with an instance of QAP with problem size of 5. Suppose, based on immigration and emigration rates, that an emigrating habitat, , and an immigrating habitat, , are selected. Therefore, a SIV of will be randomly selected and replaces a randomly selected SIV of .

Assuming the first element of , “2” is selected to replace the first SIV of , “5.” Therefore, the new habitat, , is produced. However, it is not a feasible solution for our problem. In order to maintain the feasibility of a solution, once a new SIV migrates into a habitat, the old SIV will replace the SIV with the same value of newly emigrating SIV. Therefore, the new habitat, , will be (2, 3, 1, 4, 5). Figure 2 illustrates this step clearly.

**Figure 2: **Migration operator of BBOTS algorithm.

Once a new habitat is produced, it will only be accepted into the population only if it is not the same with any existing habitat. This is to enhance the diversity throughout the population. Besides, we use the concept of elitism to prevent the best solutions from being corrupted by immigration. This is done by setting the immigration rate for best solutions to 0.

###### 3.2.6. Mutation Operator

According to biogeography, cataclysmic events may happen from time to time, drastically changing the characteristics of a natural habitat. In BBO algorithm, this is imitated through a mutation operator. This process is important to increase the diversity among population.

Copyright (c) 2015, Yarpiz

All rights reserved.

Redistribution and use in source and binary forms, with or without

modification, are permitted provided that the following conditions are

met:

* Redistributions of source code must retain the above copyright

notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright

notice, this list of conditions and the following disclaimer in

the documentation and/or other materials provided with the distribution

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"

AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE

IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE

ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE

LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR

CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF

SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS

INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN

CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)

ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE

POSSIBILITY OF SUCH DAMAGE.

## One thought on “Tabu Search Quadratic Assignment Problem Matlab Matrix”