On feasible and infeasible search for equitable graph coloring

An equitable legal k-coloring of an undirected graph G = (V, E) is a partition of the vertex set V into k disjoint independent sets, such that the cardinalities of any two independent sets differ by at most one (this is called the equity constraint). As a variant of the popular graph coloring problem (GCP), the equitable coloring problem (ECP) involves finding a minimum k for which an equitable legal k-coloring exists. In this paper, we present a study of searching both feasible and infeasible solutions with respect to the equity constraint. The resulting algorithm relies on a mixed search strategy exploring both equitable and inequitable colorings unlike existing algorithms where the search is limited to equitable colorings only. We present experimental results on 73 DIMACS and COLOR benchmark graphs and demonstrate the competitiveness of this search strategy by showing 9 improved best-known results (new upper bounds).

the equity constraint of a coloring. e equitable coloring problem (ECP) in graphs involves nding an equitable legal k-coloring with k minimum for general graphs. is minimum k is called the equitable chromatic number of G and denoted by χ e (G).
As a variant of the conventional graph coloring problem (GCP), the decision version of the ECP is NP-complete. is can be proved by a straightforward reduction from graph coloring to equitable coloring by adding su ciently many isolated vertices to a graph and testing whether the graph has an equitable coloring with a given number of colors [8]. e ECP model has a number of practical applications related to garbage collection [25], load balancing [3], timetabling [16], scheduling [7,15,24] and so on.
Much e ort has been devoted to theoretical studies of the ECP. For example, Meyer conjectured that χ e (G) ≤ ∆(G) for any connected graph except the complete graphs and the odd circuits, where ∆(G) is the maximum vertex degree of G [24]. is conjecture has been proved to be true for trees and graphs with ∆(G) = 3 [6], connected bipartite graphs [20], graphs with the average degree at most ∆/5 [18] and outerplanar graphs [17]. Bodlaender and Fomin [4] identi ed that the ECP can be solved in polynomial time for graphs with bounded treewidth. Furmańczyk and Kubale investigated the computational complexity of the ECP for some special graphs [9]. Yan and Wang discussed the ECP for kronecker products of the complete multipartite graphs and complete graphs [26].
From a perspective of solution methods for the ECP in the general case, several exact algorithms have been proposed. Speci cally, Bahiense et al. presented a branch-and-cut algorithm based on a formulation by representatives [1] and showed computational results only on a set of small random instances (with 60 vertices). Méndez-Díaz et al. investigated a polyhedral approach [22] and a Dsatur-based algorithm [23] and presented computational results for a subset of benchmark instances from the DIMACS and COLOR competitions.
Given the computational challenge of the ECP, exact algorithms su er inevitably from an exponential time complexity and thus are only applicable to graphs of limited sizes (typically with less than 150 vertices). To handle larger graphs, heuristic algorithms are o en used to nd sub-optimal solutions in a reasonable time frame. e rst heuristics are based on greedy constructive principles [8]. More recently, two powerful heuristics were proposed, which are based on the tabu search method: TabuEqCol [21] and BITS [19]. TabuEqCol is a straightforward adaptation of the well-known Tabu-Col algorithm designed for the classical graph coloring problem [10,14]. BITS improves TabuEqCol by embedding a backtracking scheme under the iterated local search framework.
We observe that unlike the popular graph coloring problem for which many heuristic algorithms have been proposed, research on heuristics for the ECP is quite limited and is still in its infancy. In particular, one important feature of the problem identi ed by its equity constraint is not explicitly explored by the existing algorithms, which visit equity-feasible solutions only. On the other hand, it is well known that for constrained optimization problems (like the ECP), allowing a controlled exploration of infeasible solutions may facilitate transitions between structurally di erent solutions and help discover high-quality solutions that are di cult to locate if the search is con ned to the feasible region [12].
In this work, we present a feasible and infeasible search algorithm for the ECP which enlarges the search to include equity-infeasible solutions. To prevent the search from going too far away from the feasible boundary, we devise an extended penalty-based tness function which is used to guide the search for an e ective examination of candidate solutions. We show computational results on a set of 73 benchmark graphs from the DIMACS and COLOR competitions to assess the interest of the proposed approach. ese results include especially 9 improved best solutions (new upper bounds) which can be used to assess other algorithms for the ECP in the future. e remainder of the paper is organized as follows. Section 2 introduces some preliminary de nitions. Section 3 is dedicated to the description of the proposed algorithm. Section 4 presents computational results and comparisons with state-of-the-art algorithms. Section 5 analyzes the impact of some key components of the proposed algorithm. Conclusions and future work are discussed in the last section.

