A Branch and Price Algorithm for List Coloring Problem

by   Mauro Lucci, et al.
Universidad Nacional de Rosario

Coloring problems in graphs have been used to model a wide range of real applications. In particular, the List Coloring Problem generalizes the well-known Graph Coloring Problem for which many exact algorithms have been developed. In this work, we present a Branch-and-Price algorithm for the weighted version of the List Coloring Problem, based on the one developed by Mehrotra and Trick (1996) for the Graph Coloring Problem. This version considers non-negative weights associated to each color and it is required to assign a color to each vertex from predetermined lists in such a way the sum of weights of the assigned colors is minimum. Computational experiments show the good performance of our approach, being able to comfortably solve instances whose graphs have up to seventy vertices. These experiences also bring out that the hardness of the instances of the List Coloring Problem does not seem to depend only on quantitative parameters such as the size of the graph, its density, and the size of list of colors, but also on the distribution of colors present in the lists.



There are no comments yet.


page 1

page 2

page 3

page 4


2-distance list (Δ+2)-coloring of planar graphs with girth at least 10

Given a graph G and a list assignment L(v) for each vertex of v of G. A ...

Choosability in bounded sequential list coloring

The list coloring problem is a variation of the classical vertex colorin...

Multilayer Random Sequential Adsorption

In this work, we present a variant of the multilayer random sequential a...

A Grover search-based algorithm for the list coloring problem

Graph coloring is a computationally difficult problem, and currently the...

Estudo comparativo de meta-heurísticas para problemas de colorações de grafos

A classic graph coloring problem is to assign colors to vertices of any ...

Sliding Window Temporal Graph Coloring

Graph coloring is one of the most famous computational problems with app...

Scatterplot Selection Applying a Graph Coloring Problem

Scatterplot selection is an effective approach to represent essential po...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

The Graph Coloring Problem (GCP) models a wide range of planning problems such as timetabling, scheduling, electronic bandwidth allocation and sequencing. Some applications require to impose additional constraints to the GCP, giving rise to known variants such as Equitable Coloring, Precoloring Extension, -coloring and List Coloring, see e.g. [1, 2]. Actually, List Coloring generalizes GCP, Precoloring Extension and -coloring and has several specific applications such as channel allocation in wireless networks [3]. In many practical situations, colors have different weights (or costs) and it is required to find the coloring of minimum weight instead of minimum cardinality. Particularly, in [4], the design of workdays of drivers in a public transport company is modeled as a Minimum Weighted List Coloring Problem (MWLCP).

Let be an undirected simple graph and be a set of colors. A coloring of is a function such that for every edge of . Given a coloring of , the class color of , denoted by , is the set of vertices colored by , i.e. such that . Clearly, each class color is a stable set of and, therefore, any coloring can be thought as a partition of vertices into stable sets. The active colors of a coloring , denoted by , are those ones assigned to some vertex, i.e. . The GCP consists of finding a coloring of with minimum cardinality of . This minimum is called the chromatic number of , denoted by , and it is known that obtaining this number is -hard for general graphs.

Despite its hardness, the need of obtaining concrete solutions to numerous applications motivated the development of several exact algorithms for GCP: combinatorial branch-and-bound such as DSATUR [5, 6], branch-and-cut BC-COL [7] and branch-and-price LPCOLOR [8, 9, 10].

In the case of BC-COL, an Integer Linear Programming (ILP) compact formulation (

GCP-CF from now on) based on classic vertex-color assignment variables is used. Instead, LPCOLOR is based on set-covering ILP formulation (GCP-SC from now on), where each variable represents a stable set of . As the number of variables is usually exponential in the size of , the resolution of the linear relaxation of GCP-SC is addressed by a column generation procedure.

In List Coloring, each vertex has a preassigned list defining those colors that can be assigned to . Formally, a list coloring of is a coloring of with the additional condition that for all . Note that classic colorings of are list colorings for which for all .

Given a vector

, the MWLCP consists of finding a list coloring of such that the sum of weights of the active colors, i.e. , is minimum. As colorings of can be thought as particular cases of list colorings, MWLCP can be seen as a generalization of a weighted version of GCP. However, this weighted version can be trivially reduced to GCP since one can pick the cheapest colors from to obtain the coloring of minimum weight.

