The stubborn problem is stubborn no more (a polynomial algorithm for 3-compatible colouring and the stubborn list partition problem)
One of the driving problems in the CSP area is the Dichotomy Conjecture, formulated in 1993 by Feder and Vardi [STOC'93], stating that for any fixed relational structure G the Constraint Satisfaction Problem CSP(G) is either NP--complete or polynomia…
Authors: Marek Cygan, Marcin Pilipczuk, Michal Pilipczuk
In this paper we consider a variant of the graph colouring problem, namely the k-COMPATIBLE COLOURING problem. We are given a complete graph with each edge assigned one of k possible colours and we want to assign one of those k colours to each vertex in such a way that no edge has the same colour as both of its endpoints. Formally: k-COMPATIBLE COLOURING (sometimes called EDGE FREE k-COLOURING) Input: A complete undirected graph G = (V, E) and a function C : E → {0, . . . , k -1} Question: Does there exist a function φ : V → {0, . . . , k -1} such that for each edge uv ∈ E either φ(u) = C(uv) or φ(v) = C(uv)
For k = 1 this problem is meaningless, but for k = 2 it can be interpreted as a split graphs recognition problem. Indeed, if we consider a graph G ′ = (V, C -1 {1}) (i.e., we take only those edges from e ∈ E for which C(e) = 1) our task is equivalent to partitioning the graph G ′ into a clique and an independent set. Graphs that can be partitioned in this way are called split graphs and can be recognized in linear time [14].
It is known [16] that for k ≥ 4 the k-COMPATIBLE COLOURING problem becomes NP-complete. However, for k = 3 the problem of its tractability has been open for several years. In this paper we show a polynomial-time algorithm for this case.
To compare, the classical colouring problem is NP-complete for k ≥ 3 and polynomial time solvable for k ≤ 2. Until now it was not known whether k-COMPATIBLE COLOURING admits such a dichotomy since the previously best algorithm (by Feder et al. from 2005 [10]) has a n O(log n/ log log n) time complexity which is an improvement over the n O(log n) time complexity of an algorithm by Feder and Hell [8].
We briefly sketch the CONSTRAINT SATISFACTION PROBLEM (CSP) definition in the notation proposed by Feder and Vardi [13]. For a fixed relational structure Γ in the problem CSP(Γ) we are given a second relational structure G and we are asked whether there exists a homomorphism of G to Γ (a mapping f : V (G) → V (Γ) which preserves all the relations). Feder and Vardi [13] in 1993 formulated the following conjecture which remains open and motivates a lot of research in this area.
Conjecture 1 (The Dichotomy Conjecture [13]). For any fixed relational structure Γ the problem CSP(Γ) is either NP-complete or polynomial time solvable.
Since then dozens of papers have been written proving this conjecture in several special cases (for a survey see [16]). In particular, Conjecture 1 holds for every relational structure of size two [18] and three [2].
The k-COMPATIBLE COLOURING problem is a variant of full-CSP problems introduced by Feder and Hell in [8], whereas the exact name k-COMPATIBLE COLOURING to the best of our knowledge comes from [15]. Intuitively, in full-CSP problems we restrict ourselves to structures G in which every tuple of elements is restricted by some constraint. A similar variant of CSP studied in the literature is called the LIST MATRIX PARTITION where Γ is represented by an r × r symmetrical matrix M with entries being subsets of {0, . . . , q -1} for some integer q. We are given a complete graph G with vertices equipped with subsets of {0, . . . , r -1} and edges assigned values from {0, . . . , q -1}. We ask whether there exists a function φ : V (G) → {0, . . . , r -1} such that for each v = w ∈ V (G), φ(v) belongs to the set tied to the vertex v and the value associated with the edge vw belongs to the set in the φ(v)-th row and φ(w)-th column of M . A formal description can be found in [9]. It is known that for fixed q, r the LIST MATRIX PARTITION problem enjoys a quasi-dichotomy.
Theorem 2 (Quasi-dichotomy Theorem [7]). For each pair of positive integers r, q and for each symmetrical r × r matrix M whose entries are subsets of the set {0, . . . , q -1} the LIST MATRIX PARTITION problem is either NP-complete or solvable in quasipolynomial time.
The currently best bound for the quasipolynomial from Theorem 2 due to Feder and Hell [7] is n O(log n) , where n = |V (G)|. In order to check whether this quasi-dichotomy is a classical dichotomy several special cases for small values of q and r were studied. In particular, Cameron et al. [3] were able to classify almost all matrices with r ≤ 4 and q = 2. For all classified matrices either a polynomial time algorithm or a NP-completeness proof was given. Interestingly enough, the classified cases were equivalent to numerous classical graph problems such as: 3-colourability, clique cutset, stable cutset, skew partition and split graphs recognition. To underline the significance of the LIST MATRIX PARTITION we recall (as stated in [3]) that the resolution of the Strong Perfect Graph Conjecture by Chudnovsky et al. [4] relies in part on decompositions that can be formulated as LIST MATRIX PARTITION instances. The only two matrices that Cameron et al. could not classify are polynomially equivalent to the following problem which came to be called the STUBBORN PROBLEM. STUBBORN PROBLEM Input: An undirected graph G = (V, E) and a constraint function L : V →P({1, 2, 3, 4}) Question: Does there exists a colouring φ : V →{1, 2, 3, 4}, for which φ(v) ∈ L(v), φ -1 (4) is a clique, and for any edge uw ∈ E the set φ -1 ({u, w}) is different from {1}, {2} and {1, 3}?
It is known that a polynomial algorithm for the 3-COMPATIBLE COLOURING problem implies a polynomial algorithm for the STUBBORN PROBLEM (as stated in [8]). Due to their role as the the last unresolved case in the classification of Cameron et al., the problems attracted quite a lot of attention. In particular, the polynomial status of 3-COMPATIBLE COLOURING or STUBBORN PROBLEM was mentioned as an open problem in numerous places including [1,3,5,6,7,8,10,11,12,15]. Our results prove the dichotomy for the k-COMPATIBLE COLOURING problem. Moreover, combining with results by Cameron at al. [3] we finish the matrix classification up to size 4 × 4 for the LIST MATRIX PARTITION problem proving that quasi-dichotomy can be strengthened to the classical dichotomy and hence improve results of Feder et al. [9]. Theorem 5. Let M be a symmetrical r × r matrix whose entries are subsets of {0, 1}. If r ≤ 4 then for M the LIST MATRIX PARTITION problem is either NP-complete or solvable in polynomial time.
In the literature one can also find a list version of the 3-COMPATIBLE COLOURING problem, where each vertex v is additionally equipped with a set S v ⊆ {R, G, B}; and we demand that the colouring we construct satisfies additionally φ(v) ∈ S v . It is known that the list version of the 3-COMPATIBLE COLOURING problem can be reduced to the original 3-COMPATIBLE COLOURING problem for instance using gadgets described in Appendix A.
The 3-COMPATIBLE COLOURING problem came to our attention when posted by Marx in the open problems list from Dagstuhl Seminar 09511 on Parameterized complexity and approximation algorithms [6]. Marx suspected that Fixed Parameter Tractability tools and intuitions may be useful either to design a polynomial time algorithm or a quasi-polynomial lower bound. While the final version of the algorithm is elementary and uses no tools from the parametrized complexity setting, our reasoning was heavily influenced by a technique called iterative compression, developed by Reed et al. [17].
In Section 2 we investigate the structure of solutions for the 2-COMPATIBLE COLOUR-ING problem (i.e., finding a split graph structure). In Section 3 we present our algorithm where Section 4 is devoted to its correctness and Section 5 to its time complexity. The correctness of our algorithm is not hard, hence an advanced reader may skip this section. However, the proof of the time complexity of our algorithm is not trivial and relies on interesting combinatorial facts included in Lemma 17.
We were unable to find a reduction from the STUBBORN PROBLEM to the 3-COMPATIBLE COLOURING problem in literature. Hence for the sake of completeness, we present our own reduction in Appendix A.
We assume that we are given an input to the 3-COMPATIBLE COLOURING problem: an undirected complete graph G = (V, E) with a colouring of edges C : E → {R, G, B} (we denote the colours by R, G and B). For a subset of vertices X ⊆ V by G[X] we denote the subgraph induced by X. For a subset of edges E ′ ⊆ E by V (E ′ ) we denote the set of all endpoints of edges in E ′ . Similarly, for a subset of vertices V ′ ⊆ V by E(V ′ ) we denote the set of edges with both endpoints in the set V ′ .
We first consider the structure of 2-COMPATIBLE COLOURING. Let W be such a set of vertices that C restricted to E(W ) has only two values, say R and B. We look for all feasible colourings φ : W →{R, B}. Definition 6. We say a vertex v ∈ W is interesting if there exist two feasible colourings
In particular, if there is no feasible colouring of W , all vertices of W are boring. Lemma 7. Let u, v, w be three such vertices in W that the C(uv) = C(vw) = C(uw). Then v is boring, as it does not admit a feasible colouring with φ(v) = C(vw).
As any feasible colouring of W restricted to {u, v, w} is a feasible colouring of {u, v, w}, v cannot be interesting.
Moreover, there exists an algorithm which either finds a boring vertex and the colour it cannot have, or returns NO if all vertices are interesting. The algorithm works in O(|W | 2 ) time.
Proof. If all the edges of E(W ) are of the same colour (without losing generality R), every vertex v ∈ W is interesting, as when one sets φ(w) = B for w = v, then any value of φ(v) makes φ a feasible colouring. Therefore, in this case the answer of the algorithm is ,,NO". This check can be performed in O(|W | 2 ) time. Now assume we found two edges u 1 v 1 and u 2 v 2 of different colours. If these edges share an endpoint, e.g. v 1 = v 2 , then there is a multicoloured triangle (u 1 , u 2 , v 1 ). On the other hand if all the endpoints are different, then the edge u 1 u 2 has a different colour from one of the edges u 1 v 1 , u 2 v 2 . Therefore, one of the triples (u 1 , u 2 , v 1 ) or (u 1 , u 2 , v 2 ) forms a multicoloured triangle. In each case the multicoloured triangle gives us a boring vertex with its inadmissible colour as in Lemma 7 in constant time.
Let v 1 , v 2 , . . . , v n to be an arbitrary order on V . Suppose we have an instance (V, C) of the 3-COMPATIBLE COLOURING problem. Let V i = {v 1 , v 2 , . . . , v i }, and let C i be the restriction of C to edges in E(V i ). Notice that if φ is a solution for (V i , C i ), then φ restricted to V j is a solution to (V j , C j ) for any j < i. Thus, in particular, if there is a positive answer to (V, C), then there is a positive answer to any (V i , C i ).
We proceed by building a solution for each (V i , C i ). Obviously we may start the induction with an empty set V 0 and empty function C 0 . If for some i we show there is no solution, we return NO as an answer to the original (V, C) instance. Moreover, when building the solution to (V i , C i ) we assume we are given some solution to (V i-1 , C i-1 ). Thus, we can focus on a situation in which we solve an instance (V, C) and we already have a feasible colouring φ 0 for (V \ {v 0 }, C) for one fixed vertex v 0 . We use this feasible colouring φ 0 to deeply exploit the colouring of the graph G[V \ {v 0 }] which is a crucial part in designing our algorithm. This type of reasoning is one of the key parts of the aforementioned iterative compression technique used in the Fixed Parameter Tractability community.
In each step of the algorithm we have a division of V into eighteen sets, six corresponding to each of the three colours. The algorithm is a branching algorithm -we perform operations which either simply move the vertices around, or branch out into several instances. Then we resolve each branch recursively, and if we find a feasible colouring in any of them, we return this colouring, while if all the branches return NO, we return NO. We follow a naming convention in which if X is one of the colours in {R, G, B}, then Y and Z are the other two.
Consider any colour X ∈ {R, G, B}. The sets corresponding to this colour are Free X , ToDo X , Set X , ToSet X , NotY X and NotZ X . The intuitive meanings of these sets are as follows:
• Free X -the "free" vertices of colour X -those, which were of colour X in φ 0 and our algorithm
has not yet gained any information about them;
• ToDo X -the "to do" vertices of colour X -those, which were of colour X in φ 0 , but our algorithm already learned they will not be of colour X in the new colouring;
• Set X -the "set" vertices of colour X -those which our algorithm has already determined to be of colour X;
• ToSet X -the "to set" vertices of colour X -those which are determined to be of colour X in the new colouring, but we have to update the current division of V before we put them into Set X ;
• NotY X and NotZ X -the "not Y" and "not Z" vertices of colour X -those which were of colour X in φ 0 , and we already know they will not be of colour Y (or Z, respectively) in the new colouring.
This information can be represented by associating with each vertex the colour assigned to it by φ 0 and the subset S(v) ⊆ {R, G, B} of colours which are still admissible as values of φ(v). Such an approach would certainly streamline any implementation of the algorithm, but we think that naming each set separately helps underline the role each particular set plays in the analysis -thus the choice of this method of presentation.
To start the algorithm we put φ -1 0 (R) into Free R , φ -1 0 (B) into Free B and φ -1 0 (G) into Free G . There are three possible colours we can give to v 0 , thus we branch out into three cases, putting v 0 into ToSet B , ToSet R or ToSet G .
The algorithm uses two subprocedures -shifting a vertex (from ToSet X to Set X ) and resolving a set ToDo X . As long as any of the sets ToSet X is non-empty, we shift vertices from this set. If all sets ToSet X are empty, but there is a non-empty set ToDo X , we resolve the set ToDo X . If all the sets ToSet X and ToDo X are empty, we claim that setting φ(v) = X for v ∈ Set X ∪ Free X ∪ NotY X ∪ NotZ X is a feasible solution and return it.
The meaning of this step is that we have a vertex v for which we have just determined that φ(v) = X. This gives us some information about the vertices w with C(vw) = X, which we represent by moving vertices between appropriate sets. After including the gained information in our structure we can safely move v into Set X .
Let v ∈ ToSet X . The procedure of shifting a vertex works as follows: we move v from ToSet X to Set X , and then consider all w ∈ V such that C(vw) = X. For each such vertex w we perform the appropriate action (in parentheses we give the intuitive meanings of the actions). As before, Y denotes any colour different than X and Z denotes the third colour different than X and Y.
• If w ∈ Set X return NO from this branch (we have two vertices for which φ(v) = φ(w) = X connected with an X-edge);
• If w ∈ Free X move w to ToDo X (w cannot be of colour X);
• If w ∈ NotY X move w to ToSet Z , where Z is the third colour, that is {X, Y, Z} = {R, G, B} (it is not of colour X nor Y, thus it is of colour Z);
• If w ∈ ToDo Y move w to ToSet Z , where Z is as above (again, w is neither of colour Y nor X, so it is of colour Z);
• If w ∈ Free Y move w to NotX Y (w cannot be of colour X);
Consider a non-empty set ToDo X . The meaning of this step is that we have a set of vertices that were of colour X in φ 0 , but we see they cannot be of colour X in φ. Thus, there are no X-edges in E(ToDo X ), and we have to colour ToDo X into the two remaining colours. If there are any boring vertices in ToDo X , we know how to colour them, so we move them to appropriate ToSet sets and go back to shifting vertices. If all vertices in ToDo X are interesting, we find all possible colourings of ToDo X and branch out.
We prove formally that E(ToDo X ) contains no edges of colour X in Section 4. Apply the algorithm from Lemma 8 to ToDo X . If we find any boring vertex v which does not admit colour Y, we move it to ToSet Z and finish the resolving step. If all vertices in ToDo X are interesting, we branch out into |ToDo X | + 1 cases. We know that all the edges of E(ToDo X ) are of one colour by Lemma 8. We check a single edge to find out which colour it is, without loss of generality assume it is Y. If |ToDo X | = 1 and such an edge does not exist, it does not matter which colour different than X we choose. In one branch we move the whole set ToDo X to ToSet Z . In the other |ToDo X | branches we choose one vertex v ∈ ToDo X , a different one in each branch, and move this vertex to ToSet Y and all the other vertices to ToSet Z . Note that these branches correspond to all feasible colourings of ToDo X using colours different than X. Then we solve each branch recursively, if any of them returns a feasible colouring, we return it, while if all of them return NO, we return NO.
We formally prove the correctness of the algorithm given in Section 3. A reader accustomed to such algorithms may probably only glance over this section and fill in the necessary details by him-or herself.
Formally, we do not yet know that the algorithm always terminates. In order to clarify the proof, we now assume that this indeed holds. In Section 5 we justify this assumption by showing even polynomial bounds on the algorithm's working time. Definition 9. We say a division of V into the eighteen sets satisfies proper invariants if 1. For each colour X and for any e ∈ E(Set X ∪ Free X ∪ NotY X ∪ NotZ X ) we have C(e) = X; 2. For each colour X and for any e ∈ E(ToDo X ∪ Free X ∪ NotY X ∪ NotZ X ) we have C(e) = X; Definition 10. A colouring φ : V →{R, G, B} is said to be proper with respect to a division of V into the eighteen sets if for every colour X it satisfies
We prove that the division at each step of our algorithm satisfies proper invariants. Moreover, we prove that if there exists a proper solution φ, then our algorithm does not return NO.
Note that as φ 0 was a feasible colouring for V \ {v 0 }, the proper invariants are satisfied at the start of the algorithm.
We have to check that the operations of shifting a vertex and resolving a set do not spoil proper invariants. Firstly, we consider shifting a vertex. Assume we shift a vertex v from ToSet X to Set X . Begin by considering the moves of vertices w with C(vw) = X. The moves NotY X →ToSet Z , ToDo Y →ToSet Z and NotZ Y →ToSet Y cannot spoil proper invariants since the sets ToSet X are not involved in the invariants. Returning NO obviously does not spoil proper invariants. The move Free X →ToDo X decreases the number of constraints in the invariants, and Free Y →NotX Y does not change the invariants.
As far as the move of v from ToSet X to Set X is concerned, if there were any vertices w ∈ Set X ∪ NotY X ∪ NotZ X ∪ Free X such that C(vw) = X, the shifting algorithm removes them from the set (or returns NO for w ∈ Set X ).
Thus after shifting a single vertex proper invariants still hold. Resolving a set involves only moving vertices to the ToSet sets, which are not constrained in the invariants, so it does not spoil the invariants as well.
Assume that at a given stage of the algorithm there is a proper colouring φ, which is a feasible solution to (V, C). We prove that after performing a single step φ is still proper in at least one branch.
First consider shifting a vertex v from ToSet X to Set X . As v was in ToSet X and φ is proper, φ(v) = X. Thus after moving v from ToSet X to Set X the solution φ is still proper. Consider any vertex w with C(vw) = X. Then φ(w) = X. If w ∈ Set X we have a contradiction as φ being a proper solution implies φ(w) = X. If w is moved to ToDo X or NotX Y (from Free X or Free Y , respectively), φ is still a proper solution, for the only new constraint is that φ(w) = X, which we know to be satisfied. If w was in NotY X , ToDo Y or NotY Z , then φ(w) = Y as φ was proper. As we additionally know that φ(w) = X, this implies φ(w) = Z, thus after moving w to ToSet Z the solution φ remains proper. Thus φ is still proper after shifting a vertex. Now consider resolving a set ToDo X . As φ is proper, φ(v) = X for any v ∈ ToDo X . On the other hand, the proper invariants guarantee that C(e) = X for e ∈ E(ToDo X ). Thus the application of Lemma 8 is justified. If there exists a boring v ∈ ToDo X , which -according to the algorithm from Lemma 8cannot have φ(v) = Y for any feasible colouring, we have φ(v) = Z. Thus after moving v to ToSet Z the solution φ remains proper.
If all vertices are interesting, then by Lemma 8 all the edges in E(ToDo X ) are of a single colour, say Y, thus at most one vertex v ∈ ToDo X satisfies φ(v) = Y. If there exists such a vertex, φ is a proper colouring for the branch in which we move v to ToSet Y and all the other vertices from ToDo X to ToSet Z . If no such vertex exists, φ is a proper colouring for the branch in which we move all vertices to ToSet Z . Now assume that there exists any solution φ for the original problem (V, C). Let X = φ(v 0 ). Then φ is proper in the starting branch in which we set v 0 ∈ ToSet X -we have φ(v 0 ) = X, and all the other vertices are in the sets Free, so we assume nothing about them.
So, finally -if there exists a solution for the original problem, our algorithm returns a solution. On the other hand, if our algorithm returns a solution, sets ToDo X and ToSet X are empty and the first proper invariant guarantees that it is a feasible solution to the original problem.
This allows us to formulate the following theorem:
Theorem 11. Consider an instance (V, C) of compatible colouring, and assume we are given a feasible colouring φ for (V \ {v}, C). Then if there exists any feasible colouring for (V, C), the algorithm described in Section 3 returns a colouring, and conversely any colouring returned by the algorithm is a feasible one for (V, C).
Let us denote |V | by n. Consider a tree of recursion for our algorithm. We actually consider three recursion trees, one for each possible choice of the set ToDo X to put v 0 into.
Definition 12. By a state S of the algorithm we mean a division of the set V into the eighteen sets postulated by the algorithm. We denote these 18 sets by Free X (S), ToDo X (S), and so on, omitting the argument when it is clear what state we are considering.
By an inner node of the recursion tree we mean the state of the algorithm at a moment just before branching out when resolving a set ToDo X with no boring vertices.
By a leaf node of the recursion tree we mean the state of the algorithm when it terminates a branch -either answering NO due to a failed shift operation or returning a solution due to the sets ToDo X and ToSet X all being empty. For the sake of analysis it is better to assume that when answering NO we first shift all vertices out the ToSet X sets, disregarding conflicts, and move the vertices required by the shift. Thus we answer NO in the state when all sets ToSet X are empty.
By the descendants of an inner node N we mean nodes that occur in any of the branches of resolving ToDo X in N . This obviously gives rise to a tree structure in each of the three recursion trees, so we use the standard terms "child", "father", "root" and so on.
Each branching out takes O(n 2 ) time for the application of Lemma 8 (not counting the time needed to solve the branches), and in total O(n 2 ) time to prepare the branches. Between an inner node and its child a number of operations are performed, each being either shifting a single vertex (which takes O(n) time) or resolving a set containing boring vertices (which takes O(n 2 ) time).
Definition 13. The potential of a given state S of the algorithm is equal to
Lemma 14. Shifting a single vertex and resolving a set containing a boring vertex decreases the potential.
Proof. The move ToSet X →Set X , which happens every time we shift a vertex, decreases the potential by 1. The same holds for the move ToDo X →ToSet Y , which happens every time we resolve a set with a boring vertex. All the other moves associated shifting a vertex (Free X →ToDo X , NotY X →ToSet Z , ToDo Y →ToSet Z , Free Y →NotX Y and NotZ Y →ToSet Y ) do not increase the potential.
Lemma 15. When we branch out while resolving a set without boring vertices, the potential in each of the branches is smaller than the potential in the original state.
Proof. We resolve only non-empty sets. We move all vertices from ToDo X to ToSet Y or ToSet Z , each such move decreases the potential by one.
The starting potential is O(n), and decreases with each operation. Thus we have the following corollary: Corollary 16. We perform O(n) operations (i.e., shifts, resolves of boring vertices or branches) on each path from a starting node to any leaf of the recursion tree.
We begin by formulating the lemma which is crucial to estimating the number of leaves: Lemma 17. Consider any inner node S of the recursion tree formed immediately before resolving a set ToDo X containing no boring vertices. Let S 0 , . . . , S k be the children of S. Let U X i = Free X (S i ) ∪ ToDo X (S i ). Then the sets U X i are disjoint subsets of the set Free X (S).
Proof. The sets U X i are subsets of Free X (S) by the definition of resolving a set. By application of Lemma 8 we conclude that E(ToDo X (S)) contains edges of a single colour (different than X due to the proper invariants), say Y (if ToDo X (S) consists of a single vertex, take as Y any colour different than X). Denote the vertices of ToDo X by v 1 , v 2 , . . . , v k . Without losing generality assume that S 0 corresponds to the branch where the whole ToDo X is moved to ToSet Z , while S i for i ≥ 1 corresponds to the branch where the vertex v i is the only one moved to ToSet Y . Let A i be the set of those vertices w in Free X (S) for which C(v i w) = Z. By the second proper invariant we know that for w ∈ Free X (S) \ A i we have C(v i w) = Y -there are no X-edges in Free X ∪ ToDo X .
Consider the branch in which we move the whole set ToDo X to ToSet Z . When we shift any vertex v i to Set Z , every vertex w ∈ A i that was still left in Free X is moved to NotZ X . Similarly, every vertex w ∈ A i now contained in ToDo X is moved to ToSet Y . Also, neither a shift nor resolving a boring vertex moves any vertex into Free X ∪ ToDo X . Thus after all the k shifts of vertices that were in ToDo X before branching, U X 0 is disjoint from A 1 ∪A 2 ∪. . .∪A k . Similarly, in the branch where v i is moved to ToSet Y and the other v j s are moved to ToSet Z , after all the shifts U X i is disjoint from A 1 ∪A 2 ∪. . .∪A i-1 ∪(Free X \A i )∪A i+1 ∪. . .∪A k . Consider any two branches and the associated sets U X i . Assume the first of these branches moved the jth vertex to ToSet Y (at least one of them had to move some vertex to ToSet Y ). Then U X j for the first branch is contained in A j , while U X i for the second is disjoint from A j . This proves the thesis.
We aim to prove that each recursion tree has O(n 3 ) leaf nodes. Consider the following definition: The mass of the root of the recursion tree is obviously O(n 3 ), while the mass of each leaf is at least 1. As previously, shifting a vertex and resolving a boring vertex do not increase the mass of a state, as they cannot increase the sizes of sets U R , U G , U B . We will prove that for any node of the tree the mass of the node is not smaller than the sum of masses of its sons. Clearly this leads to the conclusion that the mass of the root node is greater or equal to the sum of masses of all the leaves, which, along with the bounds for the masses of the root and the leaves, shows that there are at most O(n 3 ) leaves. Therefore, all we need is the following lemma: Lemma 19. Consider any node S of the recursion tree formed immediately before resolving a set ToDo X containing no boring vertices. Let S 0 , S 1 , . . . , S k be the children of S. Then m(S) ≥ k i=0 m(S i ).
Proof. Without loss of generality, assume that we are resolving the set ToDo R in S. Neither resolving a set ToDo R , shifting a vertex nor resolving a boring vertex can increase the size of sets U G , U B , so for all i = 0, 1, . . . , k we have that |U G (S i )| ≤ |U G (S)| and |U B (S i )| ≤ |U B (S)|. Moreover, the number of branches (that is, the number of sons of S) is equal exactly to k + 1 = |ToDo R (S)| + 1 -one branch for every vertex in ToDo R to be assigned the "other" colour, and one branch for all the vertices having the same colour. Thus, application of Lemma 17 immediately yields:
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment