An improved hybrid ant-local search algorithm for the partition graph coloring problem

An improved hybrid ant-local search algorithm for the partition graph coloring problem

Journal of Computational and Applied Mathematics ( ) – Contents lists available at ScienceDirect Journal of Computational and Applied Mathematics ...

475KB Sizes 2 Downloads 100 Views

Journal of Computational and Applied Mathematics (

)



Contents lists available at ScienceDirect

Journal of Computational and Applied Mathematics journal homepage: www.elsevier.com/locate/cam

An improved hybrid ant-local search algorithm for the partition graph coloring problem Stefka Fidanova a,∗ , Petrică Pop b a

Institute of Information and Communication Technologies, Bulgarian Academy of Sciences, Acad. G. Bonchev ster. bl. 25A, 1113 Sofia Bulgaria b

Department of Mathematics and Computer Science, Technical University of Cluj-Napoca, North University Center at Baia Mare, Romania

article

info

Article history: Received 5 November 2014 Received in revised form 20 March 2015 Keywords: Partition graph coloring problem Metaheuristics Ant Colony Optimization Local search

abstract In this paper we propose a hybrid Ant Colony Optimization (ACO) algorithm for the Partition Graph Coloring Problem (PGCP). Given an undirected graph G = (V , E ), whose nodes are partitioned into a given number of the sets, the goal of the PGCP is to find a subset V ∗ ⊂ V that contains exactly one node from each cluster and a coloring for V ∗ so that in the graph induced by V ∗ , two adjacent nodes have different colors and the total number of used colors is minimal. Our hybrid algorithm is obtained by executing a local search procedure after every ACO iteration. The performance of our algorithm is evaluated on a set of instances commonly used as benchmark and the computational results show that compared to state-of-the-art algorithms, our improved hybrid ACO algorithm achieves solid results in very short run-times. © 2015 Elsevier B.V. All rights reserved.

1. Introduction In this paper we consider the partition graph coloring problem, denoted by PGCP. Given an undirected graph G = (V , E ) and a partition of its nodes into p node sets V1 , . . . , Vp , called clusters, the partition graph coloring problem consists in finding a subset V ∗ ⊆ V containing exactly one node from each cluster Vi , i ∈ {1, . . . , p} and such that the chromatic number of the graph induced in G by V ∗ is minimum. The considered problem belongs to a class of combinatorial optimization problems commonly referred to as generalized network design problems (GNDPs) or generalized combinatorial optimization problem (GCOPs). This class of problems is obtained in a natural way, generalizing many combinatorial optimization problems by considering a related problem on a clustered graph (i.e. a graph whose nodes are partitioned into a given number of clusters), where the original problem’s feasibility constraints are expressed in terms of the clusters, i.e., node sets instead of individual nodes. For more information concerning to this class of optimization problems we refer to [1,2]. In the last period several generalized combinatorial optimization problems have been studied such as the generalized minimum spanning tree problem [3,4], the generalized traveling salesman problem [5], the generalized vehicle routing problem [6,7], the partition graph coloring problem [8], and the generalized fixed-charge network design problem [9]. All such problems belong to the class of N P -complete problems, they are harder to solve in practice than their original counterparts and recently a lot of research is emphasized on them especially due to their interesting properties and important



Corresponding author. E-mail addresses: [email protected] (S. Fidanova), [email protected] (P. Pop).

http://dx.doi.org/10.1016/j.cam.2015.04.030 0377-0427/© 2015 Elsevier B.V. All rights reserved.

2

S. Fidanova, P. Pop / Journal of Computational and Applied Mathematics (

)