Clearly, MWLCP is -hard in general graphs since it generalizes GCP. However, some known results reveal that MWLCP is indeed harder than GCP.

As a first remark, unlike GCP, which is feasible whenever , MWLCP can be infeasible even if for all . A well-known example is presented in Figure 1 where the available colors for each vertex are enclosed in braces.

Figure 1: An infeasible instance

Actually, asking whether has a list coloring is -complete even when restricted to instances where the size of lists is at most 3 and is a cograph or complete bipartite [11]. In contrast, GCP can be solved on cographs and bipartites in linear time.

Another example where these problems differ in difficulty is when graphs are parameterized by treewidth. For a given graph with fixed treewidth , there is a dynamic programming algorithm that finds in polynomial time, while asking if has a list coloring is W[1]-Hard [12].

Formulation GCP-CP (resp. GCP-SC) mentioned above can be extended to the MWLCP in such a way that they coincide when applied to instances of GCP. In this work, we present these extended ILP formulations, respectively called MWLCP-CP and MWLCP-SC, and we develop a Branch-and-Price algorithm to solve MWLCP via MWLCP-SC, by following some ideas provided in [8]. However, we have to take into account some additional issues that arise from the difference between GCP and MWLCP. In GCP every vertex can be colored with any element of and all colors have the same weight, thus making the colors indistinguishable from each other. Clearly, this property is not met for MWLCP forcing us to consider one for each stable set and each color in MWLCP-SC. In spite of that, we designed a mechanism to take advantage of those cases where the indistinguishability between colors is partially met. Feasibility is another issue, as mentioned before.

In Section 2, we formally present the ILP formulations MWLCP-CP and MWLCP-SC. In Sections 3 and 4, we explain the main components that define our Branch-and-Price algorithm: the way LP relaxations are solved, how columns are generated and how the node branching is performed. In Section 5, computational experiments are conducted to evaluate the performance of our algorithm over random instances of different sizes and types. Finally, in Section 6, some conclusions are drawn.

2 ILP formulations for MWLCP

Consider an instance of the MWLCP, given by a graph , a set of colors with weights for each and lists for each vertex . W.l.o.g we can assume that is connected and .

For each color , let , be the subgraph of induced by , be the set of isolated vertices in and be the set of maximal stable sets of .

The first formulation is based on GCP-CF [7]

. We have a binary variable

, for each and , such that its value is 1 if and only if , and binary variables such that if is an active color in . Then, the MWLCP can be formulated as follows:


Constraints (1) ensure that each vertex is assigned a color, (2) impose that no pair of adjacent vertices receive the same color (when that color is used), and (3) control the activation of when is an isolated vertex in .

The second ILP model corresponds to a formulation of colorings as covering of vertices by stable sets, based on GCP-SC. Here, we have a binary variable for each and each stable set . Observe that, for any color , its color class is a stable set from and, unlike GCP, no more than one maximal stable set of can be used by the covering. The following ILP model arises naturally:


Constraints (4) say that, for each vertex , at least one stable set containing is selected, while (5) allow to take at most one stable set for each color.

However, this formulation does not properly generalize GCP-SC in the sense that an instance of GCP gives rise to a model with many more variables than GCP-SC. As we have said in the introduction, GCP-SC takes advantage of the indistinguishability between colors. In order to overcome this drawback, we say that two colors are indistinguishable if and . Let and be a partition of where . In other words, each is a color that represents those ones from .

Now, we can take advantage of the symmetry between those colors and allow the existence of at most stable sets of instead of a single one. Moreover, if , such constraint can be removed since there is an optimal solution verifying this condition. Now, the MWLCP can be re-formulated:


Therefore, for instances corresponding to GCP, we have and . If, in addition, , constraints (7) are no longer needed and our last formulation turns out to be the same as GCP-SC.

3 Solving LP relaxations of MWLCP-SC

