breaking symmetries in graph coloring problems with degree

17
Breaking Symmetries in Graph Coloring Problems with Degree Matrices: the Ramsey Number R(4,3,3)=30 ? Michael Codish 1 , Michael Frank 1 , Avraham Itzhakov 1 , and Alice Miller 2 1 Department of Computer Science, Ben-Gurion University of the Negev, Israel 2 School of Computing Science, University of Glasgow, Scotland Abstract. This paper introduces a general methodology that applies to solve graph edge-coloring problems and demonstrates its use to compute the Ramsey number R(4, 3, 3). The number R(4, 3, 3) is often presented as the unknown Ramsey number with the best chances of being found “soon”. Yet, its precise value has remained unknown for more than 50 years. The proposed technique is based on two well-studied concepts, abstraction and symmetry. First, we in- troduce an abstraction on graph colorings, degree matrices, that specify the de- gree of each vertex in each color. We compute, using a SAT solver, an over- approximation of the set of degree matrices of all solutions of the graph coloring problem. Then, for each degree matrix in the over-approximation, we compute, again using a SAT solver, the set of all solutions with matching degrees. Breaking symmetries, on degree matrices in the first step and with respect to graph isomor- phism in the second, is cardinal to the success of the approach. We illustrate the approach via two applications: proving that R(4, 3, 3) = 30 and computing the previously unknown number of (3, 3, 3; 13) Ramsey colorings (78,892). 1 Introduction This paper introduces a general methodology that applies to solve graph edge-coloring problems and demonstrates its use to prove that the Ramsey number R(4, 3, 3) is equal to 30. Ramsey numbers arise in a problem of graph theory that involves assigning k colors to the edges of a complete graph. In particular, R(4, 3, 3) is the smallest num- ber n such that any coloring of the edges of the complete graph K n in three colors will either contain a K 4 sub-graph in the first color, a K 3 sub-graph in the second color, or a K 3 sub-graph in the third color. The precise value of this number has been sought for more that 50 years. Kalbfleisch [19] proved in 1966 that R(4, 3, 3) 30, Pi- wakowski [24] proved in 1997 that R(4, 3, 3) 32, and one year later Piwakowski and Radziszowski [25] proved that R(4, 3, 3) 31. We also compute the number of Ram- sey (3, 3, 3; 13) colorings. A (3, 3, 3; n) coloring is an assignment of one of three colors to each of the edges of the complete graph K n such that there is no monochromatic K 3 sub-graph. It is known that R(3, 3, 3) = 17, so there are no (3, 3, 3; 17) colorings. The number of (3, 3, 3; n) colorings for 14 n 16 are known. The number of (3, 3, 3; 13) colorings was previously unknown [27]. Solving hard search problems on graphs, and graph coloring problems in particular, relies heavily on breaking symmetries in the search space. When searching for a graph, ? Supported by the Israel Science Foundation, grant 182/13. Computational resources provided by an IBM Shared University Award (Israel). arXiv:1409.5189v2 [cs.AI] 25 Nov 2014

Upload: vuongphuc

Post on 31-Dec-2016

219 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Breaking Symmetries in Graph Coloring Problems with Degree

Breaking Symmetries in Graph Coloring Problems withDegree Matrices: the Ramsey Number R(4,3,3)=30?

Michael Codish1, Michael Frank1, Avraham Itzhakov1, and Alice Miller2

1 Department of Computer Science, Ben-Gurion University of the Negev, Israel2 School of Computing Science, University of Glasgow, Scotland

Abstract. This paper introduces a general methodology that applies to solvegraph edge-coloring problems and demonstrates its use to compute the Ramseynumber R(4, 3, 3). The number R(4, 3, 3) is often presented as the unknownRamsey number with the best chances of being found “soon”. Yet, its precisevalue has remained unknown for more than 50 years. The proposed techniqueis based on two well-studied concepts, abstraction and symmetry. First, we in-troduce an abstraction on graph colorings, degree matrices, that specify the de-gree of each vertex in each color. We compute, using a SAT solver, an over-approximation of the set of degree matrices of all solutions of the graph coloringproblem. Then, for each degree matrix in the over-approximation, we compute,again using a SAT solver, the set of all solutions with matching degrees. Breakingsymmetries, on degree matrices in the first step and with respect to graph isomor-phism in the second, is cardinal to the success of the approach. We illustrate theapproach via two applications: proving that R(4, 3, 3) = 30 and computing thepreviously unknown number of (3, 3, 3; 13) Ramsey colorings (78,892).

1 Introduction

This paper introduces a general methodology that applies to solve graph edge-coloringproblems and demonstrates its use to prove that the Ramsey number R(4, 3, 3) is equalto 30. Ramsey numbers arise in a problem of graph theory that involves assigning kcolors to the edges of a complete graph. In particular, R(4, 3, 3) is the smallest num-ber n such that any coloring of the edges of the complete graph Kn in three colorswill either contain a K4 sub-graph in the first color, a K3 sub-graph in the secondcolor, or a K3 sub-graph in the third color. The precise value of this number has beensought for more that 50 years. Kalbfleisch [19] proved in 1966 that R(4, 3, 3) ≥ 30, Pi-wakowski [24] proved in 1997 that R(4, 3, 3) ≤ 32, and one year later Piwakowski andRadziszowski [25] proved that R(4, 3, 3) ≤ 31. We also compute the number of Ram-sey (3, 3, 3; 13) colorings. A (3, 3, 3;n) coloring is an assignment of one of three colorsto each of the edges of the complete graph Kn such that there is no monochromatic K3

sub-graph. It is known that R(3, 3, 3) = 17, so there are no (3, 3, 3; 17) colorings. Thenumber of (3, 3, 3;n) colorings for 14 ≤ n ≤ 16 are known. The number of (3, 3, 3; 13)colorings was previously unknown [27].

Solving hard search problems on graphs, and graph coloring problems in particular,relies heavily on breaking symmetries in the search space. When searching for a graph,? Supported by the Israel Science Foundation, grant 182/13. Computational resources provided

by an IBM Shared University Award (Israel).

arX

iv:1

409.

5189

v2 [

cs.A

I] 2

5 N

ov 2

014

Page 2: Breaking Symmetries in Graph Coloring Problems with Degree

the actual names of the vertices do not matter, and restricting the search modulo graphisomorphism is highly beneficial. When searching for a graph coloring, on top of graphisomorphism, solutions are typically closed under permutations of the colors: the actualnames of the colors do not matter and the term often used is “weak isomorphism” [25](the equivalence relation is weaker because both node names and edge colors do notmatter). When the problem is to compute the set of all solutions modulo (weak) iso-morphism, or to count them, the task is even more challenging. Often one first attemptsto compute all of the solutions, and to then apply one of the available graph isomor-phism tools, such as nauty [21] to select representatives of their equivalence classesmodulo (weak) isomorphism. However, typically the number of solutions is so largethat this approach is doomed to fail even though the number of equivalence classes it-self is much smaller. The problem is that tools such as nauty can only be applied after,and not during, search. A solution is to restrict the search space so that it still includes atleast one representative of each equivalence class, and as few as possible other graphs.Or in other words, to apply symmetry breaking (modulo equivalence) during the searchfor a solution to the graph coloring problem.

We present a general, two step, methodology towards solving hard graph coloringproblems. We apply it to compute the previously unknown set of all Ramsey colorings(3, 3, 3; 13), modulo weak isomorphism, of the complete graphK13. More significantly,we apply it to prove that the Ramsey number R(4, 3, 3) is equal to 30. In the firststep, we describe the solutions of a graph coloring problem in terms of an abstraction,which we call degree matrices, that focuses on the degrees of vertices in each color.We compute, using a SAT solver, an over-approximation, i.e. a super-setM, of the setof degree matrices of all solutions of the graph coloring problem. Already in this stepwe obtain new results for Ramsey coloring problems which are presented as Lemmas 2and 3. In the second step, for each degree matrix M in the over-approximationM, weshow how to compute the set of all solutions of the graph coloring problem which havea degree matrix matching M , or alternatively that there are none such.

Solving a graph coloring problem, using an over-approximation,M, of the degreematrices in its solutions, has three key advantages: (1) It breaks the coloring probleminto a set of independent sub-problems, one sub-problem for each M ∈M. These sub-problems can then be solved in parallel. (2) It directs the search: solving the (graph col-oring) problem given some properties (the degree matrix) of its solutions helps guide thesolver through the search space. (3) It facilitates symmetry breaking: degree matricesare isomorphic under renamings of colors and of graph vertices. We take advantage ofthis during the first step to break many of the symmetries in the coloring problem. Also,in the second step, seeking solutions given a degree matrix boosts symmetry breaking.

Throughout the paper we express graph coloring problems in terms of constraintsvia a “mathematical language”. Our implementation uses the BEE, finite-domain con-straint compiler [23], which solves constraints by encoding them to CNF and applyingan underlying SAT solver. The solver can be applied to find a single (first) solutionto a constraint, or to find all solutions for a constraint modulo a specified set of (inte-ger and/or Boolean) variables. Of course, correctness of our results assumes the lackof bugs in the tools we have used including the constraint solver and the underlyingSAT solver. To this end we have performed our computations using four different un-

Page 3: Breaking Symmetries in Graph Coloring Problems with Degree

derlying SAT solvers: MiniSAT [13,14], CryptoMiniSAT [29], Glucose [3,4], and Lin-geling [5,6]. BEE configures directly with MiniSAT, CryptoMiniSAT, and Glucose. Forthe experiments with Lingeling we first apply BEE to generate a CNF (dimacs) file andsubsequently invoke the SAT solver. Lingeling, together with Druplig [7], provides aproof certificate for unsat instances (and we have taken advantage of this option). Allcomputations were performed on a cluster with a total of 168 Intel E8400 cores clockedat 2 GHz each, able to run 336 parallel threads. Each SAT instance is run on a singlethread.

The notion of a “degree matrix” arises in the literature with several different mean-ings. Degree matrices with the same meaning as we use in in this paper are consideredalso in [8]. Gent and Smith [16], building on the work of Puget [26], study symmetriesin graph coloring problems and recognize the importance of breaking symmetries dur-ing search. Meseguer and Torras [22] present a framework for exploiting symmetriesto heuristically guide a depth first search, and show promising results for (3, 3, 3;n)Ramsey colorings with 14 ≤ n ≤ 17. Al-Jaam [1] proposes a hybrid meta-heuristicalgorithm for Ramsey coloring problems, combining tabu search and simulated anneal-ing. While all of these approaches report promising results, to the best of our knowl-edge, none of them have been successfully applied to solve open instances or improvethe known bounds on classical Ramsey numbers. Our approach focuses on symmetriesdue to weak-isomorphism for graph coloring and models symmetry breaking in termsof constraints introduced as part of the problem formulation. This idea, advocated byCrawford et al. [12], has previously been explored in [10] (for graph isomorphism), andin [26] (for graph coloring).

Graph coloring has many applications in computer science and mathematics, such asscheduling, register allocation and synchronization, path coloring and sensor networks.Specifically, many finite domain CSP problems have a natural representation as graphcoloring problems. Our main contribution is a general methodology that applies to solvegraph edge coloring problems. The application to compute an unknown Ramsey numberis impressive, but the importance here is in that it shows the utility of the methodology.

2 Preliminaries

An (r1, . . . , rk;n) Ramsey coloring is an assignment of one of k colors to each edgein the complete graph Kn such that it does not contain a monochromatic completesub-graph Kri in color i for 1 ≤ i ≤ k. The set of all such colorings is denotedR(r1, . . . , rk;n). The Ramsey number R(r1, . . . , rk) is the least n > 0 such that no(r1, . . . , rk;n) coloring exists. In the multicolor case (k > 2), prior to this paper, theonly known value of a nontrivial Ramsey number is R(3, 3, 3) = 17. The value ofR(4, 3, 3) was previously known to be equal either to 30 or to 31. The numbers of(3, 3, 3;n) colorings are known for 14 ≤ n ≤ 16 but prior to this paper the numberof colorings for n = 13 was unknown. More information on recent results concerningRamsey numbers can be found in the electronic dynamic survey by Radziszowski [27].

In this paper, graphs are always simple, i.e. undirected and with no self loops. Colorsare associated with graph edges. For a natural number n denote [n] = {1, 2, . . . , n}. Agraph coloring, in k colors, is a pair (G, κ) consisting of a simple graph G = ([n], E)

Page 4: Breaking Symmetries in Graph Coloring Problems with Degree

and a mapping κ : E → [k]. When κ is clear from the context we refer to G as thegraph coloring. The sub-graph of G induced by the color c ∈ [k] is the graph Gc =([n],

{e ∈ E

∣∣κ(e) = c}). We typically represent G as an n× n adjacency matrix, A,

defined such that

Ai,j =

