Journal of Graph Algorithms and Applications the Black-and-white Coloring Problem on Chordal Graphs

Given a graph G and positive integers b and w, the black-and-white coloring problem asks about the existence of a partial vertex-coloring of G, with b vertices colored black and w white, such that there is no edge between a black and a white vertex. This problem is known to be NP-complete in general. We provide here a polynomial time algorithm for chordal graphs.


Introduction
The Black-and-White Coloring (BWC) problem is defined as follows.Given an undirected graph G and positive integers b, w, determine whether there exists a partial coloring of G such that b vertices are colored black and w vertices white (with all other vertices left uncolored), such that no black vertex and white vertex are adjacent.Such a partial coloring, if exists, is a Black-and-White Coloring (BWC) of the graph.
One application of the BWC problem comes from the chemical industry.A set of b samples of a product B and w samples of a product W has to be stored in n ≥ x + y different available places.For security reasons, due to the chemical nature of the samples and the configuration of the storing places, there are certain pairs of places that cannot contain two different types of products.The question is whether it is possible to store all samples by respecting these restrictions.By constructing a graph G that has a vertex for each storing place and an edge between each two places that are not allowed to contain two different types of products, this problem reduces to the BWC problem.
Another application is solved explicitly in [2]: Items of two data types, D 1 and D 2 , are stored in a 2-dimensional table.A person would like to retrieve data of type D 1 or of type D 2 , but not of both.When retrieving data, we would like to allow a one-unit error in each of the table's indexes.In case of an error, we do not want a person trying to retrieve an element of type D 1 to extract an element of type D 2 .An additional goal is to populate the elements of type D 1 in a way that will maximize the number of places left in the table for the elements of type D 2 .
We sometimes refer to the optimization version of this problem, in which we are given a graph G and a positive integer b, and have to color b of the vertices black, so that there will remain as many vertices as possible which are non-adjacent to any of the b vertices.These latter vertices are to be colored white, and the resulting coloring is optimal.Clearly, when referring to a BWC, it suffices to refer to its black vertices only.
For example, in Figure 1, an optimal BWC with B = 3 and W = 4 is depicted.Notice that by coloring black three out of the four vertices on the right of the figure, one would obtain a BWC with B = 3 and W = 3, which is not optimal.
The problem was originated by Berge, who raised the following instance [15].Problem 1.1 Given positive integers n and b ≤ n 2 , place b black and w white queens on an n × n chessboard, so that no black queen and white queen attack each other, and with w as large as possible.
The BWC problem has been introduced in general, and proved to be N Pcomplete, by Hansen et al. [15].In the same paper, an O(n 3 ) algorithm for trees was given.In [3], an O(n 2 lg 3 n) algorithm for trees was given.Kobler et al. [16] gave a polynomial algorithm for partial k-trees with a fixed k.Yahalom [20] investigated an analogous problem to that suggested by Berge, using rooks instead of queens, and gave a sub-linear algorithm to this problem.For special cases, in which the ratio between the sides of the board is an integer or close to an integer, she derived an explicit formula for the optimal solution.In [2], we investigated an analogous problem, using kings instead of queens, and provided explicit optimal solutions for the toroidal and the non-toroidal versions.
In [5] we examined several heuristic algorithms, in particular tabu search, for solving the problem in general.
The BWC problem admits a generalization for any number of colors.An anticoloring of a graph is a partial vertex coloring with two or more colors, in which no two adjacent vertices have distinct colors.In the general anticoloring problem, we are given an undirected graph G and positive integers b 1 , . . ., b k , and have to determine whether there exists an anticoloring of G such that b j vertices are colored in color j, j = 1, . . ., k.We call such an anticoloring a (b 1 , . . ., b k )-anticoloring.Yahalom [20] noticed that it is easy to rewrite the anticoloring problem as an integer linear programming problem.
The BWC problem is closely related to the separation problem.In the latter, we are given an n-vertex graph G and a constant α < 1, and have to partition the vertices of G into three sets A, B, C such that (i) no edge joins a vertex in A with a vertex in B, (ii) A and B contain at most αn vertices each, and (iii) C is "small".The set C is a separator of G, i.e., its removal splits the graph into two parts, each with at most some fixed fraction of the vertices.This fraction is defined by α.Thus, coloring the vertices of A black and those of B white, and leaving those of C uncolored, we obtain a BWC of G.
The separation problem usually deals with a class S of graphs, closed under the subgraph relation.An f (n)-separator theorem (cf.[17]) for S is a theorem which ensures that every graph G in S may be split as above with |C| ≤ f (n).
A graph is chordal if every cycle of length at least 4 has a chord, i.e., an edge connecting two nonconsecutive vertices on the cycle.Clearly, any induced subgraph of a chordal graph is chordal as well.
It was shown in [14] that any chordal graph which has no (k + 2)-clique can be separated with f (n) = k and α = 1/2 in time O(mα(m, n)), where m is the number of edges in the graph and α(m, n) is a very slowly growing function described in [19].Thus, by [4], we can easily obtain an algorithm which finds, for such a graph with n vertices, a BWC with b black vertices and w ≥ n−b−O(min{klog n, b}) white vertices, in the same runtime.However, this algorithm does not necessarily find an optimal BWC.
In this paper we give an algorithm which solves the BWC problem for chordal graphs in time O(χn 3 ), where χ is the chromatic number of the graph.We will show that, if n is large, then our algorithm works in O(χn 2 ) time for almost all chordal graphs.Note that the family of chordal graphs is much larger than that of trees, and contains roughly 2 n 2 /4 graphs on n vertices [1].
Sections 2 and 3 present the main results.In Section 4 we survey briefly some results concerning chordal graphs, which are used in the sequel.The proofs and the algorithms are detailed in Sections 5, 6 and 7. Section 8 explains how a BWC for given b and w can actually be found.In Section 9 we extend our algorithm to solve the anticoloring problem with many colors.
The author is grateful to D. Berend for helpful comments and suggestions.

