A Dynamically Turbo-Charged Greedy Heuristic for Graph Coloring
Faisal N. Abu-Khzam, Bachir M. Chahine

TL;DR
This paper presents a dynamic, turbo-charged heuristic for graph coloring that combines turbo-charging with greedy algorithms, significantly improving solution quality and efficiency through novel dynamic techniques.
Contribution
It introduces a dynamic version of the graph coloring problem and enhances turbo-charging with new dynamic concepts like moment of regret and rollback points.
Findings
The heuristic often produces exact solutions.
It outperforms other heuristics in experiments.
The approach is effective and efficient.
Abstract
We introduce a dynamic version of the graph coloring problem and prove its fixed-parameter tractability with respect to the edit-parameter. This is used to present a {\em turbo-charged} heuristic for the problem that works by combining the turbo-charging technique with other standard heuristic tools, including greedy coloring. The recently introduced turbo-charging idea is further enhanced in this paper by introducing a dynamic version of the so called {\em moment of regret} and {\em rollback points}. Experiments comparing our turbo-charging algorithm to other heuristics demonstrate its effectiveness. Our algorithm often produced results that were either exact or better than all the other available heuristics.
| Graph | DYN-TC | RCC | |
|---|---|---|---|
| DSJC125.5 | (17) | 19 | 20 |
| DSJC250.5 | (28) | 30 | 33 |
| DSJC500.5 | (48) | 55 | 56 |
| DSJC1000.5 | (84) | 93 | 98 |
| DSJR500.1 | 12 | 12 | 12 |
| DSJR500.5 | (123) | 126 | 131 |
| R125.1 | 5 | 5 | 5 |
| R125.5 | 36 | 36 | 38 |
| R250.1 | 8 | 8 | 8 |
| R250.1c | 64 | 64 | 64 |
| Flat300_20_0 | 20 | 24 | 21 |
| Flat300_26_0 | 26 | 31 | 37 |
| Flat300_28_0 | 28 | 33 | 37 |
| Flat1000_50_0 | 50 | 92 | 96 |
| Flat1000_60_0 | 60 | 92 | 96 |
| Flat1000_76_0 | 76 | 93 | 97 |
| Graph | DYN-TC | Greedy | |
|---|---|---|---|
| DSJC125.5 | (17) | 19 | 26 |
| DSJC250.5 | (28) | 30 | 43 |
| DSJC500.5 | (48) | 55 | 72 |
| DSJC1000.5 | (84) | 93 | 127 |
| DSJR500.1 | 12 | 12 | 15 |
| DSJR500.5 | (123) | 126 | 143 |
| R125.1 | 5 | 5 | 5 |
| R125.5 | 36 | 36 | 44 |
| R250.1 | 8 | 8 | 9 |
| R250.1c | 64 | 64 | 76 |
| Flat300_20_0 | 20 | 24 | 47 |
| Flat300_26_0 | 26 | 31 | 45 |
| Flat300_28_0 | 28 | 33 | 46 |
| Flat1000_50_0 | 50 | 92 | 126 |
| Flat1000_60_0 | 60 | 92 | 125 |
| Flat1000_76_0 | 76 | 93 | 122 |
| Graph | DYN-TC | TABU-S | |
|---|---|---|---|
| DSJC125.5 | (17) | 19 | 19 |
| DSJC250.5 | (28) | 30 | 31 |
| DSJC500.5 | (48) | 55 | 53 |
| DSJC1000.5 | (84) | 93 | 93 |
| DSJR500.1 | 12 | 12 | 12 |
| DSJR500.5 | (123) | 126 | 126 |
| R125.1 | 5 | 5 | 5 |
| R125.5 | 36 | 36 | 39 |
| R250.1 | 8 | 8 | 8 |
| R250.1c | 64 | 64 | 65 |
| Flat300_20_0 | 20 | 24 | 26 |
| Flat300_26_0 | 26 | 31 | 34 |
| Flat300_28_0 | 28 | 33 | 33 |
| Flat1000_50_0 | 50 | 92 | 90 |
| Flat1000_60_0 | 60 | 92 | 91 |
| Flat1000_76_0 | 76 | 93 | 91 |
| Graph | DYN-TC | |
|---|---|---|
| DSJC1000.1 | (20) | 20 |
| LE450_25C | 25 | 25 |
| LE450_25D | 25 | 25 |
| R1000.1C | (98) | 98 |
| C2000.5 | (146) | 150 |
| C4000.5 | (260) | 266 |
| queen11_11.col | (11) | 11 |
| queen12_12.col | (?) | 14 |
| queen13_13.col | (13) | 15 |
| zeroin.i.1.col | (49) | 49 |
| zeroin.i.2.col | (30) | 33 |
| zeroin.i.3.col | (30) | 33 |
| miles250.col | 8 | 8 |
| miles500.col | 20 | 21 |
| miles1000.col | 42 | 45 |
| miles1500.col | 73 | 75 |
| Graph | Search-Tree | DYN-TC |
|---|---|---|
| ash608GPIA | 5 | 5 |
| DSJC1000.1 | 25 | 20 |
| DSJC500.1 | 15 | 15 |
| latin_square_10 | 117 | 116 |
| le450_15a | 16 | 16 |
| qg.order40 | 41 | 41 |
| queen16_16 | 19 | 19 |
| school1_nsh | 23 | 21 |
| wap03 | 50 | 50 |
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsScheduling and Timetabling Solutions · Vehicle Routing Optimization Methods · Advanced Graph Theory Research
A Dynamically Turbo-Charged Greedy Heuristic for Graph Coloring
Faisal N. Abu-Khzam
Department of Computer Science and Mathematics
Lebanese American University
Beirut, Lebanon
Bachir M. Chahine
Department of Computer Science and Mathematics
Lebanese American University
Beirut, Lebanon
Abstract
We introduce a dynamic version of the graph coloring problem and prove its fixed-parameter tractability with respect to the edit-parameter. This is used to present a turbo-charged heuristic for the problem that works by combining the turbo-charging technique with other standard heuristic tools, including greedy coloring. The recently introduced turbo-charging idea is further enhanced in this paper by introducing a dynamic version of the so called moment of regret and rollback points. Experiments comparing the presented turbo-charging algorithm to other (non-turbo-charged) heuristics demonstrate its effectiveness. Our algorithm often produced results that were either exact or better than all the other available heuristics.
1 Introduction
A -vertex coloring of an undirected graph is a mapping from to that assigns different values, or colors, to every pair of adjacent vertices. The minimum value of for which such a mapping exists is the chromatic number of , often denoted by . The corresponding Graph Coloring problem (AKA. Chromatic Number problem) consists of finding or, in its search version, a vertex coloring that assigns colors to a given graph .
Graph Coloring is among the most studied graph theoretic problems, perhaps because of the famous Four Color Theorem [6] as well as its wealth of applications in various domains especially scheduling and frequency assignment problems [18].
On the other hand, a dynamic problem is one whose input is assumed to have changed after some initial “satisfactory” solution was found. Formally, a dynamic version of a problem takes as input a quintuple where and are instances of and is a solution to , not necessarily optimal. The instances and are at a given edit distance , termed the edit-parameter. The question posed is whether a solution to , also not necessarily optimal, can be obtained such that the Hamming distance between and is bounded by , which we refer to henceforth as the increment-parameter. This notion of a dynamic problem was introduced by Downey et al. in the context of Dominating Set [11]. It was preceded (and inspired) by the work of Hartung and Niedermeier on the List Coloring problem [15].
Capitalizing on the above mentioned work and the more recent work in [4] on dynamic versions of a number of domination and vertex-deletion problems, we study a dynamic version of the Graph Coloring problem (henceforth DGC). In particular, we show that Dynamic Graph Coloring is fixed-parameter tractable with respect to the edit-parameter and para--hard with respect to the increment parameter. Furthermore, we show that our fixed-parameter algorithm for DGC can be used to obtain a turbo-charged heuristic for the Graph Coloring problem.
In this paper, the Turbo-Charging idea is further improved by introducing a dynamic version of the moment of regret notion. This also yields a dynamic version of rollback. The effectiveness of this approach is evaluated by comparing our experimental results with those of some of the most known graph coloring heuristic algorithms, and for which the published results include tests on the benchmark graphs from the DIMACS Graph Coloring Challenge. Our experiments show that the turbo-charged heuristic outperforms known Graph Coloring heuristics and can sometimes achieve results that are close to optimal.
2 Preliminaries
Throughout this paper we consider only simple undirected graphs, i.e., no loops and no multiple edges. Given a graph , and (or and ) denote the set of vertices and edges in , respectively. The degree, , of a vertex is the number of edges incident on . A vertex cover in a graph is a subset of such that every edge of has at least one endpoint in .
The Graph Coloring problem is among the first few classical problems shown to be -hard in [13] and [14]. It is also known to be para- hard when parameterized by the number of colors in a target solution [12]. In other words, when the objective is to color the input graph with at most colors, the problem is “hard” to solve in time.
The current asymptotically-fastest exact algorithm solves Graph Coloring in , where is the number of vertices in the input graph [7]. There are a number of known heuristic methods that aimed at possibly coping with the problem’s computational intractability, for practical purposes. Moreover, there are a few meta-heuristic methods to which our turbo-charging method is not applicable. We will thus refrain from providing an overview of the meta-heuristic approaches but we provide comparison with the most effective tabu search for which experimental results are known on the instances considered in our experiments [8].
The most known heuristic method is the greedy algorithm which takes an ordering of the vertices and, for each vertex, assigns the smallest color not yet assigned to a neighboring vertex. An improved method uses a heuristic which changes the ordering of nodes and then uses the same greedy approach. The most used ordering is Largest Degree First (LF) [22] and a random selection as tie breaker when two nodes have the same largest degree.
Another known heuristic approach is based on the following observation: if the next greedy coloring step requires the assignment of a new color to a vertex, then attempt to swap colors in the graph in order to free one of them for that vertex and then assign to it the smallest possible color. This old “recoloring” approach appeared in [20]. It is known as the Greedy-With-Interchange method.
Finally, the Range Compaction Heuristic [5] is another (more recent) heuristic that can be considered as an iterated-greedy approach. It starts with a proper coloring and iteratively tries to narrow the range of colors used by up-coloring low-valued colors and down-coloring high-valued ones using some randomized limits. This method has some randomization built into it and works with re-coloring. The main objective is a time for quality trade off.
We shall use a simple greedy approach that rebuilds the input graph by adding one edge at a time. Initially one color is assigned to all vertices, then colors are added when needed. The order of edge addition is obviously the key to effective coloring (by which we mean assigning a smallest-possible number of colors). Our choice of this naive method is affected by applicability of the turbo-charging method as described in [2, 11]. Despite the simplicity of the base heuristic method, its turbo-charged variant proved to be most effective when compared to the known heuristics.
3 Dynamic Graph Coloring
The parameterized Dynamic Graph Coloring is defined formally as follows.
**Dynamic Graph Coloring (DGC)
Input: A graph with a -coloring ; a graph obtained from with edit-distance .
Parameters: and/or .
Question: Does there exist a -coloring of ?**
An instance of DGC would be a quintuple and it is assumed that the sought coloring is obtained by at most re-coloring operations. This parameterized re-coloring approach appears to be similar to the notion of parameterized reconfiguration (see [21] for more details) except that we start by an improper coloring of and we want to employ at most (local) changes to obtain a proper coloring.
Remark 1**.**
The increment parameter is often defined as the Hamming distance between the initial solution (for ) and the sought solution. This is based on the assumption that any change to the initial solution has a cost. In our case, changing a color or adding a new color would have the same cost. Therefore whenever we have a conflict, instead of solving it by re-coloring the vertices of the graph, it would be better to just add a new color. This justifies the way we pose the question in our above formulation of DGC.
Theorem 1**.**
Dynamic Graph Coloring is fixed-parameter tractable with respect to the edit-parameter.
Proof.
Let be an instance of Dynamic Graph Coloring. Obviously, at most vertices are affected by the edge additions. According to the previous remark, would be at most which is the maximum number of additional needed colors. Observe, however, that at most of the affected vertices need a new color. In fact, the subgraph induced by the newly added edges has a minimal vertex cover of size at most and by Remark 1, it would be enough to add colors to the vertices forming a minimum vertex cover since their deletion eliminates all conflicts. Note (again) that we seek to minimize the number of changes made to the coloring . Finding a “minimum” vertex cover of size at most is solvable in time using the fixed-parameter algorithm of Chen et al. [9]. Of course we would have to apply the latter algorithm at most times. ∎
On the other hand, Dynamic Graph Coloring parameterized only by the increment parameter, , is not likely to fall in the class FPT.
Theorem 2**.**
Dynamic Graph Coloring parameterized by the increment parameter is para- hard.
Proof.
Since the edit-distance is arbitrary in this case, we can reduce the Graph Coloring problem to its dynamic version as follows. Let be an arbitrary instance of Graph Coloring. We construct an equivalent instance of Dynamic Graph Coloring by letting be an edge-less graph on vertices, , is a coloring that assigns a unique color to all vertices of , and . Obviously, is -colorable if and only if we can find a coloring such that . The theorem now follows from the fact that, unless , Graph Coloring is not even in the class [12]. ∎
4 A Dynamic Turbo-Charging Algorithm
The turbo-charging technique introduced by Downey et al in ****[11]**** uses a simple greedy heuristic to apply the fixed-parameter algorithm for the dynamic version of the Dominating Set problem. In our approach, we will be working on a “turbo-charged” greedy heuristic to apply the fixed-parameter algorithm for the dynamic version of Graph Coloring with some additional improvements to the turbo-charging method.
**As mentioned earlier, our algorithm starts off with an edge-less graph by assigning color 1 to all the vertices (we may also start with a colored graph but this could possibly reduce the effectiveness of our approach). As we add the edges of the input graph, we add at most one color at a time when necessary. In fact, edge addition is best performed in a way that avoids color-conflict as much as possible. For this purpose a greedy edge-ordering that tries to minimize conflicts between consecutive edges is employed. Before we fully describe the turbo charging part of our algorithm, we introduce two new parameters. **
4.1 Dynamic moment of regret.
The moment of regret is reached when the solution exceeds the expected result or budget and it is no longer feasible/desired. Usually it is set to a static value (as defined in ****[11]****), but we henceforth use a new dynamic value which will be dependent on the current state of the algorithm in terms of edge number and chromatic number.
At each point in time we keep track of the number of edges added to the graph and the number of colors added. Taking the total number of edges remaining to be added to the graph into consideration, a (dynamic) moment of regret parameter is set to a fraction of the number of colors added per “group of edges” added. For example, we might be fine with adding 5 colors after adding 100 edges, while adding 3 colors after adding 10 edges might not be acceptable. Therefore our moment of regret is a fraction of the number of colors added per number of edges added.
Formally, let be the current total number of assigned colors and let be the number of edges added after assigning color . Let
.
Moreover, let be the number of colors assigned by the best-known heuristic. Then our moment of regret is reached when .
4.2 Dynamic rollback point.
When a dynamic moment of regret is reached, we need to rollback to a specific point where the solution was “acceptable.” In other words we take back a number of edge additions and we restore the coloring saved up to that point. To determine this number, we keep track of the variation of the graph coloring function. In particular we keep track of an interval where the function is slowly varying or varying at an acceptable rate. We call this interval the stable interval. The right endpoint of the stable interval is called the dynamic rollback point and it is updated also after each application of the turbo-charging subroutine. Then, instead of undoing a static number of edge additions (as in the original turbo-charging method), we take back edge additions until we reach the dynamic rollback point.
4.3 A turbo-charged greedy approach
Whenever a new edge is added, either the edge does not create any coloring conflict and no new color need to be assigned, or the edge addition creates a conflict and a new color is needed. In both cases, the algorithm proceeds in a greedy approach, and adds the least possible color available that does not create a conflict. Note that our algorithm assumes a new color is needed when it is not possible to change the color of one of the two endpoints.
After each color-addition, the algorithm checks if the defined dynamic regret point is reached. If not, it proceeds with the next edge addition. Otherwise it performs a dynamic rollback option, removing the previously added edges until some dynamic backup point, then the (fixed-parameter) dynamic problem subroutine (DGC_FPT) is called to determine if a smaller solution can be found. The subroutine will take both graphs before and after the dynamic rollback process, the current coloring and the current edge index, in addition to the current coloring reduced by one as input parameters in an attempt to reduce the current coloring by at least one color. A pseudocode of this algorithm is given below.
We observed that, after each moment of regret, the FPT subroutine often decreases the coloring by at least one color. As shown in the previous section, the running time of the subroutine is in , but in our case could be small and the number of times we call the FPT subroutine is bounded above by (a fraction of) the number of colors. Despite the additional processing time, we almost always have a better coloring, which is the main objective of the turbo-charging method.
In the next section, the reported preliminary experimental results show how the dynamic turbo-charging method, applied to the above simple greedy heuristic, was consistently effective by enhancing all the known results obtained using heuristic methods.
5 Experimental Analysis
Our algorithm was tested on several benchmarks from the DIMACS graph coloring instances. Due to the successive applications of our fixed-parameter (turbo-charging) subroutine, the algorithm is slower than the usual efficient heuristic methods but it takes only a few seconds in general. We compare the results (number of colors) obtained by our algorithm to those obtained by the most known heuristics. For this purpose, a subset of the DIMACS graph coloring benchmarks was chosen to maximize the overlap with the published results of heuristic methods. The obtained results are reported in the tables below. The values for the chromatic number are placed in parentheses when they are the lowest values reported in the literature but not proven to be the minimum.
Table 1 below provides a comparison between the results obtained by our turbo-charged heuristic, referred to by “DYN-TC,” and the Range Compaction Coloring heuristic (RCC) from ****[5]****. As the table shows, our turbo-charged heuristic either matches or obtains better results than the RCC method on all the test cases.
Table 2 shows the comparison between our approach and the (folklore) greedy heuristic. The reported results show tremendous improvements in terms of number of colors obtained.
Table 3 presents a comparison between our approach and the Tabu-Search meta-heuristic, referred to by “TABU-S,” introduced in ****[16]**** and later improved in ****[10]****. Despite the fundamental difference between the two methods, especially because of the fact that turbo-charging does not seem applicable to meta-heuristics, our approach proves to be competitive, often reducing the resulting number of colors. Moreover, while we could not perform a comparison between running times, our turbo-charging method showed a smooth increase in running time when the graph size increases, while the TABU-S’s reported running time increase in a more abrupt manner as the graph size gets bigger.
Knowing that the previously stated heuristics do not tackle many instances, we proceed to comparing the results of our algorithm against the optimal solutions especially on DIMACS graphs where we could not find published results obtained by previous heuristics. Table 5 below shows the results of the comparison. Obviously, the number of colors obtained by our algorithm are always close or equal to the best known solutions.
The results in the above tables show that, on average, our heuristic improves the current minimum known estimate of the chromatic number of almost all input instances when compared to other heuristics. It is interesting to note that, despite the iterative application of our dynamic fixed-parameter algorithm, the overall running time of our algorithm is increasing in a conditioned and proportional manner depending on the number of vertices (unlike TABU-S for example, which exhibits a sudden and somehow unexpected increase in running time). As mentioned above, our running times are higher since we are employing a fixed-parameter algorithm at certain time intervals. Despite this fact, our algorithm was computing a better result on most of the test cases and sometimes we obtain close-to-optimal (if not optimal) results with better running times. A notable result is the new best-known solution we report in Table 5 for the DIMACS instance named queen12_12.col.
Finally, we note again that a similar approach that inspired the work on dynamic problems was presented in ****[15]**** for the List Coloring problem. In fact, an enhanced heuristic algorithm for Graph Coloring was presented and a few experiments were reported. We conducted experiments on the same set of graphs used in ****[15]****. While our Turbo-charging algorithm is notably slower due to the repetitive use of our FPT subroutine at each moment-of-regret, it can sometimes reduce the number of colors further, as shown in the below table.
6 Conclusion
Capitalizing on recent work on turbo-charging heuristics, this paper has presented a novel turbo-charged heuristic for graph coloring that is based on proving that Dynamic Graph Coloring is fixed-parameter tractable with respect to the edit parameter. We evaluated our turbo-charged heuristic on a broad range of DIMACS benchmark graphs and compared results with the most known heuristics on a selected number of instances. Preliminary results reported in this paper show a consistent improvement over the greedy heuristics in addition to occasional improvement over the most known meta-heuristic.
We have introduced an enhanced dynamic turbo-charging approach that consists of varying the moment of regret threshold based on problem specific constraints. It would be interesting to study the effect of this new approach on other turbo-charged heuristics such as those studied in ****[2]**** as well as other problems for which an FPT dynamic version exists, such as those studied in ****[11]****, ****[3]****, ****[4]**** and ****[17]****.
Finally, we have studied for the first time a parameterized dynamic version of a graph partitioning problem. Previous work has focused mainly on problems whose solutions are subsets of the respective sets of vertices in given input graphs. Our fixed-parameter algorithm for Dynamic Graph Coloring can be easily adapted to solve Dynamic Clique Cover and to obtain a turbo-charged heuristic for the problem. It would be interesting to study the application of this turbo-charging method to similar graph partitioning problems. In fact, a dynamic version of the Cluster Editing problem (CE) was recently introduced and studied in ****[19]****. It would also be interesting to extend this work to the multi-parameterized version introduced in ****[1]**** and to possibly apply our enhanced turbo-charging method to such graph partitioning problems.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] F. N. Abu-Khzam. On the complexity of multi-parameterized cluster editing. J. Discrete Algorithms , 45:26–34, 2017.
- 2[2] F. N. Abu-Khzam, S. Cai, J. Egan, P. Shaw, and K. Wang. Turbo-charging dominating set with an FPT subroutine: Further improvements and experimental analysis. In Theory and Applications of Models of Computation - 14th Annual Conference, TAMC 2017, Bern, Switzerland, April 20-22, 2017, Proceedings , pages 59–70, 2017.
- 3[3] F. N. Abu-Khzam, J. Egan, M. R. Fellows, F. A. Rosamond, and P. Shaw. On the parameterized complexity of dynamic problems with connectivity constraints. In Z. Zhang, L. Wu, W. Xu, and D. Du, editors, Combinatorial Optimization and Applications - 8th International Conference, COCOA 2014, Wailea, Maui, HI, USA, December 19-21, 2014, Proceedings , volume 8881 of Lecture Notes in Computer Science , pages 625–636. Springer, 2014.
- 4[4] F. N. Abu-Khzam, J. Egan, M. R. Fellows, F. A. Rosamond, and P. Shaw. On the parameterized complexity of dynamic problems. Theor. Comput. Sci. , 607:426–434, 2015.
- 5[5] R. H. Andrea Di Blas, Arun Jagota. A range-compaction heuristic for graph coloring. Journal of Heuristics , 9:489–506, 2003.
- 6[6] K. Appel and W. Haken. The solution of the four-color-map problem. Scientific American , 237(4):108–121, 1977.
- 7[7] A. Björklund, T. Husfeldt, and M. Koivisto. Set partitioning via inclusion-exclusion. SIAM J. Comput. , 39(2):546–563, 2009.
- 8[8] M. Chams, A. Hertz, and D. de Werra. Some experiments with simulated annealing for coloring graphs. European Journal of Operational Research , 32:260–266, 1987.
