7
Finding Paths between Graph Colourings: Computational Complexity and Possible Distances Paul Bonsma a , Luis Cereceda b , Jan van den Heuvel b and Matthew Johnson c a Institut f¨ ur Mathematik, Sekr. MA 6-1, Technische Universit¨ at Berlin, Straße des 17. Juni 136, 10623 Berlin, Germany. Email: [email protected] b Centre for Discrete and Applicable Mathematics, Mathematics Department, London School of Economics, Houghton Street, London WC2A 2AE, UK. Email: {jan, luis}@maths.lse.ac.uk c Department of Computer Science, Durham University, Science Laboratories, South Road, Durham DH1 3LE, UK. Email: [email protected] Abstract Suppose we are given a graph G together with two proper vertex k-colourings of G, α and β. How easily can we decide whether it is possible to transform α into β by recolouring vertices of G one at a time, making sure we always have a proper k- colouring of G? We prove a dichotomy theorem for the computational complexity of this decision problem: for values of k 3 the problem is polynomial-time solvable, while for any fixed k 4 it is PSPACE-complete. What is more, we establish a connection between the complexity of the problem and its underlying structure: we prove that for k 3 the minimum number of necessary recolourings is polynomial in the size of the graph, while for k 4 instances exist where this number is superpolynomial. Keywords: colour graph, PSPACE-completeness, superpolynomial paths. Electronic Notes in Discrete Mathematics 29 (2007) 463–469 1571-0653/$ – see front matter © 2007 Elsevier B.V. All rights reserved. www.elsevier.com/locate/endm doi:10.1016/j.endm.2007.07.073

Finding Paths between Graph Colourings: Computational Complexity and Possible Distances

Embed Size (px)

Citation preview

Finding Paths between Graph Colourings:Computational Complexity and Possible

Distances

Paul Bonsma a, Luis Cereceda b, Jan van den Heuvel b andMatthew Johnson c

a Institut fur Mathematik, Sekr. MA 6-1, Technische Universitat Berlin, Straße

des 17. Juni 136, 10623 Berlin, Germany. Email: [email protected]

b Centre for Discrete and Applicable Mathematics, Mathematics Department,

London School of Economics, Houghton Street, London WC2A 2AE, UK. Email:

{jan, luis}@maths.lse.ac.ukc Department of Computer Science, Durham University, Science Laboratories,

South Road, Durham DH1 3LE, UK. Email: [email protected]

Abstract

Suppose we are given a graph G together with two proper vertex k-colourings of G, α

and β. How easily can we decide whether it is possible to transform α into β byrecolouring vertices of G one at a time, making sure we always have a proper k-colouring of G?

We prove a dichotomy theorem for the computational complexity of this decisionproblem: for values of k ≤ 3 the problem is polynomial-time solvable, while forany fixed k ≥ 4 it is PSPACE-complete. What is more, we establish a connectionbetween the complexity of the problem and its underlying structure: we prove thatfor k ≤ 3 the minimum number of necessary recolourings is polynomial in the sizeof the graph, while for k ≥ 4 instances exist where this number is superpolynomial.

Keywords: colour graph, PSPACE-completeness, superpolynomial paths.

Electronic Notes in Discrete Mathematics 29 (2007) 463–469

1571-0653/$ – see front matter © 2007 Elsevier B.V. All rights reserved.

www.elsevier.com/locate/endm

doi:10.1016/j.endm.2007.07.073

1 Results

For a natural number k and a graph G = (V, E), we regard a k-colouring of G

as a function α : V → {1, 2, . . . , k} such that α(u) �= α(v) for all uv ∈ E.We define the k-colour graph of G, denoted Ck(G), as the graph that hasthe k-colourings of G as its node set, with two k-colourings joined by anedge in Ck(G) if they differ in colour on just one vertex of G. We assumethroughout that k ≥ χ(G) ≥ 2, where χ(G) is the chromatic number of G.Having defined the colourings as nodes of Ck(G), the meaning of the pathbetween two colourings should be clear.

We formulate the question we are interested in as the following decisionproblem.

k-Colour PathInstance : Graph G, two k-colourings of G, α and β.Question : Is there a path between α and β in Ck(G)?