Main Results
A (b, w)-coloring of G is a BWC of G with b black and w white vertices.The pair (b, w) is non-dominated if there exists no BWC with b ≥ b black and w ≥ w white vertices, and b + w > b + w; otherwise, it is dominated.A (b, w)coloring for a non-dominated pair (b, w) is an optimal BWC.Our algorithm solves simultaneously the BWC problem for all pairs (b, w).
Theorem 1 Algorithm 1 finds the list consisting of all non-dominated pairs of a chordal graph G with n vertices in time O(n 4 ).

Improvement of the Algorithm
The following theorem improves the runtime of Algorithm 1 for chordal graphs whose chromatic number is o(n).
Theorem 2 Let χ be the size of the maximum clique of the graph.Algorithm 1 can be improved to run in time O(χn 3 ).
Chordal graphs are known to be perfect.Therefore, the size of the maximum clique of a chordal graph is equal to its chromatic number.
Remark 3 (a) As we shall see in the proof of Theorem 2, if the number of internal vertices of the clique tree (see Definition 2 below) of G is k, then we obtain a runtime of O(χn 2 klg n k ) in the theorem.For k = o(n), this yields an improvement.
(b) From the proof of Theorem 2 we also get that, if the number of maximal cliques of size Ω(n) is O(1), then Theorem 2 holds, where χ is now the maximal size of the cliques of size o(n).
Chordal graphs may well contain cliques of size Ω(n).For such graphs, Algorithm 1 runs in O(n 4 ) time.How does Algorithm 1 perform on a typical chordal graph?Unfortunately, by [1], the largest clique in most chordal graphs is of size about n/2.Fortunately, though, most chordal graphs (i.e., a proportion of at least 1 − ( 1 2 √ 3 + ) n for sufficiently large n) are split [1], in which case we attain an improved result.
A split graph is a graph whose vertices can be partitioned into two sets, one of which induces a clique and the other an independent set.Obviously, every split graph is chordal.
Theorem 4 Algorithm 1 may be modified to run in time O(χn 2 ) for split graphs.
Once the list of all non-dominated pairs has been found, it is straightforward to find the maximal number of white vertices in a BWC of G for any prescribed number b of black vertices.In fact, search the list for the element (b , w) with minimal b such that b ≥ b.The w in that pair is the required number.
Throughout the rest of this paper, we deal only with connected chordal graphs.It follows from [4] that, after solving the problem for such graphs, the solution for all chordal graphs is easy to obtain.