Given an instance of MWLCP, let . The variables of the linear relaxation of MWLCP-SC are for and its constraints can be written as , and where, for every variable , the corresponding column in is the characteristic vector of and the columns in have a non-zero entry, , in the row corresponding to . Moreover, for each , . Note that constraints of the form are not necessary (non-negative weights ensure that at least one optimal solution verifies these conditions).

For any , let be the vector of variables restricted to and be the linear relaxation of MWLCP-SC restricted to . We first give some results concerning the integrability of solutions of the LP relaxation.

Let be an optimal solution of and let . If is integral then has an optimal integer solution. Consider the partition of where and . Clearly, is an optimal solution for . Since is integral, variables from are set to 1. Then, by replacing occurrences of those variables by 1 in , we obtain a linear program over variables , such that is an optimal solution for . Observe that the stable sets represented by variables in are singletons.

Let and be the submatrices of and corresponding to constraints (6) and (7) in , respectively. Since columns of are characteristic vectors of singleton stable sets, they have one positive entry equal to 1. Similarly, columns of have at most one negative entry equal to -1, thus implying that the matrix of coefficients of is totally unimodular. Therefore, there exist integer optimal solutions for and also .

Note that when every is complete, stable sets are singletons and in the statement of the previous lemma. Then, we obtain:

If, for all , is a complete graph, then has an integral optimal solution.

Actually, the result given in the previous corollary can be also derived from a reduction of MWLCP to the Minimum Weighted Perfect Matching Problem on Bipartite Graphs, described below.

Consider an instance of MWLCP such that is a complete graph for all . Observe that each color can be assigned to at most one vertex. Then, we can assume that (otherwise, MWLCP would be infeasible). Let be a set of dummy elements such that .

Now, consider the bipartite graph with vertex partition defined by and , and such that for all and , is an edge of if and only if . The weight of is . We also consider edges for all and with weight zero. Clearly, if is a list coloring of , there exists a perfect matching of containing edges for all and edges for all and some taken from the non-active colors in . The weight of this perfect matching coincides with the weight of the list coloring. Conversely, for any perfect matching of , edges for every define a list coloring of with the same weight that . Moreover, has a perfect matching if and only if MWLCP is feasible.

In practice, this problem can be addressed much faster via the Hungarian Algorithm than by solving the LP relaxation.

3.1 Column generation

Let , be an optimal solution of , and be the optimal dual solution of , where and are the dual variables corresponding to constraints (6) and (7), respectively (for those such that , we assume ). Note that, for any , the reduced cost of is .

We recall that the obtained from

by padding zeros, i.e. 

, is feasible for but not necessarily optimal. In order to know that, we have to decide if there exists such that or, equivalently, to solve the following auxiliary problem:

(Aux)      such that ?

Clearly, (Aux) is equivalent to solve, for each , the Maximum Weighted Stable Set Problem (MWSSP) on with weight for each .

Despite the MWSSP is -hard, the enumerative routine given in [9] shows to be reasonably fast when it is called by the branch-and-price algorithm. In addition, it is not always necessary to solve the MWSSP to optimality. One can stop the optimization as soon as a set with weight greater that the threshold is found.

Moreover, if we have and for some , there is no need to run the enumerative routine for since the stable set found for can be reused for .

Although finding one column is enough for the column generation process, preliminary experiments have shown that incorporating many columns at the same time decreases the number of iterations of the process and, thus, the overall time. In our implementation, we search for (if exists) an entering variable per .

Observe that the column generation process needs to start with a set for which is feasible. We recall that, unlike GCP, to know if an instance of MWLCP is feasible is an -complete problem and the best algorithm that finds a list coloring, whenever it exists, is [13]. In the following section we propose an initialization procedure.

3.2 Initializing the linear relaxations

Our approach consists in extending the solution space by creating a dummy color per vertex. Given an instance of MWLCP we generate an extended instance where , for all and for all , where is a big number (e.g. ). In addition, for all .

Now, the linear relaxation obtained from the instance is trivially feasible since for all is a feasible solution which allows us to start our column generation process. That is, .

It is expected that dummy colors will no longer be used as optimization proceeds. In fact, if some dummy color is still active in the optimal solution of the relaxation associated to the extended instance , then is infeasible.

