METAHEURISTIC ILS WITH PATH RELINKING FOR THE NUMBER PARTITIONING PROBLEM

This study brings an implementation of a metaheuristic procedure to solve the Number Partitioning Problem (NPP), which is a classic NP-hard combinatorial optimization problem. The presented problem has applications in different areas, such as: logistics


INTRODUCTION
The Partition Problem is: given a set of numbers N, the goal is to divide it in 2 or more subsets (known as partitions) so that the difference between the sums of the numbers inside each partition be the minimum.
The problem's definition sounds very simple but it is a combinatorial optimization problem that belongs to NP-hard class. To a set with n numbers, we have 2 n ways to divide these numbers in two or more partitions. In this paper, a bit represents each partition; the bit 0 means the first partition and the bit 1 the second partition. Thus, a feasible solution can be represented by a vector of bits which size is n, the position of an element in the solution's vector points to partition associated to the number in the same position of the set that will be allocated.
The Partition Problem can be applied to several areas, such as: logistics, production and operations. Used, for instance, in the scheduling, routing, line balancing and installation projects (H. W. CORLEY, 1971;MACDONALD, 1976). In industry, according to Ducha (2014), a possible application is the raw material partitioning between two machines in the production line, such way that the raw material can be processed faster.
Considering the importance of the Partition Problem, this paper aims to perform a comparative analysis between the proposed algorithm and others metaheuristics to solve a group of instances available on the literature.
The section 2 show a brief literature review, the section 3 contains a detailed description about the problem. Section 4 describe the methodology. In the section 5 and 6 the results will be showed followed by the conclusion and the future works.