real-world applications in telecommunication, network design, scheduling problems, resource allocation, transportation problems, software engineering, etc. The PGCP was introduced by Li and Simha and it was motivated by considering the joint problem of routing and assignment in wavelength division multiplexing optical networks [8]. The same authors proved that the problem is N P -complete. Demange et al. [10,11] considered this type of graph coloring problem in the framework of generalized network design problems and named it selective graph coloring problem. They investigated as well some special classes of graphs including split graphs, bipartite graphs and q-partite graphs and settled the complexity status of the PGCP in these particular classes. Due to its practical applications and its complexity, the partition graph coloring problem has generated an important interest, being proposed exact and heuristic algorithms: Li and Simha [8] designed two groups of heuristic algorithms: onestep algorithms including onestep Largest-First, onestep Smallest-Last and onestep Color-Degree and two-steps algorithms including twosteps Largest-First, twosteps Smallest-Last and twosteps Color-Degree, Frota et al. [12] described a branch-andcut algorithm for PGCP, Hoshino et al. [13] proposed an integer programming model and a branch-and-price algorithm to solve it, Noronha and Ribeiro [14] described a Tabu Search algorithm. Recently, Pop et al. [15] proposed a memetic algorithm (MA) which uses two different solution representations for the genetic operators and for the local search procedure. The aim of this paper is to present an efficient ant colony algorithm for solving the PGCP. In addition, we proposed an improved hybrid ACO algorithm, which was obtained by combining a traditional pure ACO algorithm with a local search procedure. We compare the performance of our proposed hybrid ACO and pure ACO algorithms with other metaheuristic methods on a set of instances commonly used as benchmark. The remainder of the paper is organized as follows. Section 2 provides some definitions and notations used throughout the paper and formally state the partition graph coloring problem. Section 3 describes the ACO framework. Section 4 introduces the local search procedure and the hybrid ACO algorithm. Section 5 presents and analyzes the results of the computational experiments and finally, the last section concludes the paper. 2. Definition of the partition graph coloring problem We start this section with some basic definitions concerning graph coloring. For more details we refer for example to [16]. Let G = (V , E ) be an undirected graph and let V ′ ⊆ V then the graph induced by V ′ is obtained from the graph G by deleting the nodes of V \ V ′ and the all the edges incident to at least one node from the set V \ V ′ . A vertex k-coloring of the graph G is a mapping c : V → {1, . . . , k} with the property that c (u) ̸= c (v) for all the edges (u, v) ∈ E. The number c (u) or c (v) is called the color of u or v . A graph that can be assigned a k-coloring is k-colorable. The vertex-coloring problem consists in finding a vertex-coloring of G with minimum k. The smallest number of colors needed to color a graph G is called chromatic number. Formally, the partition graph coloring problem is defined on an undirected graph G = (V , E ) with the set of nodes V and the set of edges E. The set of nodes is partitioned into p mutually exclusive nonempty subsets, called clusters, V1 , . . . , Vp with V1 ∪ · · · ∪ Vp = V and Vi ∩ Vj = ∅ for all i, j ∈ {1, . . . , p} and i ̸= j. The PGCP consists of finding a set V ∗ ⊂ V such that: 1. |V ∗ ∩ Vi | = 1, i.e., V ∗ contains exactly one node from each cluster Vi for all i ∈ {1, . . . , p}, 2. the graph induced by V ∗ is k-colorable where k is minimal. The PGCP reduces to the classical graph coloring problem when all the clusters are singletons. An illustration of the PGCP, a feasible solution with three colors and an optimal solution with two colors, is shown in Fig. 1. In this example the graph G = (V , E ) has 8 nodes partitioned into 4 clusters. A feasible solution for the PGCP making use of three colors is represented. The optimal solution makes use of two colors: the first is used to color the nodes 3 and 8 and the second for the nodes 5 and 7. 3. The ACO algorithm Ant Colony Optimization is one of the most successful metaheuristic methods. The main idea comes from collective intelligence of real ants when they look for a food. The problem is solved collectively by the whole colony. This ability is explained by the fact that ants communicate in an indirect way by laying trails of pheromone on the ground. If the pheromone trail within a particular direction is higher, the probability of choosing this direction is higher. The ACO algorithm was proposed by Dorigo et al. [17,18]. It uses a colony of artificial ants that behave as cooperative agents in a mathematical space where they are allowed to search and reinforce pathways (solutions) in order to find the optimal ones. The problem is represented by a graph and where the ants can walk for constructing solutions. Solutions are therefore represented by paths in this graph. After the initialization of the pheromone trails, the ants construct feasible solutions, starting from random nodes, and then the pheromone trails are updated. At each step the ants compute a set of feasible moves and select the best one (according to some probabilistic rules) to continue the rest of the tour. The transition