Preliminary experiments have revealed that starting with dummy colors is better than a feasible initial coloring, when the latter can be generated (there are heuristics algorithms that deliver list colorings, such as

-Greedy-List [14]). We speculate the cause of this may be that the initial columns yielded by such colorings are of poor quality, thus making the LP solver to perform more iterations.

Since our column generation process is embeeded in a Branch-and-Price framework, the subproblems we have to solve for each node of the B&B tree should correspond to new instances of the MWLCP. To achieve that purpose, we need to devise a robust branching rule. In the next section we present such a rule, adapting the one first proposed in [15] and used in [8] for the GCP.

4 A robust branching rule

The idea behind the rule given in [8] is to pick two non-adjacent vertices and and divide the space of solutions between those ones satisfying (both share the same color) and those others satisfying . Finding the optimal coloring in the latter case is equivalent to solve GCP on a graph obtained by adding edge to . In the former case, one has to solve GCP on a graph obtained from by collapsing vertices and into a single one (that is, connecting to every vertex from and removing , where is the open neighborhood of in ).

We follow the same strategy, with the additional condition that vertices and must satisfy . Indeed, finding the optimal list coloring of with is equivalent to solve MWLCP for the instance where , whereas finding the optimal with is equivalent to solve MWLCP for the instance where and is connected to every vertex from , for all and .

Note that, in a finite number of applications of the previous rule, we get instances where all graphs are completes. At that point, the optimal solutions of their LP relaxations are integers by Corollary 3.

In addition, due to the intersection performed to obtain , it is likely to reach subproblems whose instances have a vertex with a singleton list. Since such vertex is forced to be colored with the unique available color for it, the instance can be preprocessed according to the following result: Let be an instance of the MWLCP such that for some and . Solving is equivalent to solve MWLCP for an instance where , for all and for all . If is an optimal list coloring of then , for all is an optimal list coloring of . Instead, if is infeasible, is also infeasible.

It only remains to specify a criterion for selecting vertices and , which we address below.

4.1 Branching variable selection strategy

In [8], a simple but efficient rule is proposed. We explain it briefly in terms of our formulation for the case (superscripts are omitted). Assume that is a non-integer optimal solution of the LP relaxation. The authors first search for the most fractional variable, i.e. an that minimizes , and pick . Since and (6) holds for , there exists another such that and . Then, they search for the first vertex such that and, due to the fact that stable sets are different from each other, such exists and it is not adjacent to .

In our case, we search for the most fractional satisfying and we pick . Lemma 3 guarantees the existence of such stable set (otherwise, the solution would be integral). Now we need a pair different from such that and . If such exists, we pick . Otherwise, we pick . In this way, we can assert that and are non-adjacent and satisfy the pre-condition since they must have colors or in their lists.

5 Computational results

This section is devoted to analyze the performance of the proposed Branch-and-Price algorithm over randomly generated instances, with number of vertices

and edge probability


Cardinality of and distribution of colors in the lists are ruled by two parameters and . The former is used to set . The latter, which we refer to as membership-to-list probability, is the probability that a color belongs to , for each

. Weights are set to 1 for all colors. Random numbers are yielded by an uniform distribution.

The experiment consists of comparing two approaches, which we call CPLEX-CF and BP-SC. In the former, the ILP solver of CPLEX (with default parameters) solve the MWLCP-CF formulation. The latter is our Branch-and-Price algorithm, which was manually implemented in C++ and uses CPLEX only for the resolution of LP relaxations. In order to speed up the generation of subproblems, we copy and perform minimum changes to the data structure where the instance lies. This saves time since it is not necessary to re-compute the partition of the set of colors nor the subgraphs among them from scratch. Lemma 4 is applied during this stage. Then, subproblems are solved in a depth-first search fashion. Regarding the pricing routine, we traverse graphs according to the value in decreasing order, in order to avoid solving the MWSSP over the same graph more than once. On the other hand, our current implementation does not use the Hungarian Algorithm for the relaxations related to Corollary 3. This feature will be incorporated in a future version.

