A Hybrid Method For The Graph Coloring and Related Problems

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

MIC2003: The Fifth Metaheuristics International Conference

???-1

A Hybrid Method for the Graph Coloring and Its Related Problems
Andrew Lim* Xingwen Zhang* Yi Zhu *Department of IEEM, Hong Kong University of Science and Technology Clear Water Bay, Kowloon, Hong Kong {iealim,xwzhang}@ust.hk

Department of Computer Science, National University of Singapore 3 Science Drive 2, Singapore 117543 zhuyi@comp.nus.edu.sg

Introduction

Given a graph G=(V,E), where V is the set of nodes and E is the set of edges, the graph coloring problem is to assign a color c (1 c k) to each node of the graph, so that no two adjacent nodes have the same color and the total number of colors, k, needed is minimized. The graph coloring problem has been well studied and it is known to be NP-complete. As a result, many heuristic algorithms have been developed to solve the problem. In the Second DIMACS Implementation Challenge [3], J. C. Culberson and F. Luo [1], F. Glover, M. Parker and J. Ryan [2], G. Lewandowski and A. Condon [5], and C. Morgenstern [6] implemented a variety of algorithms and ran the experiments on standard benchmark instances. The algorithms used include Iterated Greedy algorithm (IG), Tabu Search with branch and bound, distributed IMPASSE, and parallel IMPASSE. D. E. Joslin and D. P. Clements [4] applied a general approach for optimization, called Squeaky Wheel Optimization (SWO), to graph coloring. In the following paragraphs, we shall discuss the IG method and SWO technique. We have adapted these two methods in order to develop our hybrid method. Given a permutation of nodes, the Greedy algorithm selects a node sequentially based on its position in the permutation and assigns a color to the node. The color selected for a node is the color with the smallest index that has not been used by its neighbors. The Iterated Greedy algorithm is an extension of the greedy method. It applies the greedy method repeatedly by generating a new permutation each time based on a certain criteria. The criterion used in [1] is to order the nodes that have the same color in the previous coloring to be in consecutive positions in the new permutation. This method of generating new permutations ensures that the new coloring will not use more colors than the previous coloring. The SWO method is similar to the IG technique. SWO has three main components, namely the Constructor, the Analyzer and the Prioritizer [4]. When applied to graph coloring, the nodes are ordered in a permutation sorted in the decreasing order of the node degree. The constructor greedily constructs a coloring. The analyzer assigns blame to each node which has a color outside the target number of colors. The target number of colors is set to be one less than the current best solution. The prioritizer modifies the previous permutation by moving nodes with blame forward in the sequence according to how much blame the nodes received.

Kyoto, Japan, August 2528, 2003

???-2

MIC2003: The Fifth Metaheuristics International Conference

Bandwidth Coloring

Bandwidth coloring [8] is a generalization of the pure graph coloring where each edge e(i, j) is associated with an edge weight d(i, j). The objective is to assign a color c (1 c k) to each node of the graph, so that the absolute value of the difference between the color of node i and node j is at least d(i,j) for each edge e(i, j), and with the total number of colors needed, k, minimized. Pure graph coloring problem is a special type of bandwidth coloring with d(i, j)=1 for all edges e(i,j) in E. 2.1. Solution Methods Similar to the original SWO model, the overall architecture of our model has three main components: the Hill-Climbing procedure, the Analyzer and the Prioritizer. In the original SWO, given a sequence of nodes, the constructor generates a solution using a greedy algorithm. The hill-climbing procedure first obtains a solution generated greedily and then tries to improve the solution by downhill moves. The hill-climbing algorithm is chosen because it is very fast in reaching local optima. 2.1.1 The Hill Climbing Procedure The initial sequence of nodes for the hill-climbing procedure is generated by sorting them in a decreasing order of node degree. Given a sequence of nodes in the graph, the greedy algorithm sequentially assigns the smallest color to each node without violating the requirement that colors between adjacent nodes must of a certain distance apart. For example, a color Cn can be assigned to a node n if any of its adjacent node m with color Cm, |Cn -Cm | d(n, m). The hill-climbing model uses the greedy algorithm repeatedly to obtain better colorings. This is very similar to the IG method. In each iteration, a sequence is generated and passed to the greedy algorithm. Nodes are ordered by the color number where nodes with smaller color numbers are placed close to the end of the sequence. This method of generating a new sequence ensures that the new coloring will use no more colors than the previous coloring for the pure graph coloring problem and the bandwidth coloring problem. 2.1.2 The Analyzer The analyzer uses the same approach as that used by D. E. Joslin and D. P. Clements [4]. The target set has one less color than the number of colors that was used to color the best solution so far. Blame is assigned to each node whose assigned color is outside the target set, with the amount of blame increasing for each additional color that must be added to the target set. 2.1.3 The Prioritizer The analyzer is the same as that used by D. E. Joslin and D. P. Clements [4] The prioritizer reorders the sequence of nodes by moving the nodes with blame forward. Nodes are moved forward with a distance that increases with the magnitude of the blame. 2.2 Computational Results We model pure graph coloring problem as bandwidth coloring problem with d(i,j)=1 for each edge e(i,j). Table 1 and 2 give results on the geometric graphs GEOM, which can be found in the computational symposium website [8], for the pure graph coloring and bandwidth coloring problems respectively. The tables show the best coloring k found over a single experiment and the time t in seconds1 needed to get the best results before the program terminates after 1 minute Kyoto, Japan, August 2528, 2003