S. Fidanova, P. Pop / Journal of Computational and Applied Mathematics (

)



3

a

b

c

Fig. 1. (a) An instance of the PGCP. (b) A feasible solution with three colors. (c) An optimal solution with two colors.

probability pi,j , i, j ∈ {1, . . . , n}, is the probability of choosing the node j when the current node is i, and it is based on the heuristic information ηi,j and the pheromone trail level τi,j of the move. pi,j =

τia,j ηib,j  , τia,k ηib,k

k∈Unused

where Unused is the set of unused nodes of the graph. The higher the value of the pheromone and the heuristic information, the more profitable is to select this move and resume the search. At the beginning, the initial pheromone level is set to a small positive constant value τ0 and later, the ants update this value after completing the construction stage. ACO algorithms adopt different criteria to update the pheromone level. The pheromone trail update rule is given by:

τi,j ← ρτi,j + 1τi,j , where ρ models the natural evaporation of the pheromone and 1τi,j is the current intensification of the pheromone trail, proportional to the quality of the solution (see Figs. 2 and 3). In our implementation the graph of the problem is the graph G, explored by the ants. Every ant begins to create its solution starting from a random cluster Vj where a random node vij is chosen as the first solution node. This first node is colored with color number 1. The ants deposit their pheromone on the nodes of the graph and in this case the meaning of τi,j is the quantity of the pheromone on the node i from cluster j. It means that the node is suitable to represent the cluster. We use the MAX–MIN Ant System [19], which is one of the best ant approaches. In this variant of ACO, there are given an upper bound τmax and a lower bound τmin of the pheromone. Thus the accumulation of big amounts of pheromone on some nodes and repetition of same solutions is prevented. Our heuristic information is ηij = 1/wij , where wij is the weight of the node i from cluster j (number of the edges which enter in the node). Therefore the ants prefer nodes with less weight. The ant chooses to include the node with a highest value of the transition probability according to all clusters and nodes in the clusters. Let the maximal number of colors till the current step is C . We chose the minimal number from the interval [1, C ], as a color for the new node, thus this color to be different from the colors of neighbor nodes. If it is impossible, the number of the color of the next node becomes C + 1. After the ant chooses some node we decrease the number of uncolored clusters with one. We repeat procedure for including new nodes in the solution till the number of uncolored clusters becomes 0.

4

S. Fidanova, P. Pop / Journal of Computational and Applied Mathematics (

)



Fig. 2. Pseudocode for ACO.

Fig. 3. Pseudocode for Hybrid Ant Colony Optimization.

We update the pheromone, at the end of every iteration. First we decrease the pheromone of all nodes and after that we add new pheromone only on the nodes of best solution using the rule:

τij =

 ρτij + (1 − ρ)/C ρτij

if the node is colored if the node is not colored.

If the value of the pheromone on some node becomes great then the τmax then we force this value to be equal to τmax and if the value of the pheromone becomes less than τmin then we force this value to be equal to τmin . For τmax we use 1/(1 − ρ C ) and for τmin = 0.087τmax . If some of the clusters are isolated, i.e. the degree of all the vertices belonging to those clusters is 0, than we chose a random node from it and we color them with a color number 1. 4. Local search procedure Sometimes the concentration on a sole metaheuristic is rather restrictive. We can remark that nowadays several of the leading methods are hybrid approaches, which combine different solution techniques [20]. A hybrid metaheuristic is obtained by combining a metaheuristic with some other optimization approaches. Both components of the hybrid metaheuristic may run concurrently and exchange information in order to guide the search. Some research has been done on them over the last years, and the resulted publications document the success of hybrid algorithms in various application domains, but still a lot of work has to be done in order to find skilled combinations of metaheuristics with other optimization techniques that will lead to a more efficient behavior and a higher flexibility when dealing with large-scale optimization problems. In this work, we propose an improved hybrid ACO algorithm combining traditional ACO algorithm with an appropriate local search procedure. We apply our local search after the termination of every ACO iteration before the pheromone

