Noname manuscript No. (will be inserted by the editor)
New heuristics for the vertex coloring problem based on semidefinite programming Jelena Govorˇ cin · Nebojˇ sa Gvozdenovi´ c · Janez Povh
Received: date / Accepted: date
Abstract The Lov´ asz theta number [7] is a well-known lower bound on the chromatic number of a graph G, and ΨK (G) is its impressive strengthening [4]. The bound ΨK (G) was introduced in very specific and abstract setting which is tough to translate into usual mathematical programming framework. In the first part of this paper we unify the motivations and approaches to both bounds and rewrite them in a very similar settings which are easy to understand and straightforward to implement. In the second part of the paper we provide explanations how to solve efficiently the resulting semidefinite programs and how to use optimal solutions to get good coloring heuristics. We propose two vertex coloring heuristics based on ΨK (G) and present numerical results on medium sized graphs. Keywords semidefinite programming · vertex coloring problem · boundary point method Mathematics Subject Classification (2000) 90C22 · 13J30 14P10 · 47A57 · 08B20
Supported by the Serbian Ministry of Education and Science (projects III 44006 and OI 174018), Supported by the Slovenian Research Agency (bilateral project no. BI-SR/10-11-040) J. Govorˇ cin and J. Povh Fakulteta za informacijske ˇstudije v Novem mestu, Novi trg 5, 8000 Novo mesto, Slovenia E-mail:
[email protected],
[email protected] N. Gvozdenovi´ c Univerzitet u Novom Sadu, Ekonomski fakultet Subotica, Segedinski put 9-11, 24000 Subotica, Serbia E-mail:
[email protected]
2
Jelena Govorˇ cin et al.
1 Introduction Let G(V, E) be a simple (i.e., loopless and undirected) graph, where V denotes the set of vertices of G, and E the set of edges of G. Since we represent graphs by matrices, we assume that vertex set is V = {1, 2, ..., n}. We assume that edges, the elements of E, are simply sets of vertices with two elements. We also write ij for the set {i, j}. Symmetric matrix X is positive semidefinite (denoted by X 0), if all its eigenvalues are non-negative. A function c : V → {1, ..., C} such that ij ∈ E ⇒ c(i) 6= c(j)
(1)
is a graph C-coloring. Subset S ⊆ V is stable, if no pair of vertices in S is connected by an edge, i.e., i, j ∈ S ⇒ ij ∈ / E. Vertices colored by a same color s therefore form the stable set c−1 (s). So a vertex C-coloring forms a partition of the vertex set into C stable sets, and the vertex coloring problem is to find such a partition with the smallest cardinality χ(G). Some formulations of χ(G) and their SDP relaxations. Given a simple graph G(V, E), V = {1, ..., n}, and a C-coloring c we can assign to each stable set c−1 (s), 1 ≤ s ≤ C, its characteristic vector xs ∈ {0, 1}n , defined coordinatewise by 1, if c(i) = s, xsi := (2) 0, otherwise, P where i = 1, . . . , n. The coloring matrix X := s xs (xs )> has the following obvious properties Xij ∈ {0, 1} for all i, j ∈ V,
(3)
Xii = 1 for all i ∈ V,
(4)
Xij = 0 for all ij ∈ E,
(5)
X 0,
(6)
and rank(X) = C. In fact any X satisfying (3)-(6) represents a legal coloring [3]. Following standard homogenization procedure [7, 5, 9] we rather add to the matrix X the zeroeth row and column (which do not represent any vertex), and study the matrices > C X 1 1 C e> ˜ X= := · s xs x e X
(7)
s=1
where e denotes the vector of all ones. ˜ 0. In fact, it is easy to see [3] that Obviously X > ˜ = min t | t e C = rank(X) 0, X feasible for (3) − (5) . e X
(8)
Heuristics for the vertex coloring problem
3
Therefore χ(G) = min t > ˜= te s. t. X 0 e X ˜ feasible for (3) − (5). X
(9)
Removing binary constraint (3) yields the Lov´asz Θ function([7, 3, 4]) Θ(G) = min t t e> ˜ s. t. X = 0, e X (ΘSDP ) Xij = 0 for all ij ∈ E, Xii = 1 for all i ∈ V, a well-known relaxation of the chromatic number. ˜ be an optimal solution of (ΘSDP ). Karger, Motwani and Sudan [6] Let X were the first to define a heuristic with the theoretical upper bound on the number of colors needed to legally color a graph based on (ΘSDP ). Their result was recently improved by Arora and Chlamtac [1]. A pair i, j ∈ V is likely to be colored by the same color by heuristic from [6] only when Xij is large. A recursive variant of the heuristic performs well on medium sized graphs [3], and benefits from strengthening SDP bound (ΘSDP ) toward χ(G). 1.1 Contribution The contribution of this paper consists of the following results: (a) We introduce in Section 2 the ΨK operator from [4] following the same approach and notation as for the Θ function. This is new and makes the idea behind ΨK clear and transparent and naturally suggests how to extract the information from the optimal solution of the semidefinite program underlying ΨK to obtain a good coloring. (b) We explain in Section 3 the complexity of computing the ΨK operator, propose the boundary point method from [8, 10] to compute ΨK and demonstrate the quality of the ΨK bound for different sizes of K. (c) We propose two heuristic algorithms which generate good colorings from the optimal solution of ΨK , and demonstrate their quality by numerical results on medium size graphs. 2 Function ΨK (G) Let K ⊂ V be a clique in G, i.e., a set of pairwise connected vertices. W.l.o.g. we may assume K = {1, . . . , k}, i.e., each pair of the first k vertices of V forms an edge, for some k < n. We define for a given coloring c the moment coloring vectors y s ∈ {0, 1}(1+k)(1+n) , 1 ≤ s ≤ C based on the clique K as y s := [1, xs1 , . . . , xsn , xs1 , xs1 xs1 , xs1 xs2 , . . . , xs1 xsn , . . . xsk , xsk xi1 , . . . , xsk xsn ]> ,
(10)
4
Jelena Govorˇ cin et al.
where xs is from (2). For easier referencing to elements of y s we label components of y s by monomials of order 2 in (commutative) variables z0 := 1, z1 , . . . , zn : z 2 , z0 z1 , . . . , z0 zn , z1 z0 , z12 , z1 z2 , . . . , z1 zn , . . . , zk z0 , zk z1 , . . . , zk zn . | {z } {z } | {z } |0 k-th block 0-th block 1-st block For any n-tuple of values (xs1 , . . . , xsn ) we have yzsp zq = yzsq zp , 0 ≤ p ≤ k, 0 ≤ q ≤ n. Nota that [xs1 , . . . , xsn ] are 0/1 vectors and since we fix z0 = 1 we the following equations hold for every y s : yzsp2 = yzs0 zp These equations imply that some components from y s are redundant in numerical implementations. We next define the following matrix
Y :=
C X
y s (y s )> 0
(11)
s=1
It has a (k + 1) × (k + 1) block structure Y 00 Y 01 Y 10 Y 11 Y = . .. .. . Y k0 · · ·
· · · Y 0k · · · Y 1k .. .. . . · · · Y kk
(12)
where blocks are actually indexed by z0 , . . . , zk and each block is an (n + 1) × ij denotes the (zp , zq )-th (n + 1) matrix (indexed again by z0 , . . . , zn ). Hence Ypq 00 ˜ element in (zi , zj )-th block. Notice that Y = X from (7). Proposition 1 The entries of the matrix Y defined in (11) satisfy the following properties Y 0 ij Ypq Yii00 ij Ypq ij Ypq 0i
Y
(13)
∈ {0, 1} ∀ i, j, p, q, i + j + p + q 6= 0;
(14)
= 1, ∀ i, i 6= 0;
(15)
= 0, if {i, j, p, q} contains an edge; =
0 0 Ypi0 qj0 ii
0
0
0
0
if {i, j, p, q} = {i , j , p , q };
= Y , where 1 ≤ i ≤ k;
ij Ypq = 1, if all the vertices in {i, j, p, q} bear the same color;
(16) (17) (18) (19)
Heuristics for the vertex coloring problem
5
Proof Property (13) follows by construction. For all i ∈ V we set x0i = 1. ij Now a zp zq entry of a vector y s reads yzsp zq = xsp xsq . This implies Ypq = PC s s 2 s s s s s=1 xi xj xp xq . This proves (17) and (18) since (xj ) = xj for all s = 0, 1, ..., C 00 and j ∈ V . Next, Y00 = C, while for the remaining entries, we have that {i,j,p,q} contains at least one vertex. If all vertices in {i,j,p,q} are in the same ij ij color class then Ypq = 1, otherwise Ypq = 0. On the other hand we have a similar result as for the matrix X from the Lov´ asz theta number formulation above. Proposition 2 Let Y be a block matrix as in (12) with blocks indexed by z0 , . . . , zk and each block indexed by z0 , . . . , zn . Let C := rank(Y 0 ), where Y 0 00 is obtained from Y by erasing the row/column indexed by z0 . If Y00 = C and the entries of Y satisfy (13)-(18), then there exists a unique graph coloring (up PC to color permutations) c : V → {1, 2, ..., C} such that Y = s=1 y s (y s )> 0, where vectors y s are defined via (2) and (10). Proof Consider first the block Y 00 of the matrix Y . From (15) and (17) we have Yii00 = Yi000 = Y0i00 = 1. If i, j, k ∈ V and Yij00 = Yik00 = 1 then Y 0 implies 00 Yjk = 1. In other words we can partition V into classes that correspond to blocks of ones in Y 00 , i.e., two vertices i and j are in the same class, if Yij00 = 1. Lets C 0 denote the number of classes. Matrices Y ij where i, j ∈ V and i 6= j, are zero matrices due to {i, j} ∈ E and (16). Finally, (18) implies Y 0i = Y ii for all i ∈ K. Moreover, for i ∈ K and j ∈ V , semidefinitness of Y ii , i.e., its principal submatrix indexed by z0 , zi and zj we have that Yijii = 1 if and only if i and j are in the same class. Similarly, by considering its principal submatrix ii = 1 if and only if i, j and k are in the indexed by zi , zj and zk we have Yjk same class. Consider next the rows of Y 0 . Rows indexed by zi , zj are zero rows if and only if i, j are not in the same class. Moreover, if i, j are in the same class, and the same holds for i0 , j 0 , rows indexed by zi , zj and zi0 , zj 0 are equal, if all vertices from {i,j,p,q} belong to the same color class. Hence rank(Y 0 ) = C. Finally, Y can be obtained via (11) from any vertex coloring c : V → {1, ..., C} whose colors coincide with vertex classes. Corollary 1 00 χ(G) = min {Y00 : Y feasible for (13) − (18)}.
(20)
We showed that the ”off-diagonal” blocks Y ij = Y ji , 1 ≤ i < j ≤ k, equal 0 as ij ∈ E since i, j belong to the clique K. So Y has the following block structure: 0 1 2 Y Y Y ··· Y k Y 1 Y 1 0 ··· 0 2 2 Y = Y 0 Y ··· 0 .. .. . . . . .. . . . . . Yk 0
0 ··· Y k
6
Jelena Govorˇ cin et al.
where Y i := Y ii = Y 0i . Though Y is a large matrix the condition Y 0 is easy to check as (due to a simple manipulation by a certain unitary matrix [4]) Y 0 ⇐⇒ Y 0 −
k X
Y i 0 and Y i 0 for each 1 ≤ i ≤ k.
i=1
Following Corollary 1 we can relax the binary constraint (14) and obtain the following lower bound for χ(G): ΨK (G) = min t 0 s. t. Y00 = t, 0 Yii = 1 ∀i ∈ {1, ..., n}; i Ypq = 0 if {i, p, q} contains an edge; i Ypq
(ΨSDP )
0 Ypi0 q0
= if ({i,p,q})\{0} = ({i’,p’,q’})\{0}; P Y 0 − i∈K Y i 0, Y i 0 ∀i ∈ K.
By definition it follows that ΨK (G) ≤ χ(G), for every clique K. Proposition 3 If K1 , K2 are cliques in G, where K1 ⊆ K2 , then Θ(G) ≤ ΨK1 (G) ≤ ΨK2 (G) ≤ χ(G). Proof As mentioned, the last inequality follows from the fact that ΨK (G) is a relaxation of (20). It remains to prove the second, since the first then follows from the fact that Θ(G) = ΨK (G) for K = ∅. Let K1 and K2 be cliques such that K1 ⊆ K2 , and let Y2 be an optimal solution for ΨK2 (G). Let Y1 be a matrix obtained from Y2 by deleting all blocks indexed by the vertices in K2 \K1 . The matrix Y1 is now feasible for the program (ΨSDP ), where K = K1 . This implies the inequality. 3 Heuristic coloring based on ΨK 3.1 Computing ΨK We see that computing ΨK amounts to solving a semidefinite program (ΨSDP ) with matrix variable Y being block diagonal with k + 1 blocks, where k = |K| and where each diagonal block is a matrix of order n + 1. The number of constraints in (ΨSDP ) is approximately O(km) where n = |V | and m = |E|. If the graph is dense, i.e., m = O(n2 ) then the resulting semidefinite program has O(kn2 ) constraints. This is roughly by factor k larger comparing to semidefinite program (ΘSDP ) where the number of constraints is exactly m + n. The interior point methods for semidefinite programming problems typically die out when the number of constraints exceeds 10,000 and get very slow
Heuristics for the vertex coloring problem
7
when the number of constraints is above 5,000. However, in this particular case the constraints share a nice property - they imply nearly orthogonal equations (most of the equations are orthogonal) on the matrix variable Y and this fact can be effectively exploited by the so-called boundary point method which works very efficiently on such instances [8,10]. Every time we had to compute (ΨSDP ) we did it with the boundary point method. Table 1 demonstrates the complexity of semidefinite programs underlying the bounds Θ(G), Ψ1 (G), Ψ2 (G), Ψ3 (G) and Ψ4 (G) for random graphs on 60, 70, 80, 90 and 100 nodes with edge density 40 %, 50 % and 60 %. For each bound we report the number of constraints in the semidefinite program. The name of each graph contains information about the number of vertices and how dense it is - 4 denotes density 40 %, 5 density 50 % and 6 density 60 %, therefore G100−6 denotes random graph with 100 nodes and edge density 60 %. Note that different cliques of the same size might imply a different number of constraint in ΨK but the differences are small. graph G60−4 G60−5 G60−6 G70−4 G70−5 G70−6 G80−4 G80−5 G80−6 G90−4 G90−5 G90−6 G100−4 G100−5 G100−6
n 60 60 60 70 70 70 80 80 80 90 90 90 100 100 100
|E| 684 885 1073 953 1197 1470 1218 1615 1900 1582 2005 2373 1985 2434 2955
Θ(G) 744 945 1133 1023 1267 1540 1298 1695 1980 1672 2095 2463 2085 2534 3055
Ψ1 (G) 1608 2010 2386 2186 2674 3220 2756 3550 4120 3524 4370 5106 4370 5268 6310
Ψ2 (G) 2412 3015 3579 3279 4011 4830 4134 5325 6180 5286 6555 7659 6555 7902 9465
Ψ3 (G) 3216 4020 4772 4372 5348 6440 5512 7100 8240 7048 8740 10212 8740 10536 12620
Ψ4 (G) 4020 5025 5965 5465 6685 8050 6890 8875 10300 8810 10925 12765 10925 13170 15775
Table 1 Number of equations in semidefinite programs underlying the bounds Θ(G) and ΨK (G) for K a clique of size 1, 2,3 and 4
We can see from Table 1 that the number of constraints easily goes over 10,000, even over 15,000, if the graph is dense. The only way to solve (ΨSDP ) in such a situation is the boundary point method [8, 10]. In Table 2 we report optimal values Θ(G) and ΨK (G) for |K| = 1, 2, 3, 4 on the same graphs and cliques as in Table 1. We can see that differences between Θ(G) and ΨK (G) are not very large but often the difference become 1 after rounding up the bound, hence the implied lower bound for χ(G) increases by 1. We finish the section by demonstrating that we can compute ΨK for much larger graphs if we keep using the boundary point method. In Table 3 we report the size of larger graphs and the value ΨK (G) for |K| = 3. The last two columns
8
Jelena Govorˇ cin et al. graph G60−4 G60−5 G60−6 G70−4 G70−5 G70−6 G80−4 G80−5 G80−6 G90−4 G90−5 G90−6 G100−4 G100−5 G100−6
n 60 60 60 70 70 70 80 80 80 90 90 90 100 100 100
|E| 684 885 1073 953 1197 1470 1218 1615 1900 1582 2005 2373 1985 2434 2955
Θ(G) 6.4609 8.5247 10.4401 7.2410 8.8051 11.8707 7.4104 9.8808 11.7674 07.7866 09.9970 12.1867 8.3891 10.1499 13.1869
Ψ1 (G) 6.6658 8.6601 10.6041 7.3969 8.9996 12.0511 7.5682 10.0721 11.9694 07.9326 10.2182 12.4502 8.5976 10.4002 13.4276
Ψ2 (G) 6.8112 8.8306 10.8072 7.5717 9.1614 12.2114 7.7148 10.2541 12.1943 08.1255 10.4300 12.6660 8.7936 10.5993 13.6558
Ψ3 (G) 6.8831 8.9310 10.9336 7.6599 9.2510 12.3902 7.8506 10.4000 12.3979 8.2964 10.5732 12.8853 8.9817 10.7998 13.8581
Ψ4 (G) 7.0460 9.0939 11.1892 7.8026 9.4294 12.4739 8.0274 10.5635 12.6049 8.4617 10.7471 13.1181 9.1664 10.9858 14.0868
Table 2 Comparison of Θ(G) with ΨK (G) for K a clique of size 1, 2, 3 and 4
contain computational times needed to compute Ψ3 (G): time1 (in seconds) contains time needed to set up semidefinite program ΨSDP while time2 reports time (also in seconds) needed to solve semidefinite program ΨSDP for |K| = 3 by the boundary point method. We note that all computations were done on a laptop with Intel core i5-2410m 2,30 GHz processor and with 4 GB RAM. In our opinion computational times are acceptable and demonstrate that this approach has a potential also for the graphs of medium size. We can reduce time2 further by a concise consideration of the equation structure and exploitation of the orthogonality of the constraints. This is a task for the ongoing research. graph G400−3 G600−3 G800−3
n 400 600 800
|E| 23746 53795 95394
# of eqs. in ΨSDP 98184 219980 387976
Ψ3 (G) 12.48 14.96 17.08
time1 (sec.) 142.2 662.5 2388.7
time2 (sec.) 493.0 1260.1 2695.2
Table 3 Complexity of (ΨSDP ), optimal value Ψ3 for random graphs with 400, 600 and 800 nodes and computational times
3.2 Constructing good colorings Let Y¯ be an optimal solution of (ΨSDP ). We show in this section how to construct a good coloring for G by extracting information from Y¯ . We rely on the following interpretation of elements from Y¯ : inspired by i (19) we may conclude that large value of Y¯pq , 1 ≤ i, p, q, i 6= p 6= q, indicates that all three vertices i, p and q should be colored by the same color. Similarly 0 large value for Y¯pq , 1 ≤ p < q ≤ n suggests to color p and q with the same
Heuristics for the vertex coloring problem
9
color (this idea was used in [2]). These conclusions are based on fact that if we compute χ(G) by solving (20) then non-zero entries in optimal solution of (20) imply that there exists an optimal coloring which colors the underlying vertices by the same color. In practice we solve the relaxation (ΨSDP ) which is good. The interpretation of non-zeroes is not correct anymore, but still works fine in practice due to the quality of the relaxation. When we detect that vertices i and j should be colored by the same color, we use the fact that finding a coloring c of the graph G(V, E) such that c(i) = c(j) is equivalent task to finding a coloring c0 of a graph G0 = G/{i,j} with one vertex less. In the graph G/{i,j} vertices i and j are merged into new vertex i0 where the neighborhood of i0 is the union of the neighborhoods of vertices i and j. Let c0 be a coloring of G0 . We can reconstruct a coloring of G by defining c(j) = c(i) := c0 (i0 ) while for all other vertices c := c0 . We proceed similarly, if more than two vertices should have the same color. This idea is not new. It was used also in [2]. However Dukanovic and Rendl used an optimal solution of (ΘSDP ) while we work with an optimal solution of (ΨSDP ). Hence we have information about triangles and we indeed oppositely to [2] consider triangles first. The resulting coloring is very good although we never know how close to the optimum the result is unless we got an optimal coloring (we realize this if the number of colors is equal to the lower bound for chromatic number, obtained by rounding up the bound ΨK ). Details of this method are shown in Algorithm 1.
Input: Simple undirected graph G = (V, E), k - the size of a clique. Step 1: G0 = G. Step 2: While G0 is not a complete graph Step 3.1: Find a clique K of size k in G0 . Step 3.2: Compute optimal solution Y¯ for ΨK (G0 ). i in Y . Step 3.3: Find the largest element Y¯jk Step 3.4: Color vertices from U = {i, j, k} \ {0} with the same color. Step 3.5: Delete vertices which can be easily colored. Step 3.6: Merge coloring classes in G0 to obtain new G0 . Step 4: Reconstruct the coloring c of G. Output: Coloring c. Algorithm 1: The heuristic method for finding good coloring of G
Note that in each iteration we merge at least two vertices and therefore decrease V (G0 ) by at least 1 since U contains at least two vertices. This heuristic gives good coloring results - cf. Table 4, but is very time consuming since we have to run the while loop many times and in each iteration of the while loop we have to compute Y¯ which is computationally the most time consuming part, especially at the beginning when the size of the graph G0 is still large. However we benefit a lot since we compute Y¯ by the boundary point method [10, 8].
10
Jelena Govorˇ cin et al.
Step 3.5 means that if we have a vertex v with less than χ(G) neighbors, then every regular coloring (especially non-optimal) will leave in the neighborhood of v at least one unused color which can be used to color v. Therefore, we (iteratively) delete at every step all vertices from G0 with degree less than the current bound on χ(G) and recursively color the remaining graph. Similarly we can eliminate any vertex i whose neighborhood is contained in the neighborhood of some other vertex j, if i and j are not adjacent. In this case, vertex i can be colored by the same color as j. In Table 4 we present numerical results obtained on random graphs with n = |V | = 20, 30, . . . , 100 nodes and edge density 0.4 , 0.5, 0.6. These graphs are exactly the toughest for a competitive interior point method approach (see [2]). The number of colors needed when Algorithm 1 is run on optimal solution of ΨK for K a clique of order 3 or 4 is given in columns χ3 (G) and χ4 (G). graph G20−4 G20−5 G20−6 G30−4 G30−5 G30−6 G40−4 G40−5 G40−6 G50−4 G50−5 G50−6 G60−4 G60−5 G60−6 G70−4 G70−5 G70−6 G80−4 G80−5 G80−6 G90−4 G90−5 G90−6 G100−4 G100−5 G100−6
n 20 20 20 30 30 30 40 40 40 50 50 50 60 60 60 70 70 70 80 80 80 90 90 90 100 100 100
|E| 81 97 98 175 214 269 299 383 455 495 588 735 684 885 1073 953 1197 1470 1218 1615 1900 1582 2005 2373 1985 2434 2955
Ψ4 (G) 4.9999 5.2036 5.9999 5.1971 6.9997 7.8908 6.1487 7.2635 8.9870 6.5619 8.3037 9.9145 7.0460 9.0939 11.1892 7.8026 9.4294 12.4739 8.0274 10.5635 12.6049 8.4617 10.7471 13.1181 9.1664 10.9858 14.0868
χ3 (G) 5 6 6 6 7 9 7 8 10 8 9 11 10 11 14 10 12 15 11 14 17
χ4 (G) 5 6 6 6 7 9 7 8 10 8 9 12 9 11 14 10 12 15 10 14 17
χ4 (G)new 5 6 6 6 7 9 8 9 10 8 10 12 9 12 14 11 12 16 11 14 16 12 15 18 14 16 20
time (sec.) 0.74 2.99 1.04 5.60 2.79 9.15 8.73 12.90 20.38 21.40 16.36 38.48 40.15 38.98 63.28 64.28 54.06 143.75 91.51 110.02 137.65 132.00 157.73 194.78 192.45 245.68 279.16
Table 4 Number of colors needed by Algorithm 1 (5th and 6th column) and Algorithm 2 (7th column)
The main drawback of Algorithm 1 is the fact that we have to compute ΨK many times - actually in every iteration of the while loop. This is often too expensive, therefore we propose another algorithm which solves (ΨSDP ) ones
Heuristics for the vertex coloring problem
11
and then repeats the while loop many times and at the end when the graph gets much simpler it recomputes (ΨSDP ). Details are in Algorithm 2.
Input: Simple undirected graph G = (V, E), k - the size of a clique. Step 1: G0 = G. Step 2: While G0 is not a complete graph Step 2.1: Find a clique K of size k in G. Step 2.2: Compute optimal solution Y¯ for ΨK (G0 ). i > δ(Y ¯ ) color {i, j, k} Step 2.3: For all {i, j, k} with i 6= j 6= k and with Y¯jk with the first possible color. Step 2.4: For all {i, j} with i 6= j and with Y¯ij0 > δ1 (Y¯ ) color {i, j} with the first possible color. Step 2.5: Merge coloring classes in G0 to obtain new G0 . Step 2.6: Delete vertices which can be easily colored. Step 3: Reconstruct the coloring c of G. Output: Coloring c. Algorithm 2: The improved heuristic method for finding good coloring of G
We can see the results of Algorithm 2 in the 7th column of Table 4. Note that on graphs with more than 80 nodes the Algorithm 1 turned out to be too expensive when combined with ΨK for |K| = 3, 4. However, Algorithm 2 could find in combination with ΨK for |K| = 4 a good coloring in a reasonable time. The computational time needed to compute χ4 (G)new is contained in the last column time. To compute χ4 (G)new in Table 4 (and also in Table 5) we set δ in Algorithm 2 to be the mean value of all entries of Y¯ , which are greater than 0.001, increased by one standard deviation of these values. For δ1 we took the mean value of all entries in Y¯ 0 which are greater than 0.001. We have also conducted experiments for some DIMACS benchmark graph coloring instances from http://mat.gsia.cmu.edu/COLOR/instances.html. In Table 5 results of our Algorithm 2 for graphs DSJCa − b are given, where DSJCa−b are random graphs with a vertices, two vertices being adjacent with probability 10−1 b. Beside χ4 (G)new computed by Algorithm 2 we also provide optimal values χ(G) which are known from the literature. Computational times are not reported since they go in several hours for the graphs with 500 nodes and are mainly determined by the time needed to (re)computed ΨK (for the order of magnitude see Table 3) and the number of while loop iterations in Algorithm 2 (i.e. depends strongly on the value δ and δ1 ). We want to point out that we recommend to use Algorithm 1 since it usually gives better coloring. But, if we meet time limitations, then Algorithm 2 is a way how to obtain still a good coloring. We can also observe that the gap between ΨK and the number of colors needed by both algorithms might get large. We believe that more sophisticated tuning of Algorithm 2, i.e., a careful choice of δ and δ1 might yield much better result. This will be the topic that we will address in the ongoing research.
12
Jelena Govorˇ cin et al. G DSJC125-1 DSJC125-5 DSJC125-9 DSJC250-1 DSJC250-5 DSJC250-9 DSJC500-1
n 125 125 125 250 250 250 500
|E| 736 3891 6961 3218 15668 27897 12458
Ψ3 (G) 4.1481 12.5283 38.1806 5.1685 17.0076 56.2729 6.5164
Ψ4 (G) 4.3312 12.7586 38.3682 5.1878 17.2677 56.6517 6.5249
χ4 (G)new 7 19 44 11 32 76 16
χ(G) 5 17 43 8 28 72 12
Table 5 DIMACS benchmark instances, results obtained via Algorithm 2.
4 Conclusions In this paper we demonstrated theoretically and numerically that ΨK (G) strengthens Θ(G) significantly and that we can compute it efficiently using the boundary point method [8, 10]. In the last section we show two heuristics to find good colorings for the graph which decide which vertices should have the same colors by considering the largest elements of the optimal solution of the semidefinite program (ΨSDP ). We presented numerical results which demonstrate that ΨK can be computed also for large graphs and that the proposed heuristics work good on the middle size graphs. There is still a lot of work for the ongoing research: how to adopt the boundary point method to exploit the structure of the semidefinite program (ΨSDP ) more efficiently and how to tune Algorithm 2 to give better coloring results. Acknowledgements We thank to Igor Dukanovic for sharing his expertise and code for exact and approximate vertex coloring based on Θ function.
References 1. Arora, S., Chlamtac, E.: New approximation guarantee for chromatic number. In: Proceedings of the thirty-eighth annual ACM symposium on Theory of computing, STOC ’06, pp. 215–224. ACM, New York, NY, USA (2006). DOI 10.1145/1132516.1132548. URL http://doi.acm.org/10.1145/1132516.1132548 2. Dukanovic, I., Rendl, F.: Semidefinite programming relaxations for graph coloring and maximal clique problems. Mathematical Programming 109, 345–365 (2007) 3. Dukanovic, I., Rendl, F.: A semidefinite programming-based heuristic for graph coloring. Discrete Applied Mathematics 156(2), 180 – 189 (2008) 4. Gvozdenovi´ c, N., Laurent, M.: Computing semidefinite programming lower bounds for the (fractional) chromatic number via block-diagonalization. SIAM J. Optim. 19(2), 592–615 (2008). DOI 10.1137/070683520. URL http://dx.doi.org/10.1137/070683520 5. Gvozdenovi´ c, N., Laurent, M., Vallentin, F.: Block-diagonal semidefinite programming hierarchies for 0/1 programming. Oper. Res. Lett. 37(1), 27–31 (2009). DOI 10.1016/ j.orl.2008.10.003. URL http://dx.doi.org/10.1016/j.orl.2008.10.003 6. Karger, D., Motwani, R., Sudan, M.: Approximate graph coloring by semidefinite programming. Journal of the Association for Computing Machinery 45, 246–265 (1998) 7. Lov´ asz, L.: On the Shannon capacity of a graph. IEEE Transactions on Information Theory 25, 1–7 (1979)
Heuristics for the vertex coloring problem
13
8. Malick, J., Povh, J., Rendl, F., Wiegele, A.: Regularization methods for semidefinite programming. SIAM J. Optim. 20(1), 336–356 (2009). DOI 10.1137/070704575. URL http://dx.doi.org/10.1137/070704575 9. Povh, J., Rendl, F.: Copositive and semidefinite relaxations of the quadratic assignment problem. Discrete Optim. 6(3), 231–241 (2009). DOI 10.1016/j.disopt.2009.01.002. URL http://dx.doi.org/10.1016/j.disopt.2009.01.002 10. Povh, J., Rendl, F., Wiegele, A.: A boundary point method to solve semidefinite programs. Computing 78(3), 277–286 (2006). DOI 10.1007/s00607-006-0182-2. URL http://dx.doi.org/10.1007/s00607-006-0182-2