It is easy to see that there is a path between k-colourings α and β of G ifand only if, for every connected component H of G, there is a path betweenthe colourings induced by α and β on H . For this reason we always take our“argument graph” G to be connected.

The problem 2-Colour Path is trivial: the 2-colour graph of a connectedbipartite graph always consists of two isolated nodes.

For 3-colourings, we have the following:

Theorem 1.1 ([3]) The decision problem 3-Colour Path is in P.

We sketch the algorithm that decides 3-Colour Path in Section 2.1. Theproof of correctness of this algorithm can be used to exhibit a path betweenthe given 3-colourings, if such a path exists. In such a case the algorithmuses O(|V (G)|2) recolouring steps, proving:

Theorem 1.2 ([3]) Let G be a 3-colourable graph with n vertices. Then thediameter of any component of C3(G) is O(n2).

For k ≥ 4, the complexity of the problem is very different: in this case itis PSPACE-complete. (We give an outline of the reduction that proves this inSection 2.2.) In fact:

Theorem 1.3 ([4]) The decision problem k-Colour Path is PSPACE-completefor the following restricted instances:

(i) bipartite graphs and any fixed k ≥ 4;

P. Bonsma et al. / Electronic Notes in Discrete Mathematics 29 (2007) 463–469464

(ii) planar graphs and any fixed 4 ≤ k ≤ 6;

(iii) bipartite planar graphs and k = 4.

In contrast to Theorem 1.2, and in alignment with Theorem 1.3, for k ≥ 4we have the following:

Theorem 1.4 ([4]) For every k ≥ 4, there exists an infinite class of graphs Gk

with the following property: for every graph G ∈ Gk there exist two k-colourings α

and β such that the length of any path between α and β in Ck(G) is superpoly-nomial in the size of G. Moreover,

(i) for any fixed k ≥ 4, the graphs in Gk may be taken to be bipartite;

(ii) for any fixed 4 ≤ k ≤ 6, the graphs in Gk may be taken to be planar; and

(iii) for k = 4, the graphs in Gk may be taken to be planar and bipartite.

The values of k in (ii) and (iii) in Theorem 1.3 are tight: for larger valuesof k the instance is always a YES-instance. This follows from Theorem 1.5below, proved in [5]. Let us recall that the degeneracy deg(G) of a graph G

(also known as the colouring number or the maximin degree) is defined as thelargest minimum degree of any subgraph of G. That is, deg(G) = max

H⊆G

δ(H).

Let us also recall that the degeneracy of a planar graph is at most 5, and thatof a bipartite planar graph at most 3.

Theorem 1.5 ([5]) For any graph G and integer k ≥ deg(G) + 2, Ck(G) isconnected.

2 Proof sketches

2.1 A polynomial-time algorithm for 3-Colour Path

We give an outline of the algorithm that decides 3-Colour Path, omittingall proofs. Let G, α, β denote an instance of 3-Colour Path. We define afrozen fragment of α as a connected set of vertices that can never be recoloured,no matter what path is followed from α in C3(G).

Observation 2.1 Suppose α and β have different frozen fragments, or equalfrozen fragments that are coloured differently. Then α and β are not connectedby a path in C3(G).

We note that the premises in the above observation can straightforwardlybe checked in polynomial time. If they hold, the algorithm returns NO. Other-wise, α and β have equal frozen fragments (possibly empty) that are coloured

P. Bonsma et al. / Electronic Notes in Discrete Mathematics 29 (2007) 463–469 465

alike, and we proceed as follows. If the frozen fragments are non-empty, weidentify all frozen vertices (vertices forming part of some frozen fragment) thathave the same colour, ending up with a new graph and two new 3-colouringswhich each have the same triangle as their only frozen fragment. For conve-nience, we maintain the same notation for this new instance, which is clearlya YES-instance if and only if the original one is. Hence we can now assumethat α and β have no frozen fragment or have the same triangle as their uniquefrozen fragment.

We define the weight of an edge e = uv oriented from u to v in α as

w(−→uv, α) =

⎧⎨⎩

+1, if α(u)α(v) ∈ {12, 23, 31};

−1, if α(u)α(v) ∈ {21, 32, 13}.

To orient a cycle means to orient each edge on the cycle so that a directedcycle is obtained. If C is a cycle, then by