S. Fidanova, P. Pop / Journal of Computational and Applied Mathematics (

)



5

Table 1 Experimental results on instances with different size. Instance set

B&C

Nodes

Density

LB

UB

Average value

MA1 Standard deviation

Time (s)

Average value

MA2 Standard deviation

Time (s)

ACO Average value

Standard deviation

Time (s)

20 40 60 70 80 90 100 120

0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5

3 4 5 6 6 6 6 7

3 4 5 6 6 7 7 8

3.00 4.50 5.96 6.86 7.66 8.22 8.90 10.26

0.00 0.51 0.20 0.40 0.48 0.42 0.30 0.44

0.02 0.10 0.31 0.53 0.80 1.21 1.74 3.41

3.00 4.00 5.63 6.06 6.94 7.55 7.93 9.22

0.00 0.00 0.49 0.24 0.29 0.50 0.30 0.43

0.14 0.60 2.00 3.33 4.90 7.49 11.04 21.05

3.00 4.00 5.23 6.25 6.75 6.43 6.65 7.30

0.325 0.258 0.267 0.499 0.404 0.307 0.469 0.49

0.003 0.004 0.008 0.012 0.014 0.015 0.017 0.023

Table 2 Experimental results on instances with different density. Instance set

B&C

Nodes

Density

LB

UB

MA1 Average value

Standard deviation

Time (s)

Average value

MA2 Standard deviation

Time (s)

Average value

ACO Standard deviation

Time (s)

90 90 90 90 90 90 90 90 90

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9

2 3 4 5 6 8 10 12 16

3 4 5 6 7 8 10 12 16

3.13 4.71 6.06 7.59 8.22 10.98 12.93 15.55 17.69

0.33 0.45 0.24 0.49 0.42 0.34 0.38 0.51 0.86

0.22 0.52 0.78 1.07 1.21 1.88 2.37 3.38 7.38

3.09 4.41 5.52 6.79 7.55 10.50 12.39 15.18 17.27

0.29 0.49 0.56 0.83 0.50 0.87 1.12 0.80 0.98

1.37 3.24 4.90 6.54 7.49 11.95 14.83 20.98 45.75

3.00 3.98 4.55 5.34 6.43 8.71 10.48 12.63 16.87

0.013 0.044 0.283 0.313 0.307 0.542 0.32 0.483 0.538

0.015 0.015 0.015 0.015 0.015 0.015 0.015 0.015 0.015

