Keywords

1 Introduction

Metaheuristic procedures are a class of approximation methods, designed to solve difficult combinatorial optimization problems [1]. Optimization problems are based on choosing the best configuration from a set of feasible solutions to achieve an objective [2] and are divided into two categories: problems with continuous and discrete variables. For this case, the second category will be taken that tries to find an objective that is taken within a finite and discrete set, an integer, a set of integers, a permutation or a graph. The two types of problems have different solution methods, however, combinatorial optimization problems belong to the second category [2] as an example, Greedy Random Adaptive Search Procedures (GRASP).

GRASP is an iterative procedure where each step consists of a construction phase and an improvement phase. In the construction phase, a constructive heuristic procedure is applied to obtain a good initial solution. This solution is improved in the second phase by a local search algorithm. The best of all the solutions examined is the final result [3, 4].

The main contribution of this work is based on the experimentation and analysis of the results in the method, obtaining a good initial solution and subsequently improving it.

This paper is organized as follows: Sect. 1, contains an introduction to this work, in Sect. 2, related work is presented. In Sect. 3, the formulation for the quadratic Assignment Problem (QAP); Sect. 4, shows the metaheuristics, Sect. 4.1, contains a description of GRASP, as well as the design of the pseudocode, subsequently in Sect. 4.2 the use of GRASP for the Quadratic Assignment Problem.

Section 5, shows the experiments that were done, and the results that were obtained, respectively. Finally, in Sect. 6, it will find a discussion, conclusions and future work.

2 Related Work

The Quadratic Assignment Problem (QAP) is a combinatorial optimization problem that consists in finding an optimal allocation of n resources to n locations in order to minimize the cost of transportation, additionally, two matrixes are needed, one for the requirements of the units to be transported and the second is the cost of transport per unit between the localities.

QAP was proposed by [5] in 1957. Later in 1976, Shani and González proved that QAP is an NP-complete problem [6]. So far, optimal solutions have been found using exact methods for instances of size 30 [7]. The QAP is used in many applications such as: computer keyboard design, manufacturing programming, airport terminal design, and communication processes. An exact branch and bound algorithm is used with some variants to solve the QAP and was proposed by [7], however, recently solutions were proposed with different metaheuristics techniques such as [8, 9]: genetic algorithms, simulated annealing, tabu search [10] and GRASP [3, 11]. In [12] implemented GRASP in parallel for QAP.

Other works related to the search for QAP solutions are based on the particle swarm algorithm, recombination of operators for genetic algorithms and stagnation aware cooperative parallel to local search [13, 14].

QAP in large instances is a notably hard problem to find a solution to and the performance of metaheuristic algorithms varies, as mentioned in [15] where two algorithms are compared with results that depend on the size of the problem.

In [16] simulated annealing, particle swarm optimization, genetic algorithms, iterated local search, tabu search and crow search algorithms are implemented and compared in massive parallel processing units to solve QAP for large instances. Another example of parallel processing can be seen in [17] where this metaheuristic is implemented with Tabu search to work with large size QAP.

3 Formulation for the Quadratic Assignment Problem

The QAP consists of finding an optimal allocation that minimizes the cost of transporting materials, among n facilities in n locations, considering the distance between locations and the flow of materials between facilities. The QAP can be formulated by a combinatorial optimization model (CP).

Given a set N = {1, 2,.., n} and two symmetric matrices of size n x n where: F = \(\left( {f_{ij} } \right)\) y D = (\(d_{kl}\)), a permutation p Є \(\Pi_{N}\) must be found that minimizes

$$ \sum\limits_{i = 1}^{n} {\sum\limits_{j = 1}^{n} {f_{ij} d_{p(i)p(j)} } } $$
(1)

Where \(\Pi_{N}\) is the set of all permutations of N, F is the material flow matrix between facilities and D is the distance matrix between cities.

4 Metaheuristics

The major drawbacks that heuristic techniques face is the existence of local optimum that are not absolute. If during the search there is a local optimum, the heuristic could not continue the process and would be “trapped” at the same point. In order to solve the problem, it is recommended to restart the search from another initial solution and verify that the new search explores other paths.

Most combinatorial optimization problems are specific problems, so a heuristic technique algorithm that works for one problem is sometimes not useful for solving other problems. However, in recent times. general purpose heuristics called metaheuristics have been developed that try to solve the above drawbacks. Most metaheuristics are developed with neighborhood search methods.

The word metaheuristics was coined [1] at the same time that the term Tabu Search emerged (1986). A metaheuristic is a master strategy that guides and modifies other heuristics to generate better solutions than are normally presented by other methods [18].

There are several successful metaheuristics in solving combinatorial problems. The Greedy Randomized Adaptive Search Problem (GRASP) metaheuristic is one of the most recent techniques, it was originally developed [19] at the time of studying coverage problems of high combinatorial complexity [3]. Each iteration in GRASP generally consists of two steps: the construction phase and the local search procedure. In the first stage, an initial solution is built that is later improved by post-processing to perfect the solution obtained in the first stage until obtaining a local optimum.