−→C we denote the cycle with one of

the two possible orientations. The weight W (−→C , α) of an oriented cycle

−→C is

the sum of the weights of its oriented edges.

Observation 2.2 Let C be a cycle in G. If α and β are connected by a pathin C3(G), then we must have W (

−→C , α) = W (

−→C , β).

This of course means that if G contains a cycle C for which W (−→C , α) �=

W (−→C , β), then α and β cannot possibly be connected in C3(G). On the other

hand:

Claim 2.3 Suppose all cycle weights of α and β are equal (where α and β haveno frozen fragment or have the same triangle as their only frozen fragment).Then there is a path between α and β in C3(G).

That we can check all cycle weights of α and β in polynomial time followsfrom:

Claim 2.4 Let G be a graph with n vertices and m edges. Let α be a 3-colouring of G and let C1, C2, . . . , Cm−n+1 be a cycle basis for G. Then for anycycle C in G, W (

−→C , α) is determined by W (

−→C1, α), W (

−→C2, α), . . . , W (

−−−−−→Cm−n+1, α).

The proof of Claim 2.3 is constructive, and uses less than |V (G)|2 recolour-ing steps. Accordingly, if α and β are connected, we can find a path betweenthem of length less than |V (G)|2.

2.2 PSPACE-completeness of k-Colour Path for k ≥ 4

It is easy to see that k-Colour Path is in PSPACE by noting that k-ColourPath is in NPSPACE and then appealing to Savitch’s Theorem which asserts

P. Bonsma et al. / Electronic Notes in Discrete Mathematics 29 (2007) 463–469466

that PSPACE=NPSPACE. The fact that k-Colour Path is in NPSPACEfollows from the observation that given an instance G, α, β of k-Colour Pathtogether with a sequence of recolourings transforming α into β (a certificate),the validity of this certificate can easily be checked using a polynomial amountof space.

Our reduction first establishes the PSPACE-hardness of 4-Colour Path;it is then not hard to show that k-Colour Path is reducible to (k + 1)-Colour Path. We prove that 4-Colour Path is PSPACE-hard via a re-duction from a restricted instance of Sliding Tokens, one of several decisionproblems defined and proved to be PSPACE-complete in [7]. We give somedefinitions necessary to describe this problem. A token configuration in agraph G is a set of vertices on which tokens are placed, in such a way that notwo tokens are adjacent. (Thus a token configuration can be thought of as anindependent set of vertices of G.) A move between two token configurationsis the displacement of a token from one vertex to an adjacent vertex. (Notethat a move must result in a valid token configuration.) Sliding Tokens isdefined as follows.

Sliding TokensInstance : Graph G, two token configurations of G, TA and TB.Question : Is there a sequence of moves transforming TA into TB?

The reduction used in [7] to prove the PSPACE-completeness of SlidingTokens yields a very restricted instance of this problem. In fact, for such aninstance, G can be taken to be a planar graph of maximum degree 3 and, moreimportantly, the token configurations TA and TB are such that the possibletoken moves from either of them are very limited. We emphasise that ourreduction to 4-Colour Path is from such a restricted instance—we do notgive a reduction from the general problem.

3 Discussion

In terms of the number of colours k and the degeneracy d of the instance graph,we have a full dichotomy for the complexity of k-Colour Path. If k ≤ 3or k ≥ d + 2, the problem is in P. In all other cases, the problem is PSPACE-complete (the reductions that prove Theorem 1.3 yield instances with d =k−1). In particular, this completely determines the complexity of k-ColourPath for planar and bipartite planar graphs.

We have also shown that for k ≤ 3, the components of the k-colour graph

P. Bonsma et al. / Electronic Notes in Discrete Mathematics 29 (2007) 463–469 467

always have quadratic diameter. Let us mention that we can prove the sameresult when k ≥ 2d + 1. On the other hand, for 4 ≤ k ≤ d + 1, there ex-ist graphs whose k-colour graph has components of superpolynomial diameter(the graphs of Theorem 1.4 also have degeneracy k−1). Thus it remains to de-termine whether for every graph G, the diameter of Ck(G) is polynomial in thesize of G when k ≥ 4 and d+1 < k < 2 d+1. If true, this would prove a com-plete correspondence between the PSPACE-completeness of k-Colour Pathand possible superpolynomial diameter components in Ck(G), according to ourclassification of instances by number of colours and degeneracy. Let us pointout that the existence of instances with colour graph components of superpoly-nomial diameter would follow from the truth of the well-known NP �=PSPACEconjecture.