updating. If the local search procedure improves the current ant solution, we update the pheromone according to this improved solution. Let the number of used colors in a current ant solution be C . Suppose that for coloring the cluster Vj we use the color number C and the colored node is the node vij . We choose, in a random way, another node from the cluster Vj and the aim is to try to color it with a color with number less than C . We apply this procedure on all clusters where the node representing the cluster is colored with color number C . After every iteration we apply the local search procedure only once on the solutions from all ants. 5. Experimental results The developed algorithm has been coded in C++ language and the experiments were run on a Intel Core i4 PC with 3.4 GHz. The ACO parameters are fixed as follows: ρ = 0.5, a = 1, b = 1, number of used ants is 3 and the number of iterations is 10. We used the set of instances Rand [21] that was also used by Frota et al. [12]. These randomized instances contain between 20 and 120 nodes which are partitioned into 10 to 60 clusters, respectively. We performed 30 independent runs for each instance and determined the average and standard deviations of the final objective values. We compare our pure ACO algorithm with two variants of memetic algorithms, denoted by MA1 and MA2, introduced by Pop et al. [15] and the branch-and-cut (B&C) approach provided by Frota et al. [12]. Table 1 contains the experimental results for instances containing between 20 and 120 nodes and an edge density of 0.5, while Table 2 contains the results for instances containing 90 nodes and an edge density between 0.1 and 0.9. Each line corresponds to a set of 5 different instances. Both tables show the characteristics of the used instances, the lower and upper bounds obtained by the branch and cut (B&C) approach within two hours run-time, followed by the average objective values of the final best solutions, their standard deviations, and the run-time in seconds for the MA1, MA2 and ACO algorithms. We observe that the ACO algorithm achieves better results compared to the two memetic algorithms. The difference is larger for larger instances as well as for instances with larger density. The running time of our ACO is much less than the corresponding running times of the other mentioned algorithms. We point out as well the fact that the ACO algorithm is a constructive method and avoids conflicts, creating only feasible solutions. ACO algorithm achieves better solutions also compared to B&C approach. Therefore we can conclude that our ACO algorithm performs better than memetic algorithms because it achieves better solutions with less running time. It is very important when it comes to time-critical applications and large instances due to its excellent scalability. We compare as well our pure ACO algorithm with the developed hybrid ACO algorithm. Table 3 contains experimental results for instances containing between 20 and 120 nodes and with an edge density of 0.5 and Table 4 contains results for instances containing 90 nodes and with an edge density between 0.1 and 0.9. We used the same set of instances as in Table 1 and Table 2. The tables show the average results obtained after 30 runs of every instance and over set of 5 instances.

6

S. Fidanova, P. Pop / Journal of Computational and Applied Mathematics (

)



Table 3 Comparison ACO hybrid ACO on instances with different size. Instance set

ACO

Hybrid ACO

Nodes

Density

Aver

Std

Aver

Std

20 40 60 70 80 90 100 120

0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5

3.00 4.00 5.23 6.25 6.75 6.43 6.65 7.30

0.00 0.00 0.267 0.499 0.404 0.307 0.469 0.490

3.00 4.00 5.11 6.07 6.25 6.13 6.27 7.12

0.00 0.00 0.332 0.407 0.428 0.486 0.409 0.440

Table 4 Comparison ACO hybrid ACO on instances with different density. Instance set

ACO

Hybrid ACO

Nodes

Density

Aver

Std

Aver

Std

90 90 90 90 90 90 90 90 90

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9

3.00 3.98 4.55 5.34 6.43 8.71 10.48 12.63 16.87

0.00 0.044 0.283 0.313 0.307 0.542 0.320 0.483 0.538

3.00 3.79 4.19 5.17 6.21 8.16 10.23 12.18 16.34

0.00 0.138 0.246 0.392 0.486 0.493 0.553 0.725 0.781