MIC2003: The Fifth Metaheuristics International Conference

???-3

running, and 0 indicates that t is less than 1 second. Compared to the results obtained by S. Prestwich [7], our results are comparable, but not as good. Note that on our machine, the benchmark program dfmax (r500.5.b) runs: 25.32 (user) 0.00 (sys) 26.00 (real). Graph k t Graph k GEOM20 5 0 GEOM50b 8 GEOM20a 5 0 GEOM60 6 GEOM20b 3 0 GEOM60a 10 GEOM30 6 0 GEOM60b 9 GEOM30a 6 0 GEOM70 8 GEOM30b 5 0 GEOM70a 11 GEOM40 6 0 GEOM70b 10 GEOM40a 7 0 GEOM80 8 GEOM40b 7 0 GEOM80a 12 GEOM50 6 0 GEOM80b 12 GEOM50a 9 0 GEOM90 8 Table 1: Results for Pure Graph Coloring t 0 0 0 0 0 0 0 0 0 0 0 Graph GEOM90a GEOM90b GEOM100 GEOM100a GEOM100b GEOM110 GEOM110a GEOM110b GEOM120 GEOM120a GEOM120b Graph GEOM90a GEOM90b GEOM100 GEOM100a GEOM100b GEOM110 GEOM110a GEOM110b GEOM120 GEOM120a GEOM120b k 12 15 9 13 15 9 14 15 11 16 17 k 69 77 51 76 83 53 82 88 62 92 98 t 1 0 0 0 0 0 9 14 0 1 0 t 9 20 33 20 9 2 40 17 1 5 4

Graph k t Graph k t GEOM20 21 1 GEOM50b 38 7 GEOM20a 22 1 GEOM60 34 1 GEOM20b 14 0 GEOM60a 53 8 GEOM30 29 0 GEOM60b 46 5 GEOM30a 32 1 GEOM70 38 1 GEOM30b 26 0 GEOM70a 63 1 GEOM40 28 3 GEOM70b 54 0 GEOM40a 38 2 GEOM80 42 8 GEOM40b 34 4 GEOM80a 66 1 GEOM50 28 5 GEOM80b 65 30 GEOM50a 52 4 GEOM90 46 1 Table 2: Results for Bandwidth Graph Coloring

Multicoloring

Multicoloring [8] is another generalization of pure graph coloring problem. Each node, i, is associated with a node weight k(i). The aim is to assign k(i) distinct colors in the range from 1 to k to each node of the graph, so that for each edge e(i, j) the intersection of the color sets assigned to node i and node j is empty, and the total number of colors used, k, is minimized. 3.1 Solution Methods Multicoloring problem is transformed into pure graph coloring by splitting each node i into k(i) nodes. The k(i) nodes form a complete subgraph after the transformation. The graph in Figure 1 with k(1)=1, k(2)=2 and k(3)=2 is transformed into the graph in Figure 2. After transformation, the problem can be solved using the same method as described earlier.

Kyoto, Japan, August 2528, 2003

???-4

MIC2003: The Fifth Metaheuristics International Conference

3.2 Computational Results Table 3 gives the results for multi-coloring problems. The table shows the best coloring k found over a single experiment and the time t in seconds needed to get the best results before the program terminates after having run for 1 minute.

Bandwidth Multicoloring

Bandwidth Multicoloring [8] is the combination of bandwidth coloring and multicoloring. It is the multicoloring problem along with the constraint that the absolute value of the difference between any member of S(i) and S(j) is at least d(i,j) for each edge e(i, j) with edge weight d(i,j), where S(i) is the color set of k(i) colors that are assigned to node i. The value d(i,i) is interpreted as the distance between distinct values (or colors) in S(i). 4.1 Solution Methods Bandwidth Multicoloring problem is transformed into bandwidth coloring by splitting each node i into k(i) nodes. The k(i) nodes form a complete subgraph after the transformation. The graph in Figure 3 with k(1)=1, k(2)=2 and k(3)=2, and d(1,1)=1, d(1,2)=2, d(1,3)=3, d(2,2)=4, d(2,3)=5 and d(3,3)=6, is transformed into the graph in Figure 4. After the transformation, the problem is solved by using the same model as described earlier. In the model, the k(i) nodes are distinct nodes from an implementation-independent point of view. In the implementation they share information, such as the adjacency list and the minimal available color to be used, for efficiency purpose. 4.2 Computational Results Table 4 gives the results of the geometric graphs GEOM for bandwidth multi-coloring problems. The tables show the best coloring k found and the time t in seconds needed to get the best results before the program terminates after being run for 3 hours, and 0 indicates that t is less than 1 second. Compared to the results obtained by S. Prestwich [7], our results are much better for the bandwidth multi-coloring problem, both in term of quality and speed. Our program is able to solve all the 33 cases, including 15 cases that his program was unable to solve. For the 17 cases solved by both, our system gives better results for 16 of them. Table 5 compares the solution qualities for these 17 cases. k1 is the number of colors needed by our algorithm and k2 is the Kyoto, Japan, August 2528, 2003