The experiment is carried out by a desktop computer equipped with an AMD Phenom II X4 3.4 GHz (a single thread is used), 3.6 GB of memory, Ubuntu 16.04 operating system, GCC 5.4.0 and IBM ILOG CPLEX 12.7 as the integer and linear programming solver. A time limit of 1 hour is imposed on solving each instance.

Results are summarized in Table 1. In each row, averages over 5 instances generated with the same combination of values are reported: averages of CPU time (in seconds) for CPLEX-CF and BP-SC with best times highlighted, and average of number of nodes explored by BP-SC. Only instances solved to optimality within the time limit are considered in the averages. For those cases when at least one of the 5 instances is not solved, the number of solved ones is reported in brackets. If none of them is solved, a symbol “–” is displayed.

= 0.25 = 0.50 = 0.75
nodes time time nodes time time nodes time time
50 0.25 0.5 47 0.3 0.3 233 8.5 22.0 55 2.9 1235.9
1.0 475 5.4 1.2 792 33.6 660.3 53 4.2
1.5 88 1.3 4.2 87 3.3 454.8 56 5.2
0.50 0.5 46 0.4 0.6 159 4.2 400.9 50 2.1
1.0 57 0.7 2.5 238 8.1 507.8 45 2.9
1.5 211 3.6 6.2 63 2.5 623.4 37 3.5
0.75 0.5 39 0.3 0.5 26 0.5 27.0 16 0.6
1.0 22 0.2 0.4 23 0.6 53.1 13 0.8
1.5 30 0.4 0.8 19 0.7 64.1 15 1.3
60 0.25 0.5 107 1.4 0.8 230 8.6 106.0 895 143.7
1.0 627 14.1 8.0 95 7.1 789.9 184 28.6
1.5 261 8.7 30.1 631 102.3 - 726 177.6
0.50 0.5 43 0.7 1.6 132 4.9 596.5(2) 487 49.2
1.0 249 5.5 25.9 71 4.1 - 457 68.6
1.5 113 3.4 34.3 121 10.9 - 408 86.1
0.75 0.5 51 0.6 0.9 33 1.3 1686.6(3) 35 2.3
1.0 43 0.8 3.1 34 1.8 - 40 3.9
1.5 32 0.8 2.9 45 2.5 - 33 4.7
70 0.25 0.5 8467 223.6 4.6 388 55.8 1154.8(3) 71 19.1
1.0 2669 68.5 88.7 3167 590.0(2) 95 32.6
1.5 4814 281.7(3) 894.0 1853 230.5(3) 101 43.0
0.50 0.5 523 14.7 82.3 2333 188.5 166 34.1
1.0 1506 59.3 632.6(4) 200 14.9 153 50.4
1.5 661 26.1 1703.6 1506 11.0 161 71.3
0.75 0.5 59 1.2 4.3 68 3.2 45 5.0
1.0 64 1.7 30.7 40 3.3 45 8.3
1.5 77 2.6 94.5 52 4.9 46 11.8
Table 1: Results on random graphs (average of 5 instances per row).

As we can see from the table, BP-SC achieves a remarkable performance, being able to solve to optimality 98% of the instances (397 of 405). In particular, all instances with 50 and 60 vertices can be solved in a couple of minutes. The same behavior is observed when increasing the number of vertices to 70 and considering an edge probability of 0.5 or 0.75 (medium to high density). In contrast, instances with edge probabilities of 0.25 (low density) are occasionally harder to solve, except when membership-to-list probability is high.

Note that the number of explored nodes is low, pointing out that the linear relaxations provide tight bounds and the node selection strategy is enough good, but also the resolution of each relaxation is very time consuming.

Regarding CPLEX-CF, we notice that it outperforms BP-SC in barely 5% of the cases. These cases usually have low density graphs and lists with a small amount of colors, and makes MWLCP-CF become smaller in number of variables and constraints. On the other hand, the lower the density of the graph, the harder the resolution of the MWSSP on graphs (whose tend to be sparse).

Last but not least, both approaches evidence perturbations in the performance not only when varying number of vertices and density but also when changing the structure of the lists of colors. In the case of BP-SC, this behavior seems to be unpredictable. Even when we fix the number of vertices, edge probability and membership-to-list probability, the performance does not always get worse as the number of colors increases.