We observe that the hybrid ACO algorithm provides better results compared to the pure ACO algorithm. Standard deviations for both algorithm are similar. Both ACO algorithms ran the same number of iterations and the running time of the hybrid ACO algorithm is about 25% longer. If we increase the number of iterations (running time) of the pure ACO algorithm till it achieves the same quality results as hybrid ACO algorithm than the pure ACO algorithm needs three times longer running times. Therefore, we can conclude that our hybrid ACO algorithm performs better than the pure ACO algorithm. 6. Conclusions This paper has presented two novel methods for solving the partition graph coloring problem, namely a pure ACO algorithm and a hybrid ACO algorithm. The computational experiments on common benchmark instances sets show that, although our algorithms are not always able to find the optimal solutions, they produce solid results with very low runtimes and therefore have excellent scalability when it comes to large instances. The computational results showed that our pure ACO algorithm performs superiorly, achieving better solutions with less run time compared to the memetic algorithms considered by Pop et al. [15] and in addition our proposed hybrid ACO algorithm performs better in comparison to the pure ACO algorithm. Acknowledgments This work was supported by a grant of the Romanian National Authority for Scientific Research, CNCS—UEFISCDI, project number PN-II-RU-TE-2011-3-0113 and by the Bulgarian National Scientific Fund under the grant I02/20. Efficient Parallel Algorithms for Large Scale Computational Problems and I02/5 InterCriteria Analysis. A New Approach to Decision Making. References [1] C. Feremans, M. Labbé, G. Laporte, Generalized network design problems, European J. Oper. Res. 148 (2003) 1–13. [2] P.C. Pop, Generalized Network Design Problems. Modeling and Optimization, De Gruyter Series in Discrete Mathematics and Applications, Germany, 2012. [3] Y.S. Myung, C.H. Lee, D.W. Tcha, On the generalized minimum spanning tree problem, Networks 26 (4) (1995) 231–241. [4] P.C. Pop, W. Kern, G.J. Still, A new relaxation method for the generalized minimum spanning tree problem, European J. Oper. Res. 170 (3) (2006) 900–908. [5] M. Fischetti, J.J. Salazar, P. Toth, A branch-and-cut algorithm for the symmetric generalized traveling salesman problem, Oper. Res. 45 (3) (1997) 378–394. [6] G. Ghiani, G. Improta, An efficient transformation of the generalized vehicle routing problem, European J. Oper. Res. 122 (1) (2000) 11–17. [7] P.C. Pop, O. Matei, C. Pop Sitar, An improved hybrid algorithm for solving the generalized vehicle routing problem, Neurocomputing 109 (2013) 76–83. Elsevier. [8] G. Li, R. Simha, The partition coloring problem and its application to wavelength routing and assignment, in: 1st Workshop on Optical Networks, 2000. [9] T. Thomadsen, T. Stidsen, The generalized fixed-charge network design problem, Comput. Oper. Res. 34 (4) (2007) 997–1007. [10] M. Demange, J. Monnot, P.C. Pop, B. Ries, Selective graph coloring in some special classes of graphs, in: Lecture Notes in Computer Science, vol. 7422, 2012, pp. 320–331.

S. Fidanova, P. Pop / Journal of Computational and Applied Mathematics (

)



7

[11] M. Demange, J. Monnot, P.C. Pop, B. Ries, On the complexity of the selective graph coloring problem in some special classes of graphs, Theoret. Comput. Sci. 540–541 (2014) 82–102. [12] Y. Frota, N. Maculan, T.F. Noronha, C.C. Ribeiro, A branch-and-cut algorithm for the partition coloring problem, Networks 55 (3) (2010) 194–204. [13] E.A. Hoshino, Y.A. Frota, C.C. de Souza, A branch-and-price approach for the partition coloring problem, Oper. Res. Lett. 39 (2) (2011) 132–137. [14] T.F. Noronha, C.C. Ribeiro, Routing and wavelength assignment by partition colouring, European J. Oper. Res. 171 (3) (2006) 797–810. [15] P.C. Pop, B. Hu, G.R. Raidl, A memetic algorithm with two distinct solution representations for the partition graph coloring problem, in: Lecture Notes in Computer Science, vol. 8111, 2013, pp. 219–227. [16] M. Kubale, Graph Colorings, American Mathematical Society, 2004. [17] M. Dorigo, V. Maniezzo, A. Colorni, The ant system: Optimization by a colony of cooperating agents, IEEE Trans. Syst. Man Cybern. B 26 (1996) 29–41. [18] M. Dorigo, L.M. Gambardella, Ant colony system: A cooperative learning approach to the traveling salesman problem, IEEE Trans. Evol. Comput. 1 (1997) 53–66. [19] T. Stutzle, H.H. Hoos, MAX-MIN ant system, Future Gener. Comput. Syst. 16 (2000) 889–914. [20] G.R. Raidl, J. Puchinger, C. Blum, Metaheuristic hybrids, in: M. Gendreau, J.Y. Potvin (Eds.), Handbook of Metaheuristics, second ed., in: International Series in Operations Research & Management Science, vol. 146, Springer, 2010, pp. 469–496. [21] Y. Frota, N. Maculan, T.F. Noronha, C.C. Ribeiro, Instances for the partition graph coloring problem, www.ic.uff.br/~celso/grupo/pcp.htm.