RELATED WORKS
The works used as motivation to this paper start from studies that reports the difficulty in applying metaheuristics to solve the Partition Problem (ARAGON et al., 1991;ARGÜELLO et al., 1996;DIAZ et al., 1996;BERRETTA;MOSCATO, 1999). The phenomenon called transition phase is referred by several authors, identified as a specific problem detected in all optimization problem, specially in the Partition Problem (GENT; WALSH, 1995;BERRETTA;MOSCATO, 1999;PERCUS et al., 2006; http://www.ijmp.jor.br v. 8, n. 5, Special Edition IFLOG 2016ISSN: 2236 part of the problem samples has many solutions, to another region, where there is no solution in most cases. Even though this phenomenon has been detected this paper does not address any special focus on it.

PARTITION PROBLEM
According to Ducha and Souza (2013), the Partition Problem is one of the first NP-complete problems registered, based on the work of Coork (1971) andKarp (1972). In Garey and Johnson (1979), the problem was classified as one of the six NPcomplete classic problems, being it the only one that treats exclusively about numbers.
The structure of the problem and its simplicity makes possible reduce many other problems to the Partition Problem, being referred as nearest neighbor problems. This intensify the need of studies and generalization of existent problems.

METODOLOGY
This section presents the detailed information about the implementation. In the section 4.1 is showed how a solution was represented to computational manipulation. In section 4.2 is showed the evaluation function, which is used to do the evaluation of each, generated solution. In section 4.3 is showed the heuristic of refinement, which consists on local search performing movements to explore the neighborhood. In section 4.4 is showed how we generate an initial solution where a random method and a greedy method are proposed. In section 4.5 are shown the ILS metaheuristic, Path Relinking and the proposal algorithm implementing both methods, making our solution a hybridization of them.
To get the computational results we used a set of 25 examples based on samples generated by Berretta and Moscato (1999) with size of 15, 35, 55, 75 and 95 numbers (5 samples for each size) and in all samples, each number has 10 digits. The result analysis is done by arithmetical average of five samples and the main measure of performing is the quality of the solutions in a fixed number and average of the algorithm iterations. These results will be compared with the results from Araujo et al (2004).

Structure of a feasible solution
The data structure to represent a feasible solution is simplest than others problems. The solution consists in, given a set of numbers, determine which partition each number of the set belongs. In the case of two partitions, a bit represents this information; a give number is associated to one or another partition. Considering a set N, and two partitions A and B, we will verify if an element N1 belongs to A or B and this step will be repeated for others elements of the set N (N2, N3… Nn). In this work, the computational representation of a solution is given by a binary tuple of 0 and 1, where a partition A is represented by 0 and the partition B is represented by 1.  which is 0, in the third position we have the element 25 which belongs to partition 1.

Evaluation function
The Partition Problem can be defined as follow: Given a set , or with elements chosen independently and equally distributed, to partition the set (in this case k = 2) in the way: , intending to reduce the absolute difference between the sum of the numbers inside each set.
Starting from this formulation we use the model proposed by Karmarkar and Karp (1992) that specifications are comply with this work. Take A1 as a set with the biggest sum and A2 the smallest one, then the problem can be formulated by the following equations: (1) (3)

Refinement heuristics
The refinement heuristics normally referred as local search is essentially built on the neighborhood concept, which consists in to generate from a solution s, neighbors s' of this solution by a procedure known as movement. Each solution s' N (s), called a neighbor of s, is generated by a modification m in s, called movement. This operation can be represented by s' An accurate definition of the neighborhood is extremely import to the local search. In fact, starting from a given initial solution must be possible by applying movements reach any neighbor in a finite number of steps.

Movements
We used two movements to generate a neighborhood of s. The movements were inversion and swap of bits. The inversion movement consists in each iteration change the bit value of a give position, the value 0 will be changed to 1 and the 1 will be changed to 0, this movement represent the concept of change a number to other partition.
The swap movement consists in change the partition of two given elements, if the partitions are the same nothing is changed, but if the partitions are different, the movement represents the reallocation between partitions. Applying just one movement, we have a new neighbor of the initial solution.
For example, take the solution s (1) = (10011) and s (2) = (10110), starting from the solution s (1) we can by applying the inversion movement to reach s (2) following this path: ( 1 ) = (10011) (10111) (10110) = s ( 2 ) . In the Partition Problem, the inversion movement is not enough to explore all the neighborhood, we need to apply both movements (inversion and swap) to guarantee all neighbor of s can be generated.

Local search
The local search procedure implemented was the Best Improvement Method, which consists in evaluate by an evaluation function all the solutions s' generated from

INDEPENDENT JOURNAL OF MANAGEMENT & PRODUCTION (IJM&P)
http://www.ijmp.jor.br v. 8, n. 5, Special Edition IFLOG 2016 ISSN: 2236-269X DOI: 10.14807/ijmp.v8i5.597 an initial solution by applying the movements on it and return the best solution. If a solution better than the initial solution is found, it replaces the initial solution, when no better solution is found we can say that a local optimum related to the neighborhood was found.

Generation of initial solution
Some metaheuristics need more than others start from a good initial solution to converge to a good solution as well.
We choose two distinct ways to generate an initial solution: the first is a random initial solution, which means to distribute the elements between the partitions randomly. We consider the fact that if a solution has just one partition it is not accepted as a feasible solution.
The second way to generate an initial solution is more careful and starts from a greedy constructive idea specific to the Partition Problem; the local search is applied to the generated solution to obtain the initial solution. The greedy method consists in sort the numbers downward and distribute them (following the descending order) between the partitions, the selected partition is that have the smaller sum of numbers allocated on it.
This method works like placing stones, gravel and then sand in a container, this order of arrangement of the elements causes the gravel to permeate the vacant spaces between the stones and finally the finer sand as the gravel permeates the remaining small spaces occupied by the gravel, so all the space is utilized minimizing the final space required to contain all these materials.
For example, consider the set: (36,67,25,51,13), first sort the set downward, we have: (67,51,34,25,13). The next step is start the distribution considering the two partitions A and B, the partition A receives the first number, then A = {67}, the second number goes to the smaller partition, in this case B because the sum is equals to zero (the partition is empty) , B = {51}, the third element (34) goes to B which still being the smaller partition (the sum of elements, just one, is 51) then B = {51, 34} at this moment the partition B has the sum equals to 85 and the partition A has the sum equals to 67, the next element (25) is allocated in partition A which turns in the bigger partition with the sum equals to 92. Finally B receives the last element 13. Evaluating this solution, we have z = | 92 -98 |, z = 6. After generate the initial solution the local search is applied on it aiming find a local optimum, in our example the solution will be the same of the greedy constructive method.

The proposal algorithm: ILS-PR
The proposal algorithm ILS-PR is a hybridization of the Iterated Local Search (ILS) and Path-Relinking. The hybridization idea consists in improve the results generated by just ILS metaheuristic.

ILS
The ILS method (Fig. 1) is based on a local search with a procedure to generate new solutions by perturbations on the local optimum, opening chances to find other better local optimum by applying movements exploring the search space.
The ILS must contain (i) a procedure to generation an initial solution, (ii) a local search procedure to improve the initial solution, (iii) a procedure to disturb the current solution s leading it to an intermediate solution s'.
The perturbation must be strong enough to find out a way to escape from the local optimum traps, and finally, (iv) an acceptance criteria which decides the type of disturbing will be applied to solution in the next algorithm iteration. The Figure 2 shows what occurs when the perturbation is made on an initial solution s, a second solution is returned and the local search procedure on s' returns a new local optimum that in our example is the global optimum. http://www.ijmp.jor.br v. 8, n. 5, Special Edition IFLOG 2016ISSN: 2236  In case of the selected bit is equals to its subsequent an inversion movement in both will be performed. Each level brings an abrupt perturbation characteristic, it is necessary to the algorithm has enough strength to be able to escape from a deeper valley with larger jumps and subtlety to smaller jumps to reach closer valleys.

Path Relinking
The Path Relinking technic was proposed as an intensification strategy to explore trajectories, which connect elite solutions obtained by the Tabu Search method. This search for better solutions consists in generate and explorer paths in the solutions space starting from one or more elite solutions and leading to another elite solution. To do this, movements are selected which insert attributes from lead solution http://www.ijmp.jor.br v. 8, n. 5, Special Edition IFLOG 2016ISSN: 2236 into current solution. In this way, path relinking can be seen as a strategy that aims incorporate attributes of good solutions, favoring the selection of movements that contain them.

INDEPENDENT JOURNAL OF MANAGEMENT & PRODUCTION (IJM&P)
We applied path relinking as an intensification of each local optimum generated after the local search phase. This strategy is known by get better results from this method. The method can be used as a post-optimization strategy looking for better solutions connecting paths between solutions from an elite group already ranked. Path relinking procedure 1 2 Assign to g' the best solution between s and g; 3 Calc the set of possible movements 4 WHILE DO 5 Assign to g'' the obtained best solution using the best movement to ; 6 Exclude from this movement 7 8 IF f( ) < f(g') THEN 9 10 end IF 11 end WHILE 12 Return g';  http://www.ijmp.jor.br v. 8, n. 5, Special Edition IFLOG 2016ISSN: 2236