6 Conclusions

In this work, we present a Branch-and-Price algorithm to solve the weighted version of the List Coloring Problem, which has many applications and generalizes several other coloring problems. In order to achieve that, we propose an ILP formulation, a column generation process and a robust branching scheme based on the ones given in [8] for the GCP. In particular, when restricting to instances coming from GCP, our approach behaves just like LPCOLOR. However, other aspects should have been taken into account, such as the feasibility and the lack of indistinguishability between the colors. As far as we are concerned, this is the first exact algorithm based on ILP for this problem.

The computational experiments show that our algorithm has a remarkable performance, being able to solve to optimality randomly generated instances up to 70 vertices and within a time limit of 1 hour. Our results also expose that the hardness of the instances does not seem to depend only on the generation parameters (, , and ), but also on the distribution of colors present in the lists. In this respect, we believe that further research still remains to be done. Particularly, it should be studied how the structure of graphs , i.e. size, density and overlap (number of vertices they share each other), influence the performance of the Branch-and-Price algorithm. A better understanding of tough instances can help to detect improvement opportunities in our algorithm.

In future works, we plan to evaluate the performance of our algorithm over other types of instances. For example, by adding different weights to colors, varying the number of indistinguishable colors, using instances coming from applications (see e.g. [4]) and other coloring problems (e.g. Precoloring Extension, -coloring) or by creating instances from benchmark graphs such as the ones from COLORLIB (DIMACS).


  • [1] Kubale, M., Graph Colorings, American Mathematical Society (2004).
  • [2] Bonomo, F., G. Durán, J. Marenco, Exploring the complexity boundary between coloring and list-coloring, Ann. Oper. Res. 169 (2009), 3–16.
  • [3] Wang, W., and X. Liu, List-coloring based channel allocation for open-spectrum wireless networks, IEEE 62nd Vehicular Technology Conference, Dallas, TX, USA (2005), 690–694.
  • [4] Lucci, M., G. Nasini, and D. Severín, Planning the Workday of Bus Drivers by a Graph List-Coloring Model, Electronic Journal SADIO 17 (2018), 77–91.
  • [5] Brélaz, D., New Methods to Color the Vertices of a Graph, Commun. ACM 22 (1979), 251–256.
  • [6] San Segundo, P., A new DSATUR-based algorithm for exact vertex coloring, Comp. Oper. Res. 39 (2012), 1724–1733.
  • [7] Méndez-Díaz, I., and P. Zabala, A cutting plane algorithm for graph coloring, Discr. Appl. Math. 156 (2008), 159–179.
  • [8] Mehrotra, A., and M. Trick, A Column Generation Approach for Graph Coloring, INFORMS J. Comput. 8 (1996), 331–437.
  • [9] Held, S., E. Sewell, and W. Cook, Safe Lower Bounds For Graph Coloring, Lect. Notes Comput. Sc. 6655, 261–273.
  • [10] Malaguti, E., M. Monaci, and P. Toth, An exact approach for the Vertex Coloring Problem, Discr. Optim. 8 (2011), 174–190.
  • [11] Golovach, P., M. Johnson, D. Paulusma, and J. Song, A Survey on the Computational Complexity of Coloring Graphs with Forbidden Subgraphs, J. Graph Theory 84 (2017), 331–363.
  • [12] Cygan, M., F. Fomin, L. Kowalik, D. Lokshtanov, D. Marx, M. Pilipczuk, M. Pilipczuk, and S. Saurabh, Parameterized Algorithms, Springer International Publishing (2015).
  • [13] Bjorklund, A., T. Husfeldt, and Mikko Koivisto, Set partitioning via inclusion-exclusion, SIAM Journal Comput. 39 (2009), 546–563.
  • [14] Achlioptas, D., and M. Molloy, The analysis of a list-coloring algorithm on a random graph, 38th Annual Symposium on Foundations of Computer Science, Miami, FL, USA (1997), 204–212.
  • [15] Zykov, A. A., On some properties of linear complexes, Matematicheskij Sbornik 24 (1949), 163–188.