MIC2003: The Fifth Metaheuristics International Conference

???-5

number of colors obtained by S. Prestwichs method [7].

Graph k t Graph k GEOM20 28 0 GEOM50b 17 GEOM20a 30 0 GEOM60 36 GEOM20b 8 0 GEOM60a 65 GEOM30 26 0 GEOM60b 22 GEOM30a 40 0 GEOM70 44 GEOM30b 11 0 GEOM70a 71 GEOM40 31 0 GEOM70b 22 GEOM40a 46 0 GEOM80 63 GEOM40b 14 0 GEOM80a 68 GEOM50 35 0 GEOM80b 25 GEOM50a 61 0 GEOM90 51 Table 3: Results for Multi-Coloring

t 0 0 0 0 0 0 0 0 0 0 0

Graph GEOM90a GEOM90b GEOM100 GEOM100a GEOM100b GEOM110 GEOM110a GEOM110b GEOM120 GEOM120a GEOM120b Graph GEOM90a GEOM90b GEOM100 GEOM100a GEOM100b GEOM110 GEOM110a GEOM110b GEOM120 GEOM120a GEOM120b

k 65 28 60 81 30 62 91 37 64 93 34 k 382 157 413 462 172 389 501 210 409 564 201

t 0 0 0 0 0 0 0 0 0 0 0 t 10404 648 631 8472 4893 577 4671 12 1825 5335 869

Graph k t Graph k t GEOM20 149 0 GEOM50b 87 53 GEOM20a 169 16 GEOM60 258 46 GEOM20b 44 0 GEOM60a 368 3748 GEOM30 160 0 GEOM60b 119 300 GEOM30a 211 10 GEOM70 279 25 GEOM30b 77 0 GEOM70a 478 417 GEOM40 167 3 GEOM70b 124 136 GEOM40a 214 358 GEOM80 394 4041 GEOM40b 76 8 GEOM80a 379 677 GEOM50 224 41 GEOM80b 145 3230 GEOM50a 326 96 GEOM90 335 4095 Table 4: Results for Bandwidth Multi-Coloring

Kyoto, Japan, August 2528, 2003

???-6

MIC2003: The Fifth Metaheuristics International Conference

K2 k2 k1 Graph k1 k2 k2 k1 Graph k1 GEOM20 149 159 10 GEOM60 258 279 21 GEOM20a 169 175 6 GEOM60a 368 ----GEOM20b 44 44 0 GEOM60b 119 128 9 GEOM30 160 168 8 GEOM70 279 310 31 GEOM30a 211 235 24 GEOM70a 478 ----GEOM30b 77 79 2 GEOM70b 124 133 9 GEOM40 167 189 22 GEOM80 394 ----GEOM40a 214 260 46 GEOM80a 379 ----GEOM40b 76 80 4 GEOM80b 145 152 7 GEOM50 224 257 33 The rest of the cases were not solved by [7] GEOM50a 326 395 69 GEOM50b 87 89 2 Table 5: Result Comparisons for Bandwidth Multi-Coloring

Conclusion

We combined the SWO method and Hill-Climbing idea with a generic representation to solve the graph coloring problem and its generalizations, namely, the bandwidth coloring problem, the multi-coloring problem and the bandwidth multi-coloring problem. Experiment results show that our new method is competitive on the pure graph coloring problem, the bandwidth coloring problem, and the multi-coloring problem. On the most general extension, which is the bandwidth multicoloring problem, our method provides the current best results.

References
1. 2. 3. 4. 5. 6. 7. 8. J. C. Culberson, and F. Luo, 1993. Exploring the k-colorable Landscape with Iterated Greedy, [1] pp. 245-284. F. Glover, M. Parker, and J. Ryan, 1993. Coloring by Tabu Branch and Bound, [1] pp. 285-307. D. S. Johnson, and M. A. Trick (eds), 1996. Cliques, Coloring, and Satisfiability: Second DIMACS Implementation Challenge, Vol. 26 of DIMACS Series in Discrete Mathematics and Theoretical Compute Science. American Mathematical Society. D. E. Joslin, and D. P. Clements, 1999. Squeaky Wheel Optimization, Vol. 10 of Journal of Artificial Intelligence Research, pp. 353-373. G. Lewandowski, and A. Condon, 1993. Experiments with Parallel Graph Coloring Heuristics and Applications of Graph Coloring, [1] pp. 309-334. C. Morgenstern, 1993. Distributed Coloration Neighborhood Search, [1] pp. 335-357. S. Prestwich, 2002. Constrained Bandwidth Multicoloration Neighbourhoods, Computational Symposium on Graph Coloring and its Generalizations, Cornell University, Ithaca, NY USA. M. A. Trick. Computational Symposium: Graph Coloring and its Generalizations, http://mat.gsia.cmu.edu/COLORING02.

Kyoto, Japan, August 2528, 2003

You might also like