BASIC DEFINITIONS
We introduce the following basic de nitions which are useful for the description of the proposed approach, where G = (V , E) is a given graph.
De nition 2.1. A candidate coloring of G is any partition of the vertex set V into k subsets V 1 , V 2 , . . . , V k , where each V i is called a color class.

De nition 2.2.
A legal coloring is a con ict-free coloring composed of independent sets, i.e., any pair of vertices of any color class are not linked by an edge in E. Otherwise, it is an illegal or con icting coloring.
De nition 2.3. An equitable coloring or equity-feasible solution is any candidate coloring satisfying the equity constraint, i.e., the cardinalities of any two color classes di er by at most one. Otherwise, it is an equity-infeasible solution.

GENERAL APPROACH
e equitable coloring problem (ECP) involves nding the smallest number of colors k such that an equitable legal k-coloring exists for a given graph G. Like for the conventional GCP [11], the ECP can be approximated by nding a series of equitable legal k-colorings for decreasing k values. To seek an equitable legal k-coloring for a given k, one typically explores the space of equity-feasible colorings while minimizing a tness function f which counts the number of con icting edges [19,21]. e ECP problem with a given k is called the k-ECP problem.
is study follows this general approach of solving a series of k-ECP problems. However for each xed k, our algorithm explores candidate solutions which include both equity-feasible and equityinfeasible colorings. For this, our feasible and infeasible search algorithm (FISA) introduces an extended tness function F which is employed to measure the quality of any candidate solution.
e proposed FISA algorithm is composed of two search phases (see Sections 3.1 and 3.2). e rst phase examines only the space of equity-feasible colorings to seek a legal (i.e., con ict-free) kcoloring. If a legal k-coloring is found, the k-ECP problem is solved with the current k value and we continue with the new k-ECP problem by se ing k = k − 1. To be e ective, the rst phase is based on the basic tabu search procedure of the BITS algorithm [19]. If the rst phase fails to nd a legal k-coloring with the equityfeasible space, the second phase is invoked to enlarge the search to include equity-infeasible colorings. To explore the enlarged search space, this second phase relies on the extended tness function F to guide the search process. e infeasible search phase terminates if an equitable coloring is found or if the best solution found so far cannot be improved during 10000 consecutive iterations. e pseudo-code of the FISA algorithm is given in Algorithm 1. e algorithm starts with an initial equity-feasible solution which is generated with a simple greedy heuristic presented in [19]. In the next sections, we explain the search strategies of both phases of the FISA algorithm.  [19] e rst phase of the proposed FISA algorithm searches the space of candidate solutions which veri es the equity constraint and tries to nd a legal k-coloring. is is achieved by minimization of the number of con icting edges of candidate equitable k-colorings, an edge is con icting if its endpoints belong to the same color class.
3.1.1 Equity-feasible space and fitness function. We de ne the equity-feasible space Ω k to be the set of all candidate colorings verifying the equity constraint. Formally, Ω k is given by To assess the quality of a candidate solution s in Ω k , the evaluation or tness function counts the number of con icting edges in the color classes of s. Speci cally, let s = {V 1 , V 2 , . . . , V k } ∈ Ω k be a candidate solution, let C (V i ) denote the set of con icting edges with both endpoints in V i . e tness function f (which is to be minimized) is given by erefore, a solution s with f (s) = 0 is an equitable legal kcoloring satisfying both the equity and coloring constraints. When such a solution is found, the associated k-ECP problem is solved. e feasible search phase of the FISA algorithm uses this tness function to guide its search process to visit solutions of Ω k in order to obtain a solution s with f (s) = 0.
3.1.2 Move operators to explore space Ω k . To explore the space Ω k , the feasible search phase applies two move operators to generate neighboring solutions from the current solution. Let s = {V 1 , V 2 , . . . , V k } be the current solution. Let C (s) denote the set of con icting vertices involved in the con icting edges of s.
(1) One-move operator: It transfers a con icting vertex from its current color class V i to a di erent color class V j ensuring that the equity constraint is always respected, i.e., We use s⊕ < , V i , V j > to denote the neighboring solution generated by applying the move to s. en the neighborhood N 1 induced by this move operator contains all possible solutions obtained by applying "one-move" to s, i.e., Note that the one-move operator is not applicable if n k = n k . In this case, the neighborhood N 1 is empty.
(2) Swap operator: It exchanges a con icting vertex of color class V i with another vertex u of color class V j (i j). Let swap( , u) denote such a move. e neighborhood N 2 induced by the swap operator is composed of all possible solutions obtained by applying "swap" to s (recall that C (s) is the set of con icting vertices of s).
Since this operator does not change the cardinality of any color class, a neighboring solution generated by this operator is always equity-feasible (given that the current solution is an equitable k-coloring).