There are works where this metaheuristic is applied for optimization problems in big data [20]. Additionally, there are other variants such as: GRASP-path relinking, GRASP-reactive, GRASP-parallel, GRASP-hybrids with some other metaheuristics whose search is based on neighborhoods [21].

4.1 Greedy Randomized Adaptive Search Problem GRASP

A GRASP is an iterative process, each iteration consists of two steps: the construction phase and the local search procedure. In the first, an initial feasible solution is construct, later it is improved by means of an exchange procedure until obtaining a local optimum [4].

Once the two phases have been executed, the solution obtained is stored and another iteration is carried out, each time saving the best solution that has been found so far.

An algorithm that exemplifies metaheuristics is shown in Fig. 1.

Fig. 1.
figure 1

Generic GRASP pseudocode.

The general description of the main components of GRASP are: The Greedy component that uses a myopic algorithm for the selection of the components that guide the construction of solutions, the Randomized used for the random selections of an elite list of candidates that determine the path of search, the Adaptive has the mission of updating each result obtained from the components of the solution that is built [22].

4.2 GRASP for the Quadratic Assignment Problem

The GRASP design has been used by some researchers to solve the QAP for different instances [1, 4, 6]. It should be noted that the solutions are a permutation of length n, summarizing the procedure as follows: Initial construction phase: stage 1, generation of a list of candidates, which has previously been restricted by two parameters, then one is randomly taken of these candidates from which the first 2 assignments are derived. Stage 2, the remaining n−2 assignments are added in relation to the Greedy procedure, once the process is finished, the permutation is completed, producing a feasible solution. Phase 2 of improvement: the solution generated from phase 1 is taken as the initial solution of some local search procedure, at the end of the procedure, a local optimal solution will be obtained, which could also be globally optimal.

The neighborhood structures used are: 2-exchange, N* and λ-exchange. In practice, the flow matrixes are taken, as well as the distance matrix and their elements are listed separately. The flows (matrix) are ordered from highest to lowest and the distances from least to greatest, both lists are restricted with a parameter 0 < α < 1, they are multiplied generating a new list of elements of the form \(f_{ij}\) * \(d_{kl}\) that contains large flows and short distances. This list is restricted with a parameter 0 < β < 1, with these operations you have a restricted list of candidates (CRL), from this list an element of the form is randomly selected \(f_{ij}\) * \(d_{kl}\), producing the first assignment pair (i, k), (j, l), interpreted as facility k is assigned to location i and facility l is assigned to location j. Finally n−2 components remain to be assigned, again with a greedy we calculate the \(C_{ik}\) costs with respect to the 2 assignments against the remaining possible assignments, another CRL is formed and one of these candidates is selected with which the third assignment is generated and so on. Until completing the permutation of n components called initial solution S0 which is subjected to phase 2, called improvement phase, this is an iteration of GRASP [23].

5 Results

This section shows the results obtained for instances taken from [24], the instances dimensions are greater than 42 up to 100 considering as a great scale. A data table is shown for each of the three implemented neighborhood structures. It also shows three comparative tables of the neighborhood structures in terms of the number of iterations, the execution time TCPU and the percentage in which they reach the optimal or best known value. Likewise, a table with the GAP percentages is presented.

All the results shown in this section were obtained by restricting the list of candidates (RLC) with the parameters α = 0.2 and β = 0.3, which were determined experimentally. The neighborhood topologies is discussed in [3, 25] in which the size of the neighborhood is commented as follows: for 2-exchange is \(C_{n}^{2}\), λ-exchange, for the size is \(\frac{{n^{3} }}{24}\), \(N^{*}\) is \(\frac{{n^{4} }}{8}\), finally, the pseudocode algorithms for the previous neighborhood structures are shown in [3].

Table 1. GRASP results with local search λ-exchange, Skorin-Kapov instances
Table 2. GRASP results with local search 2-exchange, Skorin-Kapov instances
Table 3. GRASP results with local search N*, Skorin-Kapov instances

6 Conclusions

The results of Tables 1, 2 and 3 shows that GRASP is a robust metaheuristic in the search for solutions to NP-hard problems. The solutions reached in the work are compared with the best known values according with QAPLIB [24]. As shown in Tables 1, 2 and 3 and in the % error column, the results obtained oscillate between 0.56 and 1.11 in error percentage. The seventh column shows the execution time for each instances in milliseconds, which is a reasonable computing time for large-scale instances.

Within the research it was shown that for the Sko 42 instance case, the best implementation was 2-exchange, in the case of Sko 64 the best combination was λ-exchange and for Sko 90 the best execution was Greedy 2 stage. Talking about the case of matrices of size 100 that represent the largest scale, the results are considered favorable because the error is less than 1%, only in the case of the Sko100e instance the maximum error is 1.06.

In the present document, the results obtained were carried out in the Java programming language for the three local searches with GRASP and were executed on an Intel i7 processor. Therefore, with the results shown, the usefulness of metaheuristics to solve highly complex problems was verified, as well as the verification to obtain approximate optimal solutions, given the inefficiency of the exact methods.

As future work, it is proposed to implement the metaheuristic variable neighborhood search (VNS) with the neighborhood structures 2-exchange, N* and λ-exchange as an improvement phase for GRASP to form a hybrid GRASP-VNS.