3.1. Clique Tree from a PEO
The algorithm CliqueTree (Algorithm 3) from Spinrad ([
26], p. 258) is a slight variant of an algorithm originally given by Gavril [
3] to compute a clique tree of a connected chordal graph from an arbitrary PEO of this graph.
Algorithm 3: CliqueTree. |
|
Theorem 1. [3,26] The algorithm CliqueTree computes a clique tree and the set of minimal separators of a connected chordal graph H from a PEO of H in linear time. Note that the algorithms from [
3,
26] only compute a clique tree of the input graph. By Characterization 1, the algorithm CliqueTree correctly computes the set of minimal separators, and it does so in linear time using a search/insert structure for
, which allows checking for the presence of a set
S and inserting it in
time. The proofs given in [
3,
26] implicitly use Invariant 1 below, which is explicitly stated and proven here, since it will be used later in this paper. To prove it, we will use the following lemma.
Lemma 2. Let H be a connected chordal graph; let x be a simplicial vertex of H; let ; let be a clique tree of ; let K be a node of containing ; let ; and let T be the tree obtained from by replacing node K by (with the same neighbors in T as in ) if and by adding node and edge otherwise. Then, T is a clique tree of H.
Proof. Let us show that the nodes of T are the maximal cliques of H. As x is simplicial in H, is the unique maximal clique of H containing x. Each maximal clique of H different from is a maximal clique of , and each maximal clique of different from is a maximal clique of H. It follows that the nodes of T are the maximal cliques of H. It remains to show that for each vertex y of H, the subgraph of T induced by the set of nodes of T containing y is connected. If , then is reduced to node ; otherwise, is either equal to or obtained from by replacing node K by node or by nodes K and and edge . Hence, is connected. ☐
Invariant 1. The following proposition is an invariant of the for loop of the algorithm CliqueTree:- (a)
is a clique tree of ,
- (b)
is the set of minimal separators of ,
- (c)
, and .
Proof. The proposition clearly holds at the initialization step of the for loop. Let us show that it is preserved by each iteration of this loop. It is clearly preserved by iteration n, i.e., the iteration where . Let us show that it is preserved by iteration i, with . Let (a1) (resp. (b1), (c1)) denote item (a) (resp. (b), (c)) at the beginning of iteration i (which is supposed to be true), and let x, , S, s, k and p be the values of these variable at the end of iteration i. As α is a PEO of H, x is a simplicial vertex of , so S is a clique of H. It follows by definition of k that ; hence, by (c1) with . Thus, by (a1), is a maximal clique of containing S. It follows from Lemma 2 and Characterization 1 that (a) and (b) are preserved. It remains to show that (c) is preserved. It is the case since for each , and are unchanged, whereas s and can only become bigger at iteration i, and for , is either equal to p or to s with ; and . ☐
3.2. Clique Tree from a PMO
According to Invariant 1, in an execution of the algorithm CliqueTree, the cliques are the maximal cliques of and, therefore, cliques of H that are not necessarily maximal in H. Some PEOs build the maximal cliques of H one after another: at each time in an execution of the algorithm, each clique different from is a maximal clique of H, and a vertex is added to at each iteration of the for loop until is a maximal clique of H; and s is incremented to start a new maximal clique of H. If is such a PEO, at the beginning of iteration , the current clique is equal to , and if is not a maximal clique of H, then and is added to at iteration i.
Definition 4. A MCComp (Maximal Clique Completing) PEO of a connected chordal graph H is a PEO of H such that for each , is a maximal clique of H or equal to .
Example 1. Let H be the graph shown in Figure 1, whose maximal cliques are , and , and let . An execution of CliqueTree on H and α successively completes the maximal cliques , and K, and we easily check that α is a MCComp PEO of H. Now, let . An execution of CliqueTree on H and β successively completes , starts K, starts and completes and, finally, completes K. β is not a MCComp PEO of H since for , is neither a maximal clique of H, nor equal to ( and ). Using a MCComp PEO instead of an arbitrary PEO, the algorithm CliqueTree can be simplified into the algorithm MCComp-CliqueTree (Algorithm 4) containing the blocks InitCT, StartClique, IncreaseClique and DefineCT, which will be used in further algorithms in this paper.
InitCT // Initialize the Clique Tree
; ; ; ; ;
StartClique // Start a new Clique
;
; ;
; ;
IncreaseClique // Increase the current Clique
; ;
DefineCT // Define the Clique Tree
;
Algorithm 4: MCComp-CliqueTree. |
|
Theorem 2. The algorithm MCComp-CliqueTree computes a clique tree and the set of minimal separators of a connected chordal graph H from a MCComp PEO of H in linear time.
Proof. The proof of complexity is similar to that of Theorem 1, and the correctness of the algorithm follows from Invariant 2. ☐
Invariant 2. The following proposition is an invariant of the for loop of the algorithm MCComp-CliqueTree:- -
(a) (b) (c) (as in Invariant 1)
- -
(d) is a maximal clique of H,
- -
(e) .
Proof. The proposition clearly holds at the initialization step (except for (e), which is undefined). Let us show that it is preserved at iteration i, with . Let (a1) (resp. (b1), …, (e1)) denote Item (a) (resp. (b), …, (e)) at the beginning of iteration i (which is supposed to be true), and let s be the value of this variable at the beginning of iteration i. We prove that (a), (b) and (c) are preserved as in the proof of Invariant 1, except that we have moreover to show that if , then . It is evident if ; otherwise, it follows from the fact that is a maximal clique of H by (d1), whereas S is not, since it is a strict subset of the clique . Hence, (a), (b) and (c) are preserved. Let us show that (d) is preserved. We only have to check that in case s is incremented (to ), is a maximal clique of H. As s is incremented at iteration i , so , and therefore, by (e1), . As with and α is a MCComp PEO of H, it follows that is a maximal clique of H. Thus, (d) is preserved, and (e) obviously holds at the end of iteration i. ☐
Characterization 3. An ordering α of a connected chordal graph H is a MCComp PEO of H if and only if it is a PMO of H.
Proof. We prove this by induction on . The result trivially holds if . We suppose that it holds if . Let us show that it holds if . Let be an ordering of H, and let .
⇒: We suppose that α is a MCComp PEO of H. Let us show that it is a PMO of H. is a MCComp PEO of , so by the induction hypothesis, it is a PMO of compatible with a perfect moplex partition of , say . If , then is a perfect moplex partition of H. Otherwise, in an execution of the algorithm MCComp-CliqueTree on H and α, at Iteration 1 since and by Invariant 2 (e), so S is a minimal separator of H, which makes a moplex of H and a perfect moplex partition of H. Hence, α is a PMO of H.
⇐: We suppose that α is a PMO of H compatible with perfect moplex partition . Let us show that it is a MCComp PEO of H. As it is a PMO of H, it is a PEO of H. is a PMO of (compatible with perfect moplex partition if and otherwise), so by the induction hypothesis, it is a MCComp PEO of . Hence, for each i from two to , is a maximal clique of or equal to . It is sufficient to show that for each i from two to , if is a maximal clique of , then it is a maximal clique of H and that is a maximal clique of H or equal to .
First case:
As is a minimal separator of H, by Characterization 1, it is equal to the intersection of two maximal cliques of H and, therefore, is not a maximal clique of . It follows by Lemma 2 that each maximal clique of is a maximal clique of H. Moreover, , which is a maximal clique of and therefore of H.
Second case:
In that case, . By Lemma 2, each maximal clique of different from is a maximal clique of H. It follows that for each i from two to , if is a maximal clique of , then it is a maximal clique of H, since it does not contain , whereas contains . ☐
Corollary 1. The algorithm MCComp-CliqueTree computes a clique tree and the set of minimal separators of a connected chordal graph H from a PMO of H in linear time.
3.3. Clique Tree Using MLS
The algorithms MCS, LexBFS, LexDFS and, more generally, the algorithm
-MLS for any labeling structure
for which the order on labels is total compute a PMO of a connected chordal graph [
12]. Note that the definition of a labeling structure given in [
12] is less general than the definition given in this paper, but the proof of this result still holds here. We define the algorithm moplex-MLS (Algorithm 5), which computes a PMO of a chordal graph, whether the order on labels is total or not, by adding, in the case where the ordering fails to be total, a tie-breaking rule for choosing a vertex with a maximal label.
Algorithm 5: moplex-MLS. |
|
Theorem 3. The algorithm moplex-MLS computes a PMO of a connected chordal graph.
To prove Theorem 3, we will use the following Lemma.
Lemma 3. In an execution of moplex-MLS, for each i in and each y in V such that , at the beginning of iteration i,- (a)
If , then --.
- (b)
If --, then .
Proof. (a) If , then , so by Lemma 1, --.
(b) We suppose that --. As the label of is maximal at the beginning of iteration , has been increased during iteration , so y is a neighbor of in H. As α is an MLS ordering of H, it is a PEO of H, so is a clique containing , and therefore, . ☐
Proof. (of Theorem 3) Let be the ordering computed by an execution of moplex-MLS on input H and . Let us show that it is a PMO of H. By Characterization 3, it is sufficient to show that α is a MCComp PEO of H. As α is an MLS ordering of H, it is a PEO of H. Let . We suppose that is not a maximal clique of H. Let us show that it is equal to . As is not a maximal clique of H, there is a vertex y, such that and , and therefore, by Lemma 3 (a), -- at the beginning of iteration i in this execution. It follows by the condition on the choice of x that --, and therefore, by Lemma 3 (b), . It is impossible that since in that case , so by Lemma 1 at the beginning of iteration i, and would not be a vertex with maximal label. Hence, . ☐
If
is a labeling structure with a total order on labels, condition “if possible strictly greater than
-
-
” is useless, so the algorithm moplex-
-MLS is actually identical to
-MLS. We thus provide an alternate proof for the result from [
12] that if the order on labels is total, then each
-MLS ordering of a chordal graph is a PMO of this graph, with a more general definition of a labeling structure and an alternative (simpler) proof.
Combining algorithms MCComp-CliqueTree and moplex-MLS, we define the algorithm MLS-CliqueTree (Algorithm 6) computing both a PMO and a clique tree of a chordal graph.
Algorithm 6: MLS-CliqueTree. |
|
The correctness of the algorithm MLS-CliqueTree immediately follows from Corollary 1 and Theorem 3.
Example 2. Consider an execution of the algorithm MLS-CliqueTree on the graph H shown in Figure 1 and labeling structure with choosing vertices f, then e first (and, therefore, completing the maximal clique first). Then, the execution successively completes K, then if , , then K if , and either K, then or , then K otherwise. Removing condition “if possible strictly greater than --” has no effect if , but if , it would allow the execution to choose alternatively a vertex of K and a vertex of , as the labels of the vertices of K are incomparable to the labels of the vertices of . The algorithm MLS-CliqueTree generalizes the algorithm extended-MCS from [
4] and its extension to LexBFS from [
13], except that in these algorithms, the condition “
” is replaced by a direct condition on labels: “
-
-
”. We define a necessary and sufficient condition on a labeling structure
for the replacement of “
” by “
-
-
” (which becomes “
-
-
” if ⪯ is a total order) to be possible.
Definition 5. Let be a labeling structure. is DCL (Detect new Cliques with Labels) if for any integers i and n such that and any subsets I and of , if and , then .
The labeling structures associated with MCS, LexBFS and MNS are clearly DCL, but is not since for any subsets I and of , necessarily holds.
Remark 1. For each , is a DCL labeling structure, but is not.
On a DCL labeling structure, the algorithm DCL-MLS-CliqueTree (Algorithm 7) detects new cliques by a condition on abels.
Algorithm 7: DCL-MLS-CliqueTree. |
|
Theorem 4. The algorithm DCL-MLS-CliqueTree is correct and would be incorrect with any non-DCL input labeling structure. Moreover, if the input labeling structure is with , then the algorithm runs in linear time.
Proof. We suppose that is DCL. It is sufficient to show that at each iteration i in , --, i.e., by Invariant 2 (e), --. The implication from left to right immediately follows from Lemma 3 (a). Let us show the reverse implication. We suppose that --. By Lemma 3 (b), . Let , and let . and --, so , since is DCL. It follows that .
We suppose now that is not DCL. Then, there are some integers i and n with and some subsets I and of such that and . Let and α be defined by: , , is a clique of H, and . H is connected and chordal and by IC α can be computed by an execution of the algorithm DCL-MLS-CliqueTree. At iteration i of such an execution, , but --, so the execution increases current clique instead of starting a new one.
We suppose that the input labeling structure is with . As the order on labels is total, it is sufficient to choose a vertex x with the maximal label at each iteration. As -MLS runs in linear time, it is sufficient to check that condition -- can be evaluated in time. It is obviously the case if . It is also the case if since is of a length of at most . ☐
For
(resp.
), as
is DCL with totally ordered labels, the algorithm DCL-
-MLS-CliqueTree can be simplified by choosing an arbitrary vertex with the maximal label at each iteration, yielding the algorithms from [
4] (resp. [
13]). As
is not DCL, it follows from Theorem 4 that the algorithm DCL-MLS-CliqueTree would be incorrect with
as the input labeling structure. Note that this contradicts Theorem 4.1 from [
14] stating that in an execution of LexDFS,
-
-
is a necessary and sufficient condition for
to be a maximal clique and
to be a minimal separator of the input graph, implying that DCL-MLS-CliqueTree is correct with
as the input labeling structure. The simple graph
H from
Figure 1 is a counterexample as shown below.
Counterexample 1. An execution of the algorithm DCL-MLS-CliqueTree on the graph H shown in Figure 1 and the labeling structure computing ordering is shown in Figure 2. For each vertex x, the number and the final label of x are indicated. At the beginning of Iteration 4, -- and , with according to labeling structure . At Iteration 4, vertex d is chosen, and as --, the execution increases the current clique instead of starting new clique .