Chordal Graphs -Preliminaries
Let G be a chordal graph and a, b ∈ V (G).A set S ⊂ V (G) is a minimal abseparator if the graph induced by V (G) − S contains no path between a and b, and no proper subset of S is such.S is a minimal vertex separator if it is a minimal ab-separator for some vertices a, b.
Theorem 5 [9] A graph G is chordal if and only if every minimal vertex separator of G is a clique.
An example for the next two definitions can be found in Figure 2 below.
and given by: Recall that, by [13], a chordal graph contains at most |V | maximal cliques, and therefore The following notion will play a critical role in the paper.
Definition 2 Let G = (V, E) be a chordal graph and C(G) its clique graph.A clique tree in G is a maximum weighted spanning tree of C(G).
Blair et al. [7] present a linear time algorithm for finding a clique tree of a chordal graph.
The following result is due to Lundquist [18].
For example, in Figure 2 we have that For every clique tree T , consider the set consisting of all sets K ∩ K with (K, K ) ∈ E(T ).By Theorem 6, each element in this set is a minimal vertex separator of G.
The following theorem was proved in [6].
Theorem 7 Given a clique tree T of a chordal graph, for any pair of distinct cliques K, K ∈ V (T ), the set K ∩ K is contained in every clique on the path connecting K and K in T .
For example, in Figure 2(b) we can see that which is a clique on the path connecting K 1 and K 4 .
5 Proof of Theorem 1

Sketch of the Algorithm
Throughout the next two sections G will denote a chordal graph and T a clique tree of G, constructed as in [7].Note that there is a correspondence between subtrees of T and certain subgraphs of G, whereby for each subtree T there exists a corresponding subgraph G , induced by The main steps of the algorithm, which will be detailed in Section 5.2, are as follows.
In general, the algorithm takes a chordal graph G, computes its clique tree T and finds in T the list of all non-dominated pairs (b, w) such that G admits a BWC with b black and w white vertices.
In order to find all the non-dominated pairs, we begin by defining a new notion for trees, called full-coloring.Each full-coloring of a clique tree T implies a corresponding BWC for the corresponding chordal graph G.
According to the algorithm, each vertex in the tree is attached with two lists, depending on its color, black or white.Each list of each vertex contains pairs (b, w) saying that the subtree rooted at that vertex has a (b, w)-full-coloring.The corresponding (original) graph has a BWC with b black and w white vertices.These lists are computed in a post-order form, from the leaves of the tree to its root, using two aid procedures: merge and extension.
Eventually, to actually find a BWC with given numbers b,w of black and white vertices respectively, find a pair (b , w ) such that b ≥ b and w ≥ w and color the graph as explained in Section 8.