Instead of asking whether two given k-colourings of a graph G are con-nected, we may wish to know whether all k-colourings are connected. Thisquestion has been looked at, in a certain sense, in the theoretical physics com-munity when studying the Glauber dynamics of an anti-ferromagnetic Pottsmodel at zero temperature. Associated with that research is the work on rapidmixing of Markov chains defined on what we call the k-colour graph, in orderto obtain efficient algorithms for almost uniform sampling of k-colourings ofa graph. See, for example, [8] and references therein. Most of the work inthose areas has, however, concentrated on specific graphs such as finite partsof integer grids, or on values of k for which the connectedness of the k-colourgraph is guaranteed. What can be said for general graphs and small valuesof k? Some first results relating to this question are given in [1,2]. In particu-lar, [2] settles the computational complexity of the following decision problem:given a 3-colourable graph G, is C3(G) connected? This problem is proved tobe coNP-complete for bipartite graphs but polynomial-time solvable for bi-partite planar graphs. For G a 3-chromatic graph, the answer is always in thenegative.

It is very interesting to compare the work presented in this extended ab-stract and [1,2] with [6], which contains remarkably similar results. For a giveninstance ϕ of the Boolean satisfiability problem, the authors of [6] define thegraph G(ϕ) as the graph with vertex set the satisfying assignments of ϕ, andassignments adjacent whenever they differ in exactly one bit. They then con-sider the analogous question to the one we address here: given ϕ togetherwith two satisfying assignments, are the assignments in the same connectedcomponent of G(ϕ)? In consonance with our results, they find the same corre-spondence between PSPACE-complete instances of this decision problem andpossible superpolynomial paths in the graph of satisfying assignments. (In a

P. Bonsma et al. / Electronic Notes in Discrete Mathematics 29 (2007) 463–469468

similar fashion to [1,2], and again finding very similar results, they also studythe decision problem: given ϕ, is G(ϕ) connected?) We note that despite theparallelism between the results, the proofs are, in each case, very different.

References

[1] Cereceda, L., J. van den Heuvel and M. Johnson, Connectedness of the graph

of vertex-colourings, CDAM Research Report LSE-CDAM-2005-11 (2005).Available from http://www.cdam.lse.ac.uk/Reports/reports2005.html;accepted for publication in Discrete Math.

[2] Cereceda, L., J. van den Heuvel and M. Johnson, Mixing 3-colourings

in bipartite graphs, CDAM Research Report LSE-CDAM-2007-06 (2007).Available from http://www.cdam.lse.ac.uk/Reports/reports2007.html;submitted.

[3] Cereceda, L., J. van den Heuvel and M. Johnson, Finding paths between 3-

colourings, in preparation.

[4] Bonsma, P., and L. Cereceda, Finding paths between graph colourings:

PSPACE-completeness and superpolynomial distances, in preparation.

[5] Dyer, M., A. Flaxman, A. Frieze and E. Vigoda, Randomly coloring sparse

random graphs with fewer colors than the maximum degree, Random Struct.Algor. 29(4) (2006), 450–465.

[6] Gopalan, P., P.G. Kolaitis, E.N. Maneva and C.H. Papadimitriou,The connectivity of Boolean satisfiability: computational and structural

dichotomies, “Automata, Languages and Programming, Proceedings of the 33rdInternational Colloquium, ICALP 2006, Part I”, LNCS 4051 (2006), 346–357.Available from http://arxiv.org/abs/cs.CC/0609072.

[7] Hearn, R.A., and E.D. Demaine, PSPACE-completeness of sliding-block puzzles

and other problems through the nondeterministic constraint logic model of

computation, Theoret. Comput. Sci. 343 (2005), 72–96.

[8] Jerrum, M., “Counting, Sampling and Integrating : Algorithms andComplexity,” Birkhauser Verlag, Basel, 2003.

P. Bonsma et al. / Electronic Notes in Discrete Mathematics 29 (2007) 463–469 469