{κ(i, j) if (i, j) ∈ E0 otherwise

If A is the adjacency matrix representing the graph G, then we denote the Boolean ad-jacency matrix corresponding toGc asA[c]. We denote the ith row of a matrixA byAi.The color-c degree of a node x in G is denoted degGc(x) and is equal to the degree ofx in the induced sub-graphGc. When clear from the context we write degc(x). LetG =([n], E) and π be a permutation on [n]. Then π(G) = (V,

{(π(x), π(y))

∣∣ (x, y) ∈ E }).Permutations act on adjacency matrices in the natural way: If A is the adjacency matrixof a graph G, then π(A) is the adjacency matrix of π(G) obtained by simultaneouslypermuting with π both rows and columns of A.

ϕn,kadj (A) =

∧1≤q<r≤n

(1 ≤ Aq,r ≤ k ∧ Aq,r = Ar,q ∧ Aq,q = 0

)(1)

ϕn,cK3

(A) =∧

1≤q<r<s≤n

¬(Aq,r = Aq,s = Ar,s = c

)(2)

ϕn,cK4

(A) =∧

1≤q<r<s<t≤n

¬(Aq,r = Aq,s = Aq,t = Ar,s = Ar,t = As,t = c

)(3)

ϕ(3,3,3;n)(A) = ϕn,3adj(A) ∧

∧1≤c≤3

ϕn,cK3

(A) (4)

ϕ(4,3,3;n)(A) = ϕn,3adj(A) ∧

∧1≤c≤2

ϕn,cK3

(A) ∧ ϕn,3K4

(A) (5)

Fig. 1. Graph labeling problems: Ramsey colorings (3, 3, 3;n) and (4, 3, 3;n)

A graph coloring problem is a formula ϕ(A) where A is an n× n adjacency matrixof integer variables together with a set (conjunction) of constraints ϕ on these variables.A solution is an assignment of integer values to the variables in A which satisfies ϕ anddetermine both the graph edges and their colors. We often refer to a solution as an inte-ger adjacency matrix and denote the set of solutions as sol(ϕ(A)). Figure 1 illustratesthe two graph coloring problems we focus on in this paper: (3, 3, 3;n) and (4, 3, 3;n)

Ramsey colorings. In Constraint (1), ϕn,kadj , states that the graph has n vertices, is k col-ored, and is simple (symmetric, and with no self loops). In Constraints (2) and (3), ϕn,cK3

and ϕn,cK4state that the n vertex graph has no embedded sub-graph K3, and respectively

K4, in color c. In Constraints (4) and (5), the formulas state that a graph is a (3, 3, 3;n)and respectively a (4, 3, 3;n) Ramsey coloring.

Page 5: Breaking Symmetries in Graph Coloring Problems with Degree

For graph coloring problems, solutions are typically closed under permutations ofvertices and of colors. Restricting the search space for a solution modulo such per-mutations is crucial when trying to solve hard graph coloring problems. It is standardpractice to formalize this in terms of graph (coloring) isomorphism.

Definition 1 ((weak) isomorphism of graph colorings). Let (G, κ1) and (H,κ2) bek-color graph colorings with G = ([n], E1) and H = ([n], E2). We say that (G, κ1)and (H,κ2) are weakly isomorphic, denoted (G, κ1) ≈ (H,κ2) if there exist permuta-tions π : [n] → [n] and σ : [k] → [k] such that (u, v) ∈ E1 ⇐⇒ (π(u), π(v)) ∈ E2

and κ1(u, v) = σ(κ2(π(u), π(v))). When σ is the identity permutation, (i.e. κ1(u, v) =κ2(π(u), π(v))) we say that (G, κ1) and (H,κ2) are isomorphic.

The following lemma emphasizes the importance of weak graph isomorphism as itrelates to Ramsey numbers. Many classic coloring problems exhibit the same property.

Lemma 1 (R(r1, r2, . . . , rk;n) is closed under≈). Let (G, κ1) and (H, η) be graphcolorings in k colors such that (G, κ) ≈ (H, η). Then (G, κ) ∈ R(r1, r2, . . . , rk;n)⇐⇒ (H, η) ∈ R(r1, r2, . . . , rk;n).

Proof. Assume that (G, κ) ∈ R(r1, r2, . . . , rk;n) and (G, κ) ≈ (H, η). Let π : [n] →[n] and σ : [k]→ [k] such that Definition 1 holds. Assume in contradiction that (H, η) /∈R(r1, r2, . . . , rk;n). Let R denote a monochromatic clique of size rs in H and R−1

the inverse of R in G. From Definition 1, (u, v) ∈ R ⇐⇒ (π−1(u), π−1(v)) ∈ R−1and η(u, v) = σ−1(κ(u, v)). Consequently R−1 is a monochromatic clique of size rsin (G, κ) in contradiction to (G, κ) ∈ R(k1, k2, . . . , kr;n).

Codish et al. introduce in [10] an approach to break symmetries due to graph iso-morphism (without colors) during the search for a solution to general graph problems.Their approach involves adding a symmetry breaking predicate sb∗` (A), as advocatedby Crawford et al. [12], on the variables of the adjacency matrix, A, when solvinggraph problems. In [11] the authors show that the symmetry breaking approach of [10]holds also for graph coloring problems where the adjacency matrix consists of integervariables (the proofs for the integer case are similar to those for the (0, 1) case).

Definition 2. [10]. Let A be an n × n adjacency matrix. Then, viewing the rows of Aas strings,

sb∗` (A) =∧i<j

Ai �{i,j} Aj

where s �{i,j} s′ is the lexicographic order on strings s and s′ after simultaneouslyomitting the elements at positions i and j.

Table 1 illustrates the impact of the symmetry breaking technique introduced byCodish et al. in [11] on the search for (3, 3, 3;n) Ramsey colorings. The column headedby “#\≈” specifies the known number of colorings modulo weak isomorphism [27].The columns headed by “#vars” and “#clauses” indicate, respectively, the number ofvariables and clauses in the corresponding CNF encodings of the coloring problems

Page 6: Breaking Symmetries in Graph Coloring Problems with Degree

n #\≈ no sym break with sym break#vars #clauses time #vars #clauses time #

17 0 408 2584 3042.10 4038 20734 0.15 016 2 360 2160 ∞ 3328 17000 0.14 615 2 315 1785 ∞ 2707 13745 0.37 6614 115 273 1456 ∞ 2169 10936 259.56 2463513 ? 234 1170 ∞ 1708 8540 ∞ ?

Table 1. The search for (3, 3, 3;n) Ramsey colorings with and without the symmetry break de-fined in [11] (time in seconds with 24 hr. timeout).

with and without the symmetry breaking constraint. The columns headed by “time”indicate the time (in seconds, on a single thread of the cluster) to find all coloringsiterating with a SAT solver. The timeout assumed here is 24 hours. The column headedby “#” specifies the number of colorings found when solving with the symmetry break.These include colorings which are weakly isomorphic, but far fewer than the hundredsof thousands generated without the symmetry break (until the timeout). The results inthis table were obtained using the CryptoMiniSAT solver [29].

0 1 1 1 1 1 2 2 2 2 2 3 3 3 3 31 0 2 2 3 3 1 1 2 2 3 1 1 2 3 31 2 0 3 2 3 1 2 1 3 2 2 3 1 1 31 2 3 0 3 2 2 1 3 1 2 3 2 1 3 11 3 2 3 0 2 2 3 1 2 1 1 3 3 2 11 3 3 2 2 0 3 2 2 1 1 3 1 3 1 22 1 1 2 2 3 0 3 3 1 1 2 3 2 3 12 1 2 1 3 2 3 0 1 3 1 3 2 2 1 32 2 1 3 1 2 3 1 0 1 3 2 1 3 2 32 2 3 1 2 1 1 3 1 0 3 1 2 3 3 22 3 2 2 1 1 1 1 3 3 0 3 3 1 2 23 1 2 3 1 3 2 3 2 1 3 0 2 1 1 23 1 3 2 3 1 3 2 1 2 3 2 0 1 2 13 2 1 1 3 3 2 2 3 3 1 1 1 0 2 23 3 1 3 2 1 3 1 2 3 2 1 2 2 0 13 3 3 1 1 2 1 3 3 2 2 2 1 2 1 0

0 1 1 1 1 1 2 2 2 2 2 3 3 3 3 31 0 2 2 3 3 1 1 2 2 3 1 1 2 3 31 2 0 3 2 3 2 3 1 1 2 1 2 3 1 31 2 3 0 3 2 1 2 1 3 2 2 3 1 3 11 3 2 3 0 2 3 2 2 1 1 3 1 3 2 11 3 3 2 2 0 2 1 3 2 1 3 3 1 1 22 1 2 1 3 2 0 3 3 1 1 2 3 2 1 32 1 3 2 2 1 3 0 1 1 3 3 2 2 3 12 2 1 1 2 3 3 1 0 3 1 2 1 3 3 22 2 1 3 1 2 1 1 3 0 3 3 2 1 2 32 3 2 2 1 1 1 3 1 3 0 1 3 3 2 23 1 1 2 3 3 2 3 2 3 1 0 2 1 2 13 1 2 3 1 3 3 2 1 2 3 2 0 1 1 23 2 3 1 3 1 2 2 3 1 3 1 1 0 2 23 3 1 3 2 1 1 3 3 2 2 2 1 2 0 13 3 3 1 1 2 3 1 2 3 2 1 2 2 1 0

5 5 55 5 55 5 55 5 55 5 55 5 55 5 55 5 55 5 55 5 55 5 55 5 55 5 55 5 55 5 55 5 5

Fig. 2. Two 16 × 16 non-isomorphic (3, 3, 3; 16) Ramsey colorings (left and middle) with theircommon 16× 3 degree matrix (right).

Figure 2 depicts, on the left and in the middle, the two non-isomorphic colorings(3, 3, 3; 16) represented as adjacency graphs in the form found using the approach ofCodish et al. [11]. Note the lexicographic order on the rows in both matrices. Thesegraphs are isomorphic to the two colorings reported in 1968 by Kalbfleish and Stan-ton [18] where it is also proven that there are no others (modulo weak isomorphism).The 16 × 3 degree matrix (right) describes the degrees of each node in each coloras defined below in Definition 3. The results reported in Table 1 also illustrate thatthe approach of Codish et al. is not sufficiently powerful to compute the number of(3, 3, 3; 13) colorings. Likewise, it does not facilitate the computation of R(4, 3, 3).

To prove that R(4, 3, 3) = 30 we make use of the following results from [25].

Theorem 1. 30 ≤ R(4, 3, 3) ≤ 31 and, R(4, 3, 3) = 31 if and only if there exists a(4, 3, 3; 30) coloring κ ofK30 such that: (1) For every vertex v, 5 ≤ deg1(v), deg2(v) ≤8, and 13 ≤ deg3(v) ≤ 16. (2) Every edge in the third color has at least one endpoint vwith deg3(v) = 13. (3) There are at least 25 vertices v for which deg1(v) = deg2(v) =8 and deg3(v) = 13.

Page 7: Breaking Symmetries in Graph Coloring Problems with Degree

3 Degree Matrices for Graph Colorings

We introduce an abstraction on graph colorings defined in terms of degree matricesand an equivalence relation on degree matrices. Our motivation is to solve graph color-ing problems by first focusing on an over approximation of their degree matrices. Theequivalence relation on degree matrices enables us to break symmetries during searchwhen solving graph coloring problems. Intuitively, degree matrices are to graph edge-colorings as degree sequences are to graphs.

Definition 3 (abstraction, degree matrix). Let A be a graph coloring on n verticeswith k colors. The degree matrix of A, denoted α(A) is an n × k matrix, M such thatMi,j = degj(i) is the degree of vertex i in color j. For a set A of graph colorings wedenote α(A) =

{α(A)

∣∣A ∈ A }.

A degree matrix, M , is said to represent the set of graphs weakly-isomorphic toa graph with degrees as in M . We say that two degree matrices are equivalent if theyrepresent the same sets of graph colorings.

Definition 4 (concretization and equivalence). Let M and N be n × k degree ma-trices. Then, γ(M) =

{A∣∣A ≈ A′, α(A′) =M

}is the set of graph colorings rep-

resented by M and we say that M ≡ N ⇔ γ(M) = γ(N). For a set M of degreematrices we denote γ(M) = ∪

{γ(M)

∣∣M ∈M }.

Due to properties of weak-isomorphism (vertices as well as colors can be reordered)we can exchange both rows and columns of a degree matrix without changing the set ofgraphs it represents. In our construction we assume that the rows of a degree matrix aresorted lexicographically. Observe also that the columns of a degree matrix each form agraphic sequence (when sorted).

Definition 5 (lex sorted degree matrix). For an n × k degree matrix M we denoteby lex(M) the matrix obtained by sorting the rows of M in the lexicographic order(non-increasing).

The following implies that for degree matrices we can assume without loss of gen-erality that rows are lexicographically ordered.

Theorem 2. If M , N are degree matrices then M ≡ N if and only if there existspermutations π : [n] → [n] and σ : [k] → [k] such that, for 1 ≤ i ≤ n, 1 ≤ j ≤ k,Mi,j = Nπ(i),σ(j).

Proof. Let M and N be degree matrices. Then,

M ≡ N Defn. 4⇐=⇒ γ(M) = γ(N)Defn. 4⇐=⇒ ∀G≈H .G ∈ γ(M)↔ H ∈ γ(N)

Defn. 1⇐=⇒∃π,σ.α(G)i,j = α(H)π(i),σ(j)

Defn. 3⇐=⇒Mi,j = Nπ(i),σ(j)

Corollary 1. M ≡ lex(M).

Proof. The result follows from Theorem 2 because M and lex(M) are related by apermutation of rows.

Example 1. The degree matrix on the right of Figure 2 describes both of the graphs inthe figure.

Page 8: Breaking Symmetries in Graph Coloring Problems with Degree

4 Approximating the set of Degree Matrices

Let ϕ(A) be a graph coloring problem in k colors on an n×n adjacency matrix, A, andletA = sol(ϕ(A)) be the set of its solutions. Our goal is to compute a setM of (sorted)degree matrices such that γ(M) ⊇ A and to then useM to facilitate the search for A.Typically, we computeM as an over-approximation of α(A). The following constraintspecifies the relation between an n×n adjacency matrix,A and its corresponding degreematrix, M .

ϕn,kdm(A,M) =∧

1 ≤ i ≤ n1 ≤ c ≤ k

(Mi,c =

n∑j=1

(Ai,j = c)

)(6)

Instead of solving ϕ(A) for all possible values of A (solutions of the graph coloringproblem), we are going to solve ϕ(A)∧ϕn,kdm(A,M) for all possible values ofM (degreematrices of solutions of the graph coloring problem). We further break symmetries inM and inA requiring the rows ofM to be sorted and impose an order on the rows ofA.

sb∗` (A,M) =∧i<j

((Mi �lex Mj) ∧

(Mi =Mj ⇒ Ai �{i,j} Aj

) )(7)

Note that sb∗` (A,M) is similar to the (partitioned lexicographic) symmetry break pred-icate introduced by Codish et al. in [10] for Boolean adjacency matrices.

To justify that Equation (7) specifies a correct symmetry breaking predicate wemust show that whenever it excludes a solution then there is another weakly isomorphicsolution that is not excluded. To this end, we introduce a definition and then a theorem.

Definition 6 (degree matrix preserving permutation). Let A be an adjacency matrixwith a lexicographically ordered degree matrix α(A) =M . We say that permutation πis degree matrix preserving for M and A if α(π(A)) =M .

Theorem 3 (correctness of sb∗` (A,M)). Let A be an adjacency matrix with a lexi-cographically ordered degree matrix α(A) = M . Then, there exists a degree matrixpreserving permutation π such that α(π(A)) =M and sb∗` (π(A),M) holds.

Proof. If the rows of M are distinct, then the theorem holds with π the identity permu-tation. Assume that some rows of M are equal. Denote by P the set of degree matrixpreserving permutations for M and A. Assume the premise and that no π ∈ P satis-fies sb∗` (π(A),M). Let π ∈ P be such that π(A) = min

{π′(A) ∈ P

∣∣π′ ∈ P } (inthe lexicographical order viewing matrices as strings). From the assumption, there existi < j such that Mi =Mj and π(A)i 6�{i,j} π(A)j . Hence there exists a minimal indexk /∈ {i, j} such that π(A)i,k > π(A)j,k. Let A′ be the matrix obtained by permutingnodes i and j in π(A). Since Mi = Mj it follows that α(A′) = M . Thus there isa π′ ∈ P such that π′(A) = A′. If k < i : for 1 ≤ l < k we have π(A)l = A′l.Thus k is the first row for which A′ and π(A) differ. Permuting nodes i and j changesrow k by simply swapping elements π(A)k,i and π(A)k,j . Since π(A)k,i > π(A)k,j ,

Page 9: Breaking Symmetries in Graph Coloring Problems with Degree

clearly A′k ≺ π(A)k hence A′ ≺ π(A) which is a contradiction. Similarly if k > i thesame argument applies to show that i is the first row for which A′ and π(A) differ, thusobtaining the same contradiction for row i.

The following corollary clarifies that if a solution A is eliminated when introducingthe symmetry break predicate sb∗` (A,α(A)) to a graph coloring problem then therealways remains an isomorphic solution A′ which satisfy the predicate sb∗` (A′, α(A′)).

Corollary 2. Let A be an adjacency matrix. Then there exists A′ isomorphic to A suchthat α(A′) is lex ordered and sb∗` (A′, α(A′)) holds.

Proof. LetM = α(A). From Corollary 1 we know thatM ≡ lex(M), thus there existsA′′ isomorphic to A such that α(A′′) = lex(M). From Theorem 3 it follows that thereexists a degree matrix preserving permutation π such that α(π(A′′)) = lex(M) andsb∗` (π(A′′), α(π(A′′))) holds. If A′ = π(A′′) then A′ is isomorphic to A, α(A′) is lexordered and sb∗` (A′, α(A′)) holds.

The set of degree matrices for a corresponding graph coloring problem ϕ(A) is theset of instances of M for which there is a solution to the following constraint:

ϕ(A) ∧ ϕn,kdm(A,M) ∧ sb∗` (A,M) (8)

In the remainder of this section, we focus on how to compute an over-approximationM of the set of degree matrices M for which Constraint (8) is satisfied. This is done intwo steps.

The first step is about finding (a super-set of) all of the degree sequences in the firstcolor in all solutions of ϕ(A). Recall that, in graph theory, the degree sequence of asimple graph is the non-increasing sequence of the degrees of its vertices. These are allpossible first columns of the degree matrices for solutions of ϕ(A). We consider twoscenarios: (1) where the complexity of ϕ(A) derives from the large number of solutions,each of which is easy to find; and (2) where the complexity of ϕ(A) derives from thatof finding even a single solution.

The first scenario. In this case there are many solutions to ϕ(A), perhaps too manyto enumerate using existing solvers. It is often feasible to enumerate all possible firstcolumns of the corresponding degree matrices. So, we apply an incremental SAT solverto obtain all different first columns of the degree matrixM which satisfy Constraint (8).For example, computing the set of all (3, 3, 3; 13) Ramsey colorings is difficult due tothe very large number of solutions of the corresponding constraints [25]. To obtain theset of degree sequences (in the first color) of all solutions we apply this strategy takingϕ(A) = ϕ(3,3,3;13)(A) from Constraint (4). This results in a set of 95 degree sequencesand provides a proof for the following lemma. This is a new characterization of the setof Ramsey (3, 3, 3; 13) colorings.

Lemma 2. If G is a Ramsey (3, 3, 3; 13) coloring of K13 then, the degrees of the ver-tices in the first color correspond to one of the 95 degree sequences depicted in Figure 3.

Page 10: Breaking Symmetries in Graph Coloring Problems with Degree

(4,3,3,3,3,3,3,3,3,3,3,3,3) (4,4,4,3,3,3,3,3,3,3,3,3,3) (4,4,4,4,3,3,3,3,3,3,3,3,2)(4,4,4,4,4,3,3,3,3,3,3,2,2) (4,4,4,4,4,3,3,3,3,3,3,3,3) (4,4,4,4,4,4,3,3,3,3,3,3,2)(4,4,4,4,4,4,4,3,3,3,3,2,2) (4,4,4,4,4,4,4,3,3,3,3,3,3) (4,4,4,4,4,4,4,4,3,3,3,3,2)(4,4,4,4,4,4,4,4,4,3,3,2,2) (4,4,4,4,4,4,4,4,4,3,3,3,3) (4,4,4,4,4,4,4,4,4,4,3,3,2)(4,4,4,4,4,4,4,4,4,4,4,2,2) (4,4,4,4,4,4,4,4,4,4,4,3,3) (4,4,4,4,4,4,4,4,4,4,4,4,2)(4,4,4,4,4,4,4,4,4,4,4,4,4) (5,4,3,3,3,3,3,3,3,3,3,3,3) (5,4,4,4,3,3,3,3,3,3,3,3,3)(5,4,4,4,4,3,3,3,3,3,3,3,2) (5,4,4,4,4,4,3,3,3,3,3,2,2) (5,4,4,4,4,4,3,3,3,3,3,3,3)(5,4,4,4,4,4,4,3,3,3,3,3,2) (5,4,4,4,4,4,4,4,3,3,3,2,2) (5,4,4,4,4,4,4,4,3,3,3,3,3)(5,4,4,4,4,4,4,4,4,3,3,3,2) (5,4,4,4,4,4,4,4,4,4,3,2,2) (5,4,4,4,4,4,4,4,4,4,3,3,3)(5,4,4,4,4,4,4,4,4,4,4,3,2) (5,4,4,4,4,4,4,4,4,4,4,4,3) (5,5,4,3,3,3,3,3,3,3,3,3,3)(5,5,4,4,4,3,3,3,3,3,3,3,3) (5,5,4,4,4,4,3,3,3,3,3,3,2) (5,5,4,4,4,4,4,3,3,3,3,2,2)(5,5,4,4,4,4,4,3,3,3,3,3,3) (5,5,4,4,4,4,4,4,3,3,3,3,2) (5,5,4,4,4,4,4,4,4,3,3,2,2)(5,5,4,4,4,4,4,4,4,3,3,3,3) (5,5,4,4,4,4,4,4,4,4,3,3,2) (5,5,4,4,4,4,4,4,4,4,4,2,2)(5,5,4,4,4,4,4,4,4,4,4,3,3) (5,5,4,4,4,4,4,4,4,4,4,4,2) (5,5,4,4,4,4,4,4,4,4,4,4,4)(5,5,5,4,3,3,3,3,3,3,3,3,3) (5,5,5,4,4,4,3,3,3,3,3,3,3) (5,5,5,4,4,4,4,3,3,3,3,3,2)(5,5,5,4,4,4,4,4,3,3,3,2,2) (5,5,5,4,4,4,4,4,3,3,3,3,3) (5,5,5,4,4,4,4,4,4,3,3,3,2)(5,5,5,4,4,4,4,4,4,4,3,2,2) (5,5,5,4,4,4,4,4,4,4,3,3,3) (5,5,5,4,4,4,4,4,4,4,4,3,2)(5,5,5,4,4,4,4,4,4,4,4,4,3) (5,5,5,5,4,3,3,3,3,3,3,3,3) (5,5,5,5,4,4,4,3,3,3,3,3,3)(5,5,5,5,4,4,4,4,3,3,3,3,2) (5,5,5,5,4,4,4,4,4,3,3,2,2) (5,5,5,5,4,4,4,4,4,3,3,3,3)(5,5,5,5,4,4,4,4,4,4,3,3,2) (5,5,5,5,4,4,4,4,4,4,4,2,2) (5,5,5,5,4,4,4,4,4,4,4,3,3)(5,5,5,5,4,4,4,4,4,4,4,4,2) (5,5,5,5,4,4,4,4,4,4,4,4,4) (5,5,5,5,5,4,3,3,3,3,3,3,3)(5,5,5,5,5,4,4,3,3,3,3,3,2) (5,5,5,5,5,4,4,4,3,3,3,3,3) (5,5,5,5,5,4,4,4,4,3,3,3,2)(5,5,5,5,5,4,4,4,4,4,3,2,2) (5,5,5,5,5,4,4,4,4,4,3,3,3) (5,5,5,5,5,4,4,4,4,4,4,3,2)(5,5,5,5,5,4,4,4,4,4,4,4,3) (5,5,5,5,5,5,4,3,3,3,3,3,3) (5,5,5,5,5,5,4,4,3,3,3,3,2)(5,5,5,5,5,5,4,4,4,3,3,3,3) (5,5,5,5,5,5,4,4,4,4,3,3,2) (5,5,5,5,5,5,4,4,4,4,4,2,2)(5,5,5,5,5,5,4,4,4,4,4,3,3) (5,5,5,5,5,5,4,4,4,4,4,4,2) (5,5,5,5,5,5,4,4,4,4,4,4,4)(5,5,5,5,5,5,5,4,3,3,3,3,3) (5,5,5,5,5,5,5,4,4,3,3,3,2) (5,5,5,5,5,5,5,4,4,4,3,3,3)(5,5,5,5,5,5,5,4,4,4,4,3,2) (5,5,5,5,5,5,5,4,4,4,4,4,3) (5,5,5,5,5,5,5,5,4,3,3,3,3)(5,5,5,5,5,5,5,5,4,4,3,3,2) (5,5,5,5,5,5,5,5,4,4,4,3,3) (5,5,5,5,5,5,5,5,4,4,4,4,2)(5,5,5,5,5,5,5,5,4,4,4,4,4) (5,5,5,5,5,5,5,5,5,4,3,3,3) (5,5,5,5,5,5,5,5,5,4,4,3,2)(5,5,5,5,5,5,5,5,5,4,4,4,3) (5,5,5,5,5,5,5,5,5,5,4,3,3) (5,5,5,5,5,5,5,5,5,5,4,4,4)(5,5,5,5,5,5,5,5,5,5,5,4,3) (5,5,5,5,5,5,5,5,5,5,5,5,4)

Fig. 3. Degree sequences for (3, 3, 3; 13) colorings

The second scenario. In this case, the graph coloring problem is too hard and incre-mentally solving Constraint (8) is not feasible. In this case, we can relax the constraint,possibly introducing more solutions. Iterating with an incremental solver given the re-laxed constraint we obtain a super-set of the corresponding degree sequences, for thefirst color, that would have be obtained with the original Constraint (8). For example,the search for a Ramsey (4, 3, 3; 30) coloring is notoriously difficult [25] and we do notexpect to successfully characterize the degree sequences for its solutions (in any of thecolors). So, we consider Constraint (8) where ϕ(A) is a relaxation of ϕ(4,3,3;30)(A),Constraint (5), in which we impose constraint ϕ30,3

K3in the third color only on 20 of

the 30 vertices in the graph. We have experimented with the choice of how many andwhich vertices to consider in the definition of ϕ. The best results were obtained whenselecting 20 vertices (specifically selecting those represented by the top and bottom 10rows of the matrix) and considering edges in the third color. Clearly any solution ofϕ(4,3,3;30)(A) is also a solution of ϕ(A). Iterating to obtain all of the degree sequencesin the first column of the degree matrix which satisfy Constraint (8) now results in aset of 28 degree sequences and provides a proof for the following lemma. This is a newcharacterization of the set of Ramsey (4, 3, 3; 30) colorings.

Lemma 3. If G is a Ramsey (4, 3, 3; 30) coloring of K30 then, the degrees of the ver-tices in the first color correspond to one of the 28 degree sequences depicted in Figure 4.

Page 11: Breaking Symmetries in Graph Coloring Problems with Degree

(13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13)(14,14,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13)(14,14,14,14,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13)(15,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13)(15,14,14,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13)(15,14,14,14,14,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13)(15,15,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13)(15,15,14,14,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13)(15,15,15,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13)(15,15,15,14,14,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13)(15,15,15,15,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13)(15,15,15,15,15,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13)(16,14,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13)(16,14,14,14,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13)(16,15,14,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13)(16,15,14,14,14,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13)(16,15,15,14,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13)(16,15,15,15,14,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13)(16,16,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13)(16,16,14,14,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13)(16,16,15,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13)(16,16,15,14,14,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13)(16,16,15,15,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13)(16,16,15,15,15,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13)(16,16,16,14,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13)(16,16,16,15,14,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13)(16,16,16,16,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13)(16,16,16,16,15,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13)

Fig. 4. Degree sequences for (4, 3, 3; 30) colorings

The second step involves using the set of degree sequences from the first step to com-pute (a super-set of) all of the degree matrices in any solution of the correspondinggraph coloring problem ϕ(A) on n vertices and in k colors. We compute the setM′ ofall n × k matrices which have as first column one of the given degree sequences. Weconsider here only constraints on degrees, completely ignoring the original coloringproblem ϕ(A). Specifically: (1) We apply the Erdos-Gallai theorem [15,9] to ensurethat the columns of a degree matrix contain graphical sequences: sequences of num-bers which correspond to the degrees of some graph. (2) We ensure that the rows ofthe degree matrix are sorted (non-increasing lexicographic order). (3) When coloring acomplete graph Kn, we insist that the sum of each row in a degree matrix equals n− 1.(4) We apply Theorem 1 to (4, 3, 3; 30) Ramsey colorings.

The computation of the degree matrix approximations for all (4, 3, 3; 30) and (3, 3, 3; 13)Ramsey colorings is described in more detail in Section 6.

5 Solving with Degree Matrices

Let ϕ(A) be a coloring problem on n vertices in k colors and letM be a set of degreematrices such that, for any solution A ∈ sol(ϕ(A)), α(A) ∈ M. We compute thesolutions of ϕ(A) per corresponding M ∈M:

sol(ϕ(A)) =⋃

M∈MsolM (ϕ(A))

Page 12: Breaking Symmetries in Graph Coloring Problems with Degree

Step Notes Computation Times

1 compute degree bounds MiniSAT CryptoMiniSAT Glucose(1 instance, unsat) 13.91 sec. 18.83 sec. 3.75 sec.

2 compute 280 degree sequences Prolog, fast (seconds)

3prove Lemma 2 MiniSAT CryptoMiniSAT Glucose(280 instances, 95 sat, 17 timeouts total: 375.76 hr. 8 timeoutsand 185 unsat) hardest: >60 hr. hardest: 51.11 hr. hardest: >60 hr.

4 extend 95 deg. seq’s to Prolog, fast (minutes)84,184 degree matrices

5compute all Ramsey (3, 3, 3; 13) MiniSAT CryptoMiniSAT Glucosecolorings per degree matrix total: 4011.18 hr. total: 1763.46 hr. total: 3044.79 hr.(84,184 instances, 827,964 solutions) hardest: 21.6 hr. hardest: 6.94 hr. hardest: 28.54 hr.

6 reduce modulo≈. (78,892 solutions) nauty, fast (minutes)

Table 2. ComputingR(3, 3, 3; 13) step by step.

where

solM (ϕ(A)) ={A′ ∈ sol(ϕ(A))

∣∣α(A′) =M}

To compute for a given M ∈ M the set solM (ϕ(A)) we re-apply Constraint (8)using the constraints ϕ(A) of the original graph problem (instead of its relaxed ver-sion). This time, M is given and we iterate to find all graphs A (instead of all degreematrices M ). We are solving the same constraint that we could not solve before Mwas determined and the fact that M is now given eases the search process for threereasons: (1) The problem is now broken into a set of independent sub-problems: com-puting solM (ϕ(A)), for each M ∈ M. These sub-problems can be solved in parallel.In our applications for Ramsey colorings, the setM contains in the order of 100,000such independent instances which are run in parallel. (2) The search can now be di-rected, and (3) Symmetry breaking is facilitated. Degree matrices are isomorphic underrenaming of colors and of graph vertices. Already in the first step, we take advantageof this to break many of the symmetries in the coloring problem. Also, in the secondstep, seeking solutions when given a degree matrix boosts symmetry breaking in theadjacency matrix.

6 Computing Ramsey Colorings

We describe here the constraint solving process applied to determine the values of|R(3, 3, 3; 13)| and ofR(4, 3, 3). Recall the details of our constraint language and com-putational resources described in Section 1. Most importantly, recall that we are usinga SAT solver to determine the existence of colorings for (4, 3, 3; 30) and to find allcolorings for (3, 3, 3; 13).

Experiment 1: computing |R(3, 3, 3; 13)| = 78,892

We describe the step by step computation of the set of all (3, 3, 3; 13) colorings summa-rizing the process in Table 2 where we report on the use of three different SAT solvers:MiniSAT [13,14], CryptoMiniSAT [29], and Glucose [3,4].

Page 13: Breaking Symmetries in Graph Coloring Problems with Degree

Step Notes Computation TimesMiniSAT CryptoMiniSAT Glucose Lingeling

1 prove Lemma 3 2330 sec 987 sec. > 48 hr. —(1 instance, 28 solutions)

2 verify Lemma 3 10.72 sec. 4.26 sec. 6.27 sec. 2.6 sec.(1 instance, unsat)

3extend degree sequences to 72 sec. 216 sec. 80 sec. —degree matrices (28 instances,94,248 solutions)

4 verify degree matrices 67.48 sec. 314.70 sec. 74.26 sec. 1798.1 sec.(28 instances, unsat)

5compute all Ramsey 38 timeouts total: 20.88 hr. 51 timeouts total: 95 hr.(4, 3, 3; 30) colorings hardest:> 48 hr hardest:323.64 sec. hardest:> 48 hr. hardest:55.4 sec(94,248 instances, 0 solutions)

Table 3. ComputingR(4, 3, 3; 30) step by step.

step 1: Prove, using a SAT solver, a bound on the degrees in the first color: Equation (8)together with a constraint that states that, for the first color, the minimal degree is lessthan 2 or the maximal degree is greater than 5, is found unsatisfiable indicating thatdegrees in the first color are between 2 and 5.

step 2: Compute, using Prolog, all graphical sequences [15,9] on 13 vertices withdegrees between 2 and 5. There are 280 such sequences.

step 3: State Lemma 2: For each sequence S from the 280, consider the constraints ofEquation (8), this time fixing the first column of M to S. This results in 280 instances,95 are found satisfiable. The slowest instance required 51 hours of computation us-ing CryptoMiniSAT as the underlying SAT solver. For MiniSAT and Glucose we indi-cate the number of timeouts (after 60 hours). The 95 satisfiable instances were finishedwithin the timeout in both MiniSAT and Glucose.

step 4: Extend, using Prolog, the 95 degree sequences from Lemma 2 to all possiblecorresponding lex sorted degree matrices. The first column in each degree matrix is oneof the sequences in the lemma, each row sums to 12, and the elements of each columnform a graphical sequence (if sorted). This results in a setM of 84,184 degree matrices.

step 5: Compute, using a SAT solver, for each degree matrix M ∈M, all correspond-ing solutions of Equation (8). This involves 84,184 instances and generates in total827,964 (3, 3, 3; 13) colorings. In Table 2 we detail the total solving time for these in-stances and the solving times for the hardest instance for each SAT solver. The largestnumber of graphs generated by a single instance is 10,311.

step 6: The 827,964 graph colorings are reduced modulo weak isomorphism usingnauty3 [21]. This process results in a set with 78,892 graphs.

3 Note that nauty does not handle edge colored graphs and weak isomor-phism directly. We applied an approach called k-layering described at https://computationalcombinatorics.wordpress.com/2012/09/20/canonical-labelings-with-nauty.

Page 14: Breaking Symmetries in Graph Coloring Problems with Degree

Experiment 2: computing R(3, 3, 4; 30) = 30

Theorem 1 states that if there is no (4, 3, 3; 30) Ramsey coloring then R(4, 3, 3) = 30and otherwise R(4, 3, 3) = 31. We show that there is no (4, 3, 3; 30) Ramsey coloringhence proving that R(4, 3, 3) = 30.

We describe the step by step computation summarizing the process in Table 3 wherewe report on the use of four different SAT solvers: MiniSAT [13,14], CryptoMini-SAT [29], Glucose [3,4], and Lingeling [5,6]. There are three main differences in thisprocess in comparison to the steps described for the computation of R(3, 3, 3; 13): (1)We cannot enumerate degree sequences in the first step because there are 30 vertices;(2) BEE is not configured to iterate for all solutions using Lingeling, so we introducethe “verify” steps, 3 and 4 below; and (3) All instances were found to be unsatisfiableimplying that there are no colorings. So, we do not need to apply nauty in the last step.We comment that the CNF instances in all of the instances are not large, consisting of95,000 – 100,000 clauses each.

step 1: State Lemma 3: Compute, using SAT, all graphical sequences [15,9] for thefirst color on 30 vertices with degrees satisfying the constraints of Theorem 1 and arelaxation of Constraint (8) as described in the “second scenario” of Section 4. Thereare 28 such sequences.

step 2: Verify Lemma 3: add to the constraint from the previous step a constraint whichspecifies that the degree sequence in the first color differs from the 28 in the statementof the lemma. The fact that this constraint is unsatisfiable constitutes a proof of thelemma. The purpose of this step is to facilitate the use of Lingeling.

step 3: Extend, using SAT, the 28 degree sequences from Lemma 3 to all possible cor-responding lex sorted degree matrices. Here we ignore the coloring constraints, assumethe constraints of Theorem 1, assume the first column is one of the sequences in thelemma, require that the elements of each column form a graphical sequence (if sorted)and that each row sums to 29. This results in a setM of 94,248 degree matrices.

step 4: Verify, using SAT, that there are no other degree matrices besides the 94,248.This is performed in 28 instances which are all unsat. The purpose of this step is tofacilitate the use of Lingeling.

step 5: Compute, using a SAT solver, for each degree matrix M ∈M, all correspond-ing solutions of Equation (8) using the full (not relaxed) constraint. This involves 94,248instances, all of which are unsatisfiable. In Table 2 we detail the total solving time forthese instances and the solving times for the hardest instance for each SAT solver. ForMiniSAT and Glucose we indicate the number of instances that were not resolved after48 hours.

7 Discussion

Proving extremal bounds and existence cases for combinatorial problems by computeris a common approach, but the question of whether a proof by computer constitutesa proper proof is a controversial one. Most famously the issue caused much heated

Page 15: Breaking Symmetries in Graph Coloring Problems with Degree

debate after publication of the computer proof of the Four Color Theorem [2]. It isstraightforward to justify an existence proof (i.e. a sat result), as it is easy to verify thatthe witness produced satisfies the desired properties. Justifying an unsat result requiresa more philosophical argument, which is beyond the scope of this paper. If nothing else,as in all computer proofs of the kind presented in this paper, we are certainly requiredto add the proviso that our unsat results are based on the assumption of a lack of bugs inthe entire tool chain (constraint solver, sat solver, c-compiler etc.) used to obtain them.Some sat solvers have the ability to reduce a problem down to a minimal set of clauseswhich lead to the empty clause (a minimum unsatisfiable core, [20]). A formal proofof unsatisfiabilty can then potentially be derived from this core. This is itself a hardproblem (possibly unsolvable, due to the size of the core), and not one that we addressin this paper.

Initial proofs by computer can lead to more elegant proofs that rely less (if at all)on computer search. For example the initial skepticism in the case of the Four ColorTheorem was eventually allayed after the initial models used were refined in order toreduce the computer search to fewer subcases [28], finally leading to formalization ofthe proof using the Coq proof assistant [17]. Without the initial computer proofs, thefinal (universally accepted) formal proof may have never existed.

In this paper, we have made the effort to test our results using several differentSAT solvers. We have also provided detailed explanations of how we have proven twointermediate lemmas (Lemmas 2 and 3) using computer search. These lemmas areessential – they have allowed us to both parallelize and direct the search when solvingour two major Ramsey number problems. They may one day be formally proven –perhaps eventually leading to a non-computer proof of our main results.

8 Conclusion

We have proposed a methodology for solving hard graph coloring problems by com-bining ideas related to abstraction and to breaking symmetry during search. Our mainvehicle is the use of degree matrices, both for abstraction and for symmetry breaking.It is worth noting that degree matrices are to graph edge-colorings as degree sequencesare to graphs.

Our approach is general and applies directly to any graph edge coloring problem.We report on the successful application of this approach to solve two open problemsin the area of finite Ramsey theory. The fact that our technique leads to a solution forthese specific problems is a significant indication of the power of the method. Theseproblems have hitherto proven to be untractable, despite a concerted effort over the pastfifty years to solve them, using a variety of techniques — including symmetry breaking.

Our proposed combination of abstraction and symmetry is likely to influence thesearch for a solution to many other hard combinatorial search problems in the future.

Page 16: Breaking Symmetries in Graph Coloring Problems with Degree

References

1. J. M. Al-Jaam. Experiments of intelligent algorithms on Ramsey graphs. Int. Arab J. Inf.Technol., 4(2):161–167, 2007.

2. K. Appel and W. Haken. Every map is four colourable. Bulletin of the American Mathemat-ical Society, 82:711–712, 1976.

3. G. Audemard and L. Simon. Glucose SAT Solver. http://www.labri.fr/perso/lsimon/glucose/.

4. G. Audemard and L. Simon. Predicting learnt clauses quality in modern SAT solvers. InC. Boutilier, editor, IJCAI 2009, Proceedings of the 21st International Joint Conference onArtificial Intelligence, Pasadena, California, USA, July 11-17, 2009, pages 399–404, 2009.

5. A. Biere. Lingeling SAT Solver. http://fmv.jku.at/lingeling/.6. A. Biere. Lingeling essentials, A tutorial on design and implementation aspects of the the

SAT solver lingeling. In D. L. Berre, editor, POS-14. Fifth Pragmatics of SAT workshop,a workshop of the SAT 2014 conference, part of FLoC 2014 during the Vienna Summer ofLogic, July 13, 2014, Vienna, Austria, volume 27 of EPiC Series, page 88. EasyChair, 2014.

7. A. Biere. Yet another local search solver and lingeling and friends entering the sat com-petition 2014. Technical report, Department of Computer Science Series of Publications B,pages 39-40, University of Helsinki, 2014. Proceedings of SAT Competition 2014, A. Balint,A. Belov, M. Heule, M. Jarvisalo (editors).

8. J. R. Carroll and G. Isaak. Degree matrices realized by edge-colored forests. Available fromwww.lehigh.edu/˜gi02/ecforest.pdf (unpublished), 2009.

9. S. A. Choudum. A simple proof of the Erdos-Gallai theorem on graph sequences. Bull.Austral. Math. Soc., 33(1):67–70, 1986.

10. M. Codish, A. Miller, P. Prosser, and P. J. Stuckey. Breaking symmetries in graph representa-tion. In F. Rossi, editor, IJCAI 2013, Proceedings of the 23rd International Joint Conferenceon Artificial Intelligence, Beijing, China, August 3-9, 2013. IJCAI/AAAI, 2013.

11. M. Codish, A. Miller, P. Prosser, and P. J. Stuckey. Constraints for symmetry breaking ingraph representation. Full version of [10] (in preparation)., 2014.

12. J. M. Crawford, M. L. Ginsberg, E. M. Luks, and A. Roy. Symmetry-breaking predicates forsearch problems. In L. C. Aiello, J. Doyle, and S. C. Shapiro, editors, KR, pages 148–159.Morgan Kaufmann, 1996.

13. N. Een and N. Sorensson. MiniSAT SAT Solver. http://minisat.se/Main.html.14. N. Een and N. Sorensson. An extensible sat-solver. In E. Giunchiglia and A. Tacchella,

editors, Theory and Applications of Satisfiability Testing, 6th International Conference, SAT2003. Santa Margherita Ligure, Italy, May 5-8, 2003 Selected Revised Papers, volume 2919of Lecture Notes in Computer Science, pages 502–518. Springer, 2003.

15. P. Erdos and T. Gallai. Graphs with prescribed degrees of vertices (in Hungarian). Mat.Lapok, pages 264–274, 1960. Available from http://www.renyi.hu/˜p_erdos/1961-05.pdf.

16. I. P. Gent and B. M. Smith. Symmetry breaking in constraint programming. In W. Horn,editor, ECAI 2000, Proceedings of the 14th European Conference on Artificial Intelligence,Berlin, Germany, August 20-25, 2000, pages 599–603. IOS Press, 2000.

17. G. Gonthier. Formal proofthe four-color theorem. Noticies of the AMS, 55(11):1382–1293,2008.

18. J. Kalbfleisch and R. Stanton. On the maximal triangle-free edge-chromatic graphs in threecolors. Journal of Combinatorial Theory, 5:9–20, 1968.

19. J. G. Kalbfleisch. Chromatic Graphs and Ramsey’s Theorem. PhD thesis, University ofWaterloo, January 1966.

Page 17: Breaking Symmetries in Graph Coloring Problems with Degree

20. I. Lynce and J. Marques-Silva. On computing minimum unsatisfiable cores. In SAT 2004,volume 3542 of Lecture Notes in Computer Science, pages 305–310. Springer, 2005.

21. B. McKay. nauty user’s guide (version 1.5). Technical Report TR-CS-90-02, AustralianNational University, Computer Science Department, 1990.

22. P. Meseguer and C. Torras. Exploiting symmetries within constraint satisfaction search. Artif.Intell., 129(1-2):133–163, 2001.

23. A. Metodi, M. Codish, and P. J. Stuckey. Boolean equi-propagation for concise and efficientSAT encodings of combinatorial problems. J. Artif. Intell. Res. (JAIR), 46:303–341, 2013.

24. K. Piwakowski. On Ramsey number r(4, 3, 3) and triangle-free edge-chromatic graphs inthree colors. Discrete Mathematics, 164(1-3):243–249, 1997.

25. K. Piwakowski and S. P. Radziszowski. 30 ≤ R(3, 3, 4) ≤ 31. Journal of CombinatorialMathematics and Combinatorial Computing, 27:135–141, 1998.

26. J. Puget. On the satisfiability of symmetrical constrained satisfaction problems. In H. J.Komorowski and Z. W. Ras, editors, Methodologies for Intelligent Systems, 7th InternationalSymposium, ISMIS ’93, Trondheim, Norway, June 15-18, 1993, Proceedings, volume 689 ofLecture Notes in Computer Science, pages 350–361. Springer, 1993.

27. S. P. Radziszowski. Small Ramsey numbers. Electronic Journal of Combinatorics, 1994.Revision #14: January, 2014.

28. N. Robertson, Sanders, P. Seymour, and R. Thomas. The four-colour theorem. Journal ofCombinatorial Theory, Series B, 70:2–44, 1997.

29. M. Soos. CryptoMiniSAT, v2.5.1. http://www.msoos.org/cryptominisat2,2010.