The Algorithm
Lemma 3 Given an optimal BWC of G, the set U of uncolored vertices satisfies be a minimal subset of U that separates the components G i and G j .Obviously, U = 1≤i<j≤m U ij , and each U ij is a minimal ab-separator of G for any a ∈ V (G i ) and b ∈ V (G j ).By Theorem 6, for each i and j, U ij = K i ∩ K j for two cliques K i and K j such that (K i , K j ) ∈ E(T ).
It will be convenient to introduce another notion of coloring of (clique) trees.A full-coloring of T is a coloring of the vertices of T , such that each vertex is colored either black or white.We emphasize that there are no constraints on the coloring of adjacent vertices, so that a full-coloring is in general neither a coloring nor a BWC.Note that T is both vertex-and edge-weighted, where the weight functions ν : V (T ) → N and µ : E(T ) → N are given by Given a full-coloring of T , we construct a BWC of G as follows.For each vertex v ∈ V (G), consider all maximal cliques in G containing it.If all these cliques have the same color in T , color v in that same color; otherwise, leave v uncolored.Since, for any two adjacent vertices in G, there exists a maximal clique containing them both, the resulting coloring is indeed a BWC.Let b and w be the number of black and white vertices, respectively, in this BWC.The given full-coloring of T thus gives rise to a (b, w)-coloring of G, and will therefore be referred to as a (b, w)-full-coloring of T .Note that, if (b, w) happens to be a non-dominated pair for G, then every (b, w)-coloring of G can be obtained from some full-coloring of T .Thus, we refer to (b, w) also as a non-dominated pair for T .A (5,6)-coloring of a chordal graph, obtained from a (5,6)-full-coloring of a corresponding clique tree is presented in Figure 2.
Assume T is rooted (arbitrarily).To each vertex K ∈ V (T ) we attach two lists, B K and W K .The former list consists of all the non-dominated pairs for the subtree of T rooted at K, where K is constrained to be colored black.W K is the analogous list for the case where K is constrained to be colored white.The variable K.dList consists of these two lists.
To simplify the algorithm, we split it into several algorithms, called by each other.
Algorithm 1, which finds all the non-dominated pairs, initializes the lists B K and W K for all leaves of T , and then invokes Algorithm 2, which in turn finds these lists for the internal vertices of T .In particular, by unifying the two lists attached to the root of T , we obtain the required output, as stated in Theorem 1.Eventually, the algorithm uses the procedure contract, which gets a list and deletes from it all dominated pairs (as well as repeated occurrences of pairs).This procedure uses the bucket-sort algorithm (cf.[8]).
(1) Algorithm 2 below is based on the algorithm that solves the BWC problem on trees [15].It traverses the tree in post-order and computes the lists for each vertex.Let d be the degree of the root R. At the beginning the algorithm invokes Algorithm 3 on the i-th child K i of R, 1 ≤ i ≤ d, (with added edge between R and K i ) in order to find the list for the subtree induced by {R} ∪ V (T Ki ).This list is saved as list i .Namely, list i [black] (respectively, list i [white]) is the current list obtained for the case where the root is colored black (respectively, white).After finding the lists corresponding to all the children of R, the algorithm merges all these lists step by step.At each step i, the algorithm performs Algorithm 4 on list 1 and list i .The merged list is saved as list 1 .Eventually, list 1 is the required list for T R .
Algorithm 2 invokes Algorithms 3 and 4, which perform the computations.Algorithm 4 is performed on pairs of dLists, until it merges them all to a single one.solveCliqueTree(G, R) Input: A chordal graph G and a root R of its clique tree ) // list for the subtree T Ki , adding R // as root for i ← 2 to d // find the lists for the tree rooted at R list Algorithm 2: Generate dList for the root of a clique tree.Algorithm 3 is given root(T ).dList for some subtree T and finds root(T ).dList,where T is composed of T and a new root, R , whose only child is root(T ).R is in fact the father of R in T .
The computation of the algorithm is very simple.Let R =root(T ) and R =father(R).For each (b, w) Note that in the first case, where R and R are both black, all the vertices of R ⊆ G are colored black.In the second case, where R is black and R is white, all the vertices of R ∩R ⊆ G must be left uncolored.Similarly, for each (b, w) ∈ W R the algorithm records the pair (b, Eventually, it uses the procedure contract to delete dominated pairs.Note that after performing Algorithm 3, Algorithm 2 calls Algorithm 4 to merge two dLists.The performance of Algorithm 4 requires specific input (for example, the exact sets of colored vertices), which is computed in Algorithm 3.More specifically, in addition to computing the required lists, Algorithm 3 records, for each pair (b, w) in the two lists of a vertex K ∈ V (T ), all the vertices v ∈ K that are colored in the corresponding (b, w)-coloring.These data are saved by Algorithm 3 in (b, w).colored.The procedure append adds a given pair at the end of a given list.The last pair in a list l is l.tail.extension(G, B R , W R ,R ) Input: A chordal graph G, the lists B R , W R , where R = root(T ), and the vertex R =father(R) Algorithm 4 is given the lists for two subtrees having a common root, and finds the lists for the root of the subtree obtained by merging these two subtrees.For each (b , where the variable size is the number of colored vertices in the unified root, and appends it to the list B R (respectively, W R ).Note that the colored vertices of R ⊆ G are exactly the intersection of the colored vertices of R 1 ⊆ G and R 2 ⊆ G. Similarly to Algorithm 3, we record these data.After finding the required lists, all dominated pairs are deleted, using the procedure contract.

Example 8
In Tables 1-6 below the performance of the algorithm on the clique tree of Figure 2 is shown.In Table 1 we give the lists for the leaves of T .Table 2 gives the resulting lists after performing Algorithm 3 on K 5 .dList to obtain K 3 .dList.In Table 3 we see the temporary lists list 1 and list 2 , which are the input for Algorithm 4. In Tables 4 and 5 we give the results of the performance of Algorithm 4 before and after the deletion of dominated pairs.In Table 6 we give the final list, obtained after performing Algorithm 3 on K 2 .dList,which was obtained in the preceding two tables.

Conclusion of the Proof of Theorem 1
Let T v be the subtree of T rooted at v, and G(T v ) be the subgraph of G corresponding to T v .
The following lemmas prove the correctness of the algorithm.Suppose first that R 1 and R 2 are two children of R. Let T i R be the subtrees of T defined by both rooted at R.

Lemma 4
The lists obtained by performing Algorithm 3 on R i .dLists,i = 1, 2, consist of all the non-dominated pairs for G(T i R ).
Proof: Assume, say, that R i is colored black.For each non-dominated pair (b, w) for G(T Ri ), by coloring R black, we add exactly black vertices and do not change the number of white vertices.Note that, if (5,0) (0,5) (4,0) (0,4) Table 1.First step: Initializing.
Table 3. Third step: Temporary lists for K 2 .
Lemma 5 If we have the lists for each subtree T i R , i = 1, 2, then by performing Algorithm 4 on these lists, we get the required lists for G(T R ).
Proof: We split the proof into two cases.
Case 1: R 1 and R 2 are colored in the same color.
The black (and white) vertices in G(T R ) are the same as in G(T i R ), i = 1, 2, except for the vertices which were turned to uncolored in Algorithm 3. Thus, if the number of black (respectively, white) vertices in G(T Ri ) is b i (respectively, w i ), i = 1, 2, then the total number of black (respectively, white) vertices is b 1 + b 2 − size (respectively, w 1 + w 2 − size), where size is equal to |(b 1 , w 1 ).colored ∪ (b 2 , w 2 ).colored|.
Case 2: R 1 and R 2 are colored in different colors.
Besides the considerations described in Case 1, we need to check that, if R 1 ∩ R 2 is non-empty, then it is left uncolored.Assume, say, that R 1 is colored black and R 2 white.Since T is a tree, (R 1 , R 2 ) / ∈ E(T ).Consider the path R 1 RR 2 in T .Assume, say, that R is colored black.Then, by the algorithm, R ∩ R 2 is left uncolored.By Theorem 7 we have Lemma 6 For each vertex K of T , K.dLists consists of all the non-dominated pairs for G(T K ).
Proof: We prove this lemma by induction on the height of T K .If the height is zero, then T K consists of K only, and the algorithm gives K.dList[black]=(ν(K), 0) and K.dList[white]=(0, ν(K)), which are the required lists for G(T K ).
Assume the lemma is correct for all subtrees with height up to h − 1.Let T K be a subtree of height h, and let K 1 , K 2 , . . ., K d be the children of K. Obviously, the heights of T K1 , T K2 , . . ., T K d are at most h − 1, and the lemma is correct for them.By Lemma 4, for each T i K we have the required lists.Applying the merge procedure over and over, on two children at a time, by Lemma 5, we get the required lists for T K .

Runtime of the Algorithm
The construction of a clique graph takes linear time (cf.[7]).For each pair in K.dList (out of at most 2n pairs), for some vertex K, Algorithm 3 performs computations in O(1) time and then records all the vertices of some clique in O(n) time.Therefore the total runtime of Algorithm 3 is O(n 2 ).
Each of the double loops in Algorithm 4 is performed over O(n 2 ) indexes.Each computation of size in the loops takes O(n) time.Therefore, the total runtime of Algorithm 4 is O(n 3 ).Thus, the total running time of Algorithm 1 is O(n 4 ).

Proof of Theorem 2
In this section we prove Theorem 2. The bottleneck of our algorithm is Algorithm 4. In this section we reduce the runtime of the latter to O(χn 2 ).(Recall that χ is the chromatic number of the graph.)Thus, by choosing a suitable order for the performances of Algorithm 4 on each vertex, the total runtime of Algorithm 1 decreases to O(χn 2 klg (n/k)), where k is the number of internal vertices in T .We begin with Lemma 7 Given a clique K ∈ V (T ) and the list of non-dominated pairs obtained by Algorithm 1 for K, consider for each pair (b, w) the corresponding (b, w)-coloring of the subgraph G corresponding to T K .The number of uncolored vertices v ∈ K in this coloring is at most K1 child of K |K ∩ K 1 |.
Proof: Let v ∈ K be an uncolored vertex for a specific non-dominated pair.Obviously, (v, u 1 ) ∈ E and (v, u 2 ) ∈ E, where u 1 is colored black and u 2 is colored white, and Assume this is not the case.Then, there exists Therefore, T contains one of the paths p 1 = KK 1 K and p 2 = K 1 KK .If T contains p 1 , then according to Theorem 7, since v ∈ K ∩ K , we get that v ∈ K ∩ K 1 , which ends the proof.If T contains p 2 , then according to Theorem 7, since u 1 ∈ K 1 ∩ K , we get that u 1 ∈ K ∩ K , and therefore u 1 ∈ K.
Equivalently, we get that u 2 ∈ K. Now, u 1 is black and u 2 is white, and it is impossible for them both to belong to the same clique K, in contradiction to our assumption.This proves the lemma.
Our purpose is to compute size in Algorithm 4 faster.Recall that, for each two pairs (b 1 , w 1 ) and (b 2 , w 2 ) in the lists of the roots R 1 and R 2 of the subtrees to be merged, size = |(b 1 , w 1 ).colored ∪ (b 2 , w 2 ).colored| .Note that, denoting by R the root of the unified tree, we have Therefore, instead of recording for each pair (b i , w i ) the colored vertices, we rather record the uncolored vertices.These vertices are maintained in a sorted list, sorted by the vertices' names.
Thus, in order to find the value of size, simply go over the two sorted lists of R 1 and R 2 in parallel, to find the number of vertices which are left uncolored in both lists.This is detailed in Algorithm 5. Note that Algorithm 5 comes instead of line 4 in Algorithm 4. findSize((b 1 , w 1 ).uncolored,(b 2 , w 2 ).uncolored,ν(R))Input: The lists of the uncolored vertices of the two pairs from Algorithm 4 and the weight of the unified root R Output: The variable size required for Algorithm 4 Algorithm 5: Find the variable size quickly.
In order to record the list of uncolored vertices, both in Algorithm 3 and in Algorithm 4, we want to record (b 1 , w 1 ).uncolored ∪(b 2 , w 2 ).uncolored in a sorted way.Similarly to Algorithm 5, we run over the two input lists in parallel, but this time we record each vertex which appears in at least one of these lists.Since the lists are already sorted, the new list is also sorted.
The runtime of this procedure is proportional to that of Algorithm 5, and therefore to the number of uncolored vertices in the two lists.By Lemma 7, the number of uncolored vertices in the list of R i , i = 1, 2, is at most Therefore, the runtime of Algorithm 4 is and since R 1 and R 2 are both instances of R, this is equal to The total runtime of all these performances depends on the sequence of d i − 1 times it is performed, and is thus equal , where X is the number of times that extension(G, B K , W K , K i ) is inserted as an input to the algorithm.Such a sequence of merges can be represented by a binary tree M , with the children of K i as leaves.Every internal node of M corresponds to one merge, and X is equal to the depth of K in M .Therefore, if we perform Algorithm 4 in the order specified by Algorithm 2, we get that X = O(d i ), and the total runtime of Algorithm 4 on a vertex K i is O(n 2 χ i d i ).By performing Algorithm 4 each time on the i-th and the (i + 2 k )-th children, 0 ≤ k ≤ lg d , 1 ≤ i ≤ d − 2 k+1 + 1 and i = c • 2 k+1 for some constant c, as if M is as balanced as possible, we get that X = O(lg d i ), and the total runtime on a vertex becomes O(n 2 χ i lg d i ).
Similarly, the total runtime of Algorithm 3 on K i is O(nχ i lg d i ).Thus, the total runtime of Algorithm 1 is which is maximized when all d i 's are equal.Since n i=1 lg d i ≤ n − 1, the total runtime is O(χn 2 klg (n/k)), where k is the number of internal vertices in T .
Thus, if T has Θ(n) internal vertices, the runtime is O(χn 3 ), but if it has o(n) internal vertices, we obtain a better result.This concludes the proof of Theorem 2.
Let us now explain the second part of Remark 3. If the number of maximal cliques K with ν(K) = Ω(n) is some constant C, and the size of all other maximal cliques is bounded by Y = o(n), then it is easy to show that the total runtime of the algorithm will be C Let G be a split graph [1].It is easy to show that there exists a clique tree T of G in which all the leaves are children of the root, and the root is the maximal clique of G (see Figure 3).In fact, such a clique tree can be found by taking the maximal clique of the graph as the root, and then taking all other maximal cliques (each of which consists of a single vertex from the independent set and all its neighbors) as its children.The values of ν and µ are as described in Section 5. Proof: For each leaf L, the algorithm initializes each of the lists B L and W L with a list of size 1.The computation of the required list for the root starts with performing Algorithm 3 on each of the leaves, which creates lists of size 2. Finally, Algorithm 4 gets each time two lists as input: one of size at most n and the other, of size exactly 2. Therefore, the runtime of the improved Algorithm 4 becomes O(χn), and thus the runtime of Algorithm 1 is reduced to O(χn 2 ).Theorem 4 follows straightforwardly from Lemma 8.A linear-time algorithm for recognizing split graphs is presented in [11].This algorithm also finds the maximum clique in the graph, which will immediately give us the desired clique tree.
8 Finding a BWC Suppose we are required to actually find a BWC of a chordal graph G with given numbers b, w of black and white vertices, respectively.We may assume, without loss of generality, that (b, w) belongs to the list optPairs found by Algorithm 1.

Figure 2 :Algorithm 1 :
Figure 2: (a) a BWC of a chordal graph, (b) a corresponding full-coloring of its clique tree (where the dotted edges belong only to the clique graph).

Algorithm 3 :
Add a new root to a given subtree.

Algorithm 4 :
Merge two subtrees with a common root.
Finding a clique tree is done by Prim's algorithm for finding a minimal spanning tree of a graph in O(|E C | lg |V C |) time, where G C = (V C , E C ) is the clique graph.The procedure contract has a linear runtime.Therefore, the runtime of Algorithm 1 is identical to the runtime of Algorithm 2 with the addition of O(|E C | lg |V C |) time.Algorithm 2 calls Algorithm 3 exactly once for each vertex, and Algorithm 4 exactly d times for each vertex with d children in the clique tree.Thus, it calls both algorithms O(n) times.