Exploration of the space Ω k .
Starting from an equitable (con icting) k-coloring of Ω k , the rst phase of FISA iteratively improves the solution according to the tabu search method [13]. Speci cally, the basic tabu search procedure (TS 0 ) described in [19] is applied to nd a con ict-free k-coloring. At each iteration, a best admissible candidate solution is taken among the neighboring solutions of N 1 and N 2 to replace the current solution. e underlying move (< , V i , V j > for one-move or swap( , u)) is recorded in the so-called tabu list in order to forbid the reverse move for a xed number of next iterations. is tabu search process continues until either a solution s with f (s) = 0 is found in which case, the current k-ECP problem is solved, or the current solution is not improved during a xed number of consecutive iterations in which case the FISA algorithm moves to the second search phase.

Searching equity-infeasible solutions
When the rst phase fails to identify an equitable legal k-coloring within the equity-feasible space Ω k , the FISA algorithm invokes the second phase to explore an enlarged space Ω + k including both equity-feasible and equity-infeasible solutions.
3.2.1 Equity-infeasible space and extended fitness function. e enlarged search space Ω + k explored by the second phase contains all possible partitions of the vertex set V into k disjoint subsets as follows.
We note that this enlarged search subsumes the equity-feasible space Ω k and additionally includes the equity-infeasible solutions.
To evaluate the quality of the solutions of Ω + k , we devise an extended penalty-based tness function F . For this purpose, we rst introduce some notations. Let W + = n/k and W − = n/k , which represent respectively the theoretical cardinality of the largest and smallest color classes in an equitable k-coloring. en for an equitable k-coloring s = V k } be a candidate solution in Ω + k , we de ne the penalty ρ i (i = 1, · · · , k ) for each color class V i of the solution s to be the gap between |V i | and the theoretical cardinalities as follows.
en we de ne our extended tness function F (to be minimized) as a linear combination of the basic tness function f (Equation (2)) and a penalty function as follows.
where C (V i ) is the set of con icting edges in color class V i and φ (a parameter with φ ≥ 1) is the penalty coe cient which is used to control the importance given to the penalty function (see Section 5.1 for an analysis of φ). According to this de nition, a candidate solution violating strongly (weakly) the equity constraint will be penalized more harshly (slightly). Since in general the number of con icting edges (the rst term) of F decreases quickly when the search progresses, the penalty term has the desirable property of helping the search process to avoid infeasible solutions which are too far from the feasibility boundaries. Note that the penalty term of an equitable coloring equals 0. erefore, a partition s ∈ Ω + k with F (s) = 0 corresponds to a equitable and legal k-coloring, i.e., satisfying both the equity and coloring constraints and is thus a solution to the k-ECP problem.
3.2.2 Move operators to explore the space Ω + k . To explore the search space Ω + k , the infeasible search phase also applies two move operators to generate neighboring solutions. Let s = {V 1 , V 2 , . . . , V k } be the current solution. Let C (s) denote the set of con icting vertices of s, i.e., the vertices involved in a con icting edge.
(1) One-move operator: Like for the rst search phase, this operator displaces a con icting vertex from its current color class V i to another color class V j . However, the equity constraint is no more considered. is leads to the following enlarged neighborhood.
To e ectively calculate the move gain which identi es the change in the tness function F (Equation (7), we adapt the fast incremental evaluation technique of [19]. e main idea is to maintain a matrix A of size n × k with elements A[ ][q] recording the number of vertices adjacent to in color class V q (1 ≤ q ≤ k ). Another n × k matrix B is maintained with elements B[ ][q] representing the penalty value of vertex assigned to color class q in the current solution. en, the move gain of each one-move in terms of extended tness variation can be conveniently computed by where φ is the penalty coe cient used in the extended tness function F . Each time a one-move operation involving vertex is performed, we just need to update a subset of values a ected by this move as follows. For each vertex u adjacent to vertex , , if w and u belong to the same color class.
(2) Swap operator: e same swap operator as for the rst phase is applied to exchange a pair of vertices (u, ) from di erent color classes where at least one of them is a conicting vertex. However, there is an important di erence. Since the second search phase operates in the enlarged space Ω + k instead of Ω k , the equity-feasibility of a neighboring solution fully depends on the current solution. at is, if the current solution is equity-infeasible (equity-feasible), application of swap leads to an equity-infeasible (equityfeasible) solution. e resulting swap-based neighborhood is thus given as follows.
where C (s) is the set of con icting vertices of s. Notice that the swap operation has no impact on the penalty value of the neighboring solution and can only change the number of con icting edges. en the tness gain of a swap operation can be computed by where e ,u = 1 if and u are adjacent vertices, otherwise e ,u = 0.

Exploration of the enlarged space
To explore the enlarged space Ω + k , we apply again the tabu search method. Specically, each iteration of tabu search selects the best admissible solutions among the neighboring solution of N + 1 and N + 2 . e procedure makes transitions between various k-coloring while minimizing the extended tness function F with the purpose of a aining a solution s with F (s) = 0.

Perturbation of infeasible search. e tabu list used by
the equity-infeasible exploration phase helps the search process to go beyond some local optima. Yet, this mechanism may not be su cient to escape deep traps. To overcome this problem, we apply a perturbation procedure inspired by the procedure of [19].
is operator follows the perturbation scheme of breakout local search [2] and combines directed and random applications of the one-move and swap operators. To avoid a too strong deterioration of the perturbed solution, a directed perturbation move takes into consideration the tness variation and performs the most favorable move (i.e., deteriorating the solution the least). In contrary, a random perturbation performs a one-move or swap operation without considering the tness deterioration. To combine these two types of perturbations, the number of performed moves dynamically varies in an adaptive way while the application of each type of perturbation is determined probabilistically. e resulting solution from the perturbation procedure is then used as the new starting solution of the next round of the infeasible search phase.

EXPERIMENTAL RESULTS AND COMPARISONS
In this section, we assess the performance of the proposed FISA algorithm on the set of 73 benchmark instances which are commonly used in the literature and were initially proposed for the DIMCAS and COLOR competitions for graph coloring problems 1, 2 .

Experiment settings
e proposed algorithm was coded in C++ and compiled by GNU g++ 4.1.2 with -O3 ag (option). e experiments were conducted on a computer with an Intel Xeon E5-2670 processor (2.5 GHz and 2 GB RAM) running Ubuntu 12.04. When solving the DIMACS Table 1: Comparative results of FISA with state-of-the-art algorithms on the 73 benchmark instances.
TabuEqCol [21] BITS [19] FISA Instance |V | LB [22,23] UB [22,23]  machine benchmark procedure 'dfmax.c' 3 without compiler optimization ag, the run time on our computer is 0.46, 2.68 and 10.70 seconds for graphs r300.5, r400.5 and r500.5, respectively. For our comparative study, we use the most recent heuristic algorithms [19,21] as our references. e TabuEqCol algorithm (2014) [21] was run on an Intel i5 CPU with 750 2.67 GHz and tested under a time limit of 1 hour. e BITS algorithm (2015) [19] was run on an Intel Xeon E5440 CPU with 2.83 GHz and 2 GB RAM and tested under a time limit of 1 hour and a relaxed limit (10 4 seconds for the instances with up to 500 vertices and 2 × 10 4 seconds for larger instances with more than 500 vertices). As shown in [19], the computational results of the more recent BITS algorithm dominate those of TabuEqCol. We also include the lower and upper bounds reported in [22,23] which were obtained by exact methods under various test conditions. ese bounds provide useful information when they are contrasted with the results (upper bounds) obtained by the compared heuristic algorithms (TabuEqCol, BITS and FISA). e FISA algorithm requires the tuning of some parameters related to tabu search and the extended tness function F . Since our tabu search procedures are adaptations of the basic tabu search procedure of [19], we adopted the parameter se ings used in the original paper. As to the penalty coe cient φ of the extended tness function F , we provide an analysis in Section 5.
Following [19,21], we present a rst experiment where we ran our FISA algorithm only once per instance with a cuto time of 3,600 seconds (1 hour). Like [19], we carried out a second experiment where we ran FISA 20 times to solve each instance under the extended stopping condition -10 4 seconds for the instances with up to 500 vertices and 2 × 10 4 seconds for larger instances with more than 500 vertices. We note that our Intel Xeon E5-2670 2.5 GHz processor is slightly slower than those used by the reference algorithms. As a result, our adopted stopping conditions can be considered as reasonable with respect to those used by the reference algorithms. Finally, as shown in [19], the main reference BITS algorithm fully dominates the TabuEqCol algorithm. So the results of BITS have the most signi cant reference value.

Comparison with state-of-the-art algorithms
From instances (see negative entries in Column ∆(k 1 )), the same best results for other 58 instances and one worse result. When comparing FISA with BITS under the long time condition (the results of TabuEqCol under this condition are unavailable), one observes that FISA also performs very well (Columns 7 and 9). Speci cally, FISA improves the best results of BITS for 9 instances (see negative entries in Column ∆(k best ) while matching the best results of BITS for other 63 instances. Only in one case, FISA obtains a slightly worse result.

ANALYSIS
is section performs additional experiments to analyze the proposed FISA algorithm: the penalty coe cient φ and the perturbation strategy. ese experiments were performed on a selection of 26 instances which are relatively di cult according to the results reported in Table 1, i.e., the best-known results of these instances cannot be a ained by all algorithms.  is section investigates the in uence of the penalty coe cient φ on the performance of the proposed algorithm (Section 3.2, Equation 7). For this purpose, we tested FISA with 3 di erent values of φ = 1, 2, 3. We ran 20 times the algorithm with each φ value to solve each selected instance with a cuto time of 1 hour. e experimental results are presented in Table 2. e rst column shows the names of instances, and the second column indicates the best results (k * 1 ) obtained in this experiment. e results of FISA with di erent φ values are respectively listed in columns 3 to 5 including the best values with the averaged values between parentheses. e rows #Equal and #Worse respectively indicate the number of instances for which each φ values a ains an equal and worse result compared to k * 1 . We note that the best results were obtained with φ = 1. is justi es the se ing of this parameter used in our previous experiments.

Impact of the perturbation operation
As shown in Section 3.2.4, the proposed algorithm uses a perturbation strategy to ensure a global diversi cation within the enlarged search space Ω + k . In order to assess this strategy, we compare it with a traditional restart strategy (denoted as REST), where each restart begins its search with a new equitable k-coloring generated by the greedy procedure mentioned in Section 3. e two algorithms were run 20 times on the 26 selected instances with a time limit of 1 hour per run. e results of this experiment are shown in Table 3. Column 1 lists the names of instances. Column 2 indicates the best results (k * best ) obtained in this experiment. e best results (k best ) and the average results (k a ) of FISA and REST are respectively listed in columns 3 to 6. e rows #Equal and #Worse respectively indicate the number of instances for which FISA and REST a ain an equal and worse result compared to k * best . It is clear that FISA dominates the REST variant by obtaining 12 be er results out of the 26 tested instances and no worse result. is experiment con rms thus the interest of the adopted perturbation strategy.

CONCLUSIONS
e equitable coloring problem (ECP) is an NP-hard problem with a number of practical applications. In addition to the conventional coloring constraint (i.e., adjacent vertices must receive di erent colors), a solution of the ECP must satisfy the equity constraint (the cardinalities of the color classes must di er by at most one). In this work, we investigated the bene t of examining both feasible and infeasible solutions with respect to the equity constraint. e resulting algorithm (called FISA) combines an equity-feasible search phase where only equitable colorings are considered and an equityinfeasible search phase where the search is enlarged to include nonequitable solutions. To guide the search procedure (which is based on tabu search), we devised an extended tness function which uses a penalty to discourage candidate solutions which violates the equity constraint. A perturbation procedure was also used as a means of diversi cation to help the algorithm to explore new search regions.
We assessed the performance of the FISA algorithm on the set of 73 benchmark instances from DIMACS and COLOR competitions and presented comparative results with respect to state-of-the-art algorithms.
e comparisons showed that FISA performs very well by discovering 9 improved best results (new upper bounds) and matching the best-known results for the remaining instances except one case. e new bounds can be used for assessment of other ECP algorithms. is study demonstrates the bene t of the mixed search strategy examining both equity-feasible and equityinfeasible solutions for solving the ECP.
For future work, several directions could be followed. First, the penalty term of the extended tness function could be improved by introducing adaptive techniques like [5,12] to enable a strategic oscillation for dynamically transitioning between feasible and infeasible space. Second, other search operators (rather than those used in this work) can be sought to further improve the performance of the search algorithm. ird, the proposed algorithm could be advantageously integrated into a hybrid population-based method (e.g., memetic search, path-linking) as a key intensi cation component. Finally, the instances tested in this work are based on the conventional DIMACS coloring benchmark graphs. ese graphs can be considered as being limited in size with respect to massive graphs obtained from a number of modern applications like complex networks and biological networks. Contrary to DIMACS graphs, these massive graphs are typically very sparse with very low edge density. It would be interesting to investigate the ideas of this work in the context of coloring massive graphs.