ILS-PR
In this work, Path Relinking (PR) was used as an intensification and diversification strategy in each iteration of ILS, as shown in the Fig. 4.
The first line points to the generation of an initial solution s 0 which in our algorithm is done by a greedy constructive heuristic shown in (4.4). The second line is the local search phase generating. While a stop condition is not reached s' receives a perturbation performed on the solution s with a pre-defined perturbation level. The solution s'' receives the resulting solution from a local search applied in s' pointing to a local optimum which can be added to elite group or not and update or not the solution s*.
In the line 7 PR is called who will iterate from s'' with all elite solutions, if there is an improvement the solution s is updated and perturbation level reduced or kept (in case of minimum level), on the other hand the perturbation level is increased and the processed start again from the line 4.   is already expected to be more difficult to obtain good results.

CONCLUSIONS AND FUTURE WORKS
This work proposed an algorithm to solve the Partition Problem using the metaheuristics Iterated Local Search (ILS) with Path Relinking (PR) as strategy of diversification and intensification. The computational results obtained by the proposed algorithm were compared with the results of (ARAUJO, 2004).
Analyzing these results, we showed that the algorithm ILS+PR surpassed the others algorithms in 3 of 5 tested instances. In future works we suggest improve the constructive heuristic strategy, since the used method was not sufficient to generate goo initial solutions due to the small diversity of the numbers contained in the samples, all with ten digits, that is, very large and relatively close numbers.
A more specific approach to the difficulty encountered in the transition phase will also be welcome. Another important contribution will be to allow a quantity k of partitions as well as to present run-time studies of the algorithm for more comprehensive comparisons.

ACKNOWLEDGMENTS
The authors thank the Graduate Program in Mathematical Modelling and Computational (PPGMMC) at CEFET-MG for the support in the development of this work.