1. Introduction
Decomposition by clique minimal separators (into subgraphs called
atoms) was introduced by Tarjan [
1] in 1985 as a useful hole- and antihole-preserving decomposition. It turns out that this decomposition is unique when clique
minimal separators are used [
2].
This decomposition has given rise to recent interest, both in the general case [
2,
3,
4,
5] and for special graph classes [
6,
7,
8,
9,
10,
11]. Applications have arisen in the fields of databases [
12], text mining [
13], and biology [
14,
15].
Berry et al. [
4] introduced the concept of
atom tree, which organizes the atoms of the clique minimal separator decomposition into a tree as a generalization of the clique tree for chordal graphs: the nodes are the atoms, and the edges correspond to the clique minimal separators of the graph. However, as is the case for the clique tree, the atom tree is not uniquely defined. This can be a problem, for instance, with the promising use of an atom tree as a visualization tool.
In this paper, we focus on the atom graph, whose vertices are the atoms and whose edges are those of all possible atom trees.
The notion of atom graph was introduced in 2007 in [
15], in the context of visualizing biological clusters. An efficient construction algorithm was proposed in 2010 in [
16].
In the case of chordal graphs, atoms are the maximal cliques, and atom trees are clique trees. A related graph that has been extensively studied in this context is the
clique graph (see, e.g., [
17,
18]), which is the intersection graph of the maximal cliques. The
weighted clique graph of a chordal graph has been used to construct a clique tree of this graph [
19,
20], its clique trees being the maximum weight spanning trees of its weighted clique graph. Thus, the atom graph of a chordal graph is a subgraph of its clique graph. In the context of efficiently constructing a clique tree, in 1991, Blair and Peyton [
19] studied the family of all possible clique trees, an object very close to the atom graph of a chordal graph. In 1995, Galinier et al. [
21] used the weighted atom graph of a chordal graph but misguidedly called this object the ‘clique graph’. In 2012 in [
22], this object is further studied and called the ‘reduced clique graph’.
Our first goal in this paper is to propose efficient algorithms to compute the atom graph, both in the general case and in the case of chordal graphs.
Given a graph, all known algorithms for computing the decomposition into atoms first compute a minimal triangulation of the graph [
2,
3,
4], with the exception of some special graph classes [
6,
7]. A minimal triangulation can be computed in
time, where
n is the number of vertices of
G,
m is the number of its edges,
is the number of edges of the complement of
G, and
, also denoted by
in the literature, is a real number such that
is the best known time complexity for matrix multiplication, whose current value is 2,3728596 [
4,
23,
24]. From this minimal triangulation, an atom tree can be computed in
time [
2,
4,
5], where
t is the number of two pairs of the minimal triangulation, and thus
. As a result, an atom tree can be computed in
time.
To compute the atom graph efficiently, we present two different approaches. One takes as input an atom tree as well as the inclusion relation between the separators represented by its edges, and the other takes as input the weighted intersection graph of the atoms. In both cases, we provide an algorithm to compute the atom graph from the input. Our global complexity when taking the graph itself as input comes to time.
We then go on to remark that the atoms of a graph can be seen as the hyperedges of an -acyclic hypergraph, whose vertex set is V, since G has an atom tree, which is a join tree of this hypergraph. However, the atoms of a graph are pairwise non-inclusive, which is not a requirement for -acyclic hypergraphs, where a hyperedge can be included in another. Fortunately, our algorithms also work in this more general context.
We introduce the notion of union join graph, which is the union of all join trees, and provide algorithms to compute this object efficiently.
The paper is organized as follows:
Section 2 provides some necessary preliminaries.
Section 3 discusses useful properties of the atom graph.
Section 4 presents our algorithms to compute the atom graph.
Section 5 defines the atom hypergraph and relates it to
-acyclic hypergraphs.
Section 6 discusses how to compute the union join graph of an
-acyclic hypergraph. We conclude in
Section 7.
2. Preliminaries
The graphs considered in this paper are finite and undirected. For a graph , and . For any subset X of V, denotes the subgraph of G induced by X. For any vertex v of G, denotes the neighborhood of v in G: . For any subset X of V, denotes the neighborhood of X in G: . We will omit the subscripts when there is no ambiguity. A clique of G is a set of pairwise adjacent vertices of G, and G is complete if V is a clique of G. The union of two graphs and is the graph .
denotes the complement of G, and denotes the number of its edges. is a real number, such that is the best known time complexity for matrix multiplication. For any set V, is the power set of V. For any subset of , the intersection graph of is the graph , where E is the set of pairs of whose intersection is non-empty. For each graph G, denotes the set of maximal cliques of G, and the clique graph of G is the intersection graph of . If X and Y are nodes of a tree T, denotes the path in T between X and Y.
Separation. Let S be a subset of vertices of a connected graph . S is a separator of G if is disconnected. For any vertices a and b in , S is an -separator of G if a and b are in different connected components of . S is a minimal -separator if it is an inclusion-minimal -separator, and a minimal separator if there is some pair of vertices, such that S is a minimal -separator. Given a minimal separator S, C is a full component of S if C is a connected component of and . S is a minimal separator if and only if S has at least 2 full components, and S is a minimal ab-separator if and only if a and b lie in 2 different full components of S. Given three subsets S, A, and B of V, S is a (minimal) -separator of G if it is a (minimal) -separator of G for each and each .
A 2-pair of a connected graph G is a pair of non-adjacent vertices such that every chordless path between x and y is of length 2, i.e., every sequence of consecutively-adjacent vertices with x and y as endpoints and being minimal for these properties according to the relation of subsequence has 3 vertices, or equivalently, such that is a minimal -separator of G. The number of 2-pairs of a graph is denoted t, with .
If G is disconnected, then a (minimal) (-)separator of G is a (minimal) (-)separator of one of its connected components. Thus, the set of minimal separators of a graph is the union of the sets of minimal separators of its connected components, and so it is for its set of 2-pairs.
Chordal graphs. A graph is
chordal or
triangulated if it has no chordless cycle of length at least 4. A graph is chordal if and only if all its minimal separators are cliques [
25]. A chordal graph has at most
n maximal cliques, and the sum of their sizes is bounded by
. A connected graph is chordal if and only if it has a
clique tree [
20,
26].
Definition 1. Let be a connected chordal graph. A clique tree of G is a tree , such that, for each vertex x of G, the set of nodes of T containing x induces a subtree of T.
Characterization 1 ([19]).
Let be a connected chordal graph, let T be a clique tree of G, and let ; then, S is a minimal separator of G if and only if there is an edge of T, such that .
If
G is a disconnected chordal graph, we associate with
G a forest whose connected components are clique trees of the connected components of
G. A clique tree (forest) can be computed in linear time [
19].
Atoms. Atoms are the subgraphs obtained by applying the decomposition by clique minimal separators (see [
3] for a survey).
Characterization 2 ([2]). An atom of a graph is an inclusion-maximal subset of V inducing a connected subgraph of G with no clique separator.
We will denote the set of atoms of G by .
Property 1. The atoms of a chordal graph are its maximal cliques.
Property 2 ([2]). The intersection of two distinct atoms is a clique.
Notation 1. For a graph , denotes the graph whose vertex set is V and whose edges are the pairs of V that are contained in a common atom of G (this graph is denoted in [2]). Property 3 ([2]). For a graph G, is chordal, its maximal cliques are the atoms of G, and for each clique S of G and each pair of , S is a minimal -separator of G if and only if S is a minimal -separator of .
It follows that a graph has at most n atoms.
Atom trees. To represent the atoms of a graph, [
4] extend the notion of clique tree of a connected chordal graph to the notion of
atom tree of a connected graph:
Definition 2 ([4]). Let be a connected graph. An atom tree of G is a tree , such that, for each vertex x of G, the set of nodes of T containing x induces a subtree of T.
Note that an atom tree is not a decomposition tree of clique separator decomposition as defined in [
1,
16], though this decomposition is called ‘atom tree’ in [
16].
An atom tree of a connected graph
G can be computed in
time [
4,
5].
As for clique trees of chordal graphs, we can extend the definition of an atom tree to the definition of an “atom forest” of an arbitrary graph G, whose connected components are atom trees of the connected components of G.
The edges of an atom tree (forest) of a graph correspond to its clique minimal separators.
Characterization 3 ([4]). Let be a connected graph, let T be an atom tree of G, and let ; then S is a clique minimal separator of G if and only if there is an edge of T, such that .
Property 4. For a connected graph G, the atom trees of G are the clique trees of the chordal graph ( is defined in Notation 1).
Example 1. Figure 1 shows a graph G and two of its atom trees. The atoms of G are , , , , , and . Denoting by the set of atoms containing x for each vertex x of G, the sets containing at least 2 atoms are , , , . Thus, G has 15 atom trees, which are all the trees obtained from the forest by adding 2 edges not containing the node F (6 containing the edge , as the atom tree shown on the left, and 9 not containing it, as the atom tree shown on the right). Each edge of each atom tree is labeled with the associated clique minimal separator of G. The following properties will be used to compute complexity bounds.
Property 5. Let A and B be distinct atoms of a graph G. Then, is connected and .
Proof. By Property 2, is a clique of G. is connected since otherwise would be a clique separator of . Similarly, , since otherwise, would be a clique -separator of for any a in (which is non-empty by definition of atoms) and any b in . □
Property 6. The sum of the sizes of the atoms of a graph is bounded by .
Proof. It is sufficient to prove it in the case of a connected graph G. Let T be an atom tree of G, and let us show by induction on that, for each connected subset of nodes of T, , where and are the numbers of vertices and edges of the subgraph of G induced by . It trivially holds if . We assume that it holds if . Let us show that it holds if . Let be a leaf of , let be the neighbor of in , let , and let . By induction, hypothesis . As T is an atom tree of G, is the disjoint union of and , so . By Property 5, , so . It follows that . □
Property 7. The sum of the sizes of the sets for each edge of an atom tree T of a connected graph is bounded by , and these sets can be computed from T in time.
Proof. Let be an atom tree of G. We consider a rooted directed tree obtained from T by choosing an arbitrary root. Thus, by Property 6.
These sets can be computed by searching T and computing in time when reaching Y from its neighbor X, and therefore in time.by Property 6. □
-acyclic hypergraphs. A simple hypergraph, or hypergraph for short, is a structure , where V is its vertex set and is a set of non-empty subsets of V, called the hyperedges of H, whose union is equal to V. A hypergraph is a clutter if the elements of are pairwise non-inclusive. Its line graph, denoted by , is the intersection graph of . Its 2-section graph, denoted by , is the graph whose vertex set is V and whose edges are the pairs of V that are contained in a hyperedge of H. H is connected if is connected, or equivalently, if is connected. We denote by p the number of hyperedges of a hypergraph. Let be an ordering of V, and let be an ordering of . The incidence matrix of H w.r.t. these orderings is the matrix , such that, for each and each , if and 0 otherwise.
A join tree of H is a tree T whose node set is , such that, for each vertex x of H, the set of nodes of T containing x induces a subtree of T, or equivalently, such that, for each pair of , is a subset of each node of . H is α-acyclic if it has a join tree.
A join tree of an
-acyclic hypergraph
H can be computed in
time, where
s is the sum of the sizes of the hyperedges of
H [
27].
Property 8. Let be an α-acyclic hypergraph, and let G be the 2-section graph . Then, G is chordal, and if, moreover, H is a clutter, then (i.e., the set of hyperedges of H is equal to the set of maximal cliques of G).
It follows that the number of hyperedges of a clutter is bounded by the number of its vertices, since a chordal graph has, at most, n maximal cliques. The number of hyperedges of an -acyclic hypergraph that is not a clutter may be exponential in the number of vertices.
A join tree of an -acyclic hypergraph can be defined from its weighted line graph, where weights are defined as follows. The set associated with a pair of is , and its weight, denoted by , is . Let K be a graph whose node set is . The weight of K is the sum of the weights of its edges. When considered a weighted graph, K is denoted by . Thus, denotes the weighted line graph of H.
Characterization 4 ([28]). Let be an α-acyclic (resp. connected α-acyclic) hypergraph. Then, the join trees of H are the maximum weight spanning trees of the weighted complete graph on (resp. of ).
In particular, the atom trees of a connected graph
G are the maximum weight spanning trees of the weighted intersection graph of the atoms of
G, which is proved in the case of chordal graph in [
19] (and extends to any connected graph through the chordal graph
by Property 4).
4. Computing the Atom Graph
We know that, given a connected graph G, an atom tree of G (and therefore the atoms of G) can be computed in linear time if G is chordal and in time otherwise. To compute the set of edges of the atom graph of G, a naive algorithm consists of computing for each pair of atoms of G the connected components of and determining whether and are in different components, which can be performed in time for each pair and therefore in time globally.
We will improve upon this to obtain a time that is no worse than that of computing an atom tree.
Our first algorithm starts with an atom tree and the inclusion relation between the separators represented by the edges, and adds all the extra edges required to construct the atom graph. Our second algorithm starts with the weighted intersection graph of the atoms and repeatedly determines the edges of weight k, which belong to the atom graph in decreasing order of k. Both algorithms run in time given these inputs. When only the graph is given as input, we obtain a complexity of time, as will be detailed in this section.
We introduce the following parameters, which will be used in this section and in
Section 6:
p denotes the number of atoms of
G,
s the sum of their sizes, and for each atom tree
T of
G,
denotes the sum of the sizes of the symmetrical differences
for each edge
of
T.
Notation 2. For each connected graph G, , , and for each atom tree, of G .
Note that
since
G has at most
n atoms, and that
since the sum of the sizes of the atoms of
G is bounded by
by Property 6. The parameters
p,
s, and
are introduced for two reasons. First, they will be used to extend the complexity results of this section to the context of
-acyclic hypergraphs in
Section 6 with appropriate extensions of the definitions of these parameters. Second, it can lead to a better complexity for graph classes for which these parameters have specific bounds.
As will be detailed in
Section 4.1, we will also need the inclusion relation
sub on the minimal separators represented by the edges of an atom tree.
Definition 4. Let T be an atom tree of a connected graph. We call subset relation of T the relation in the set of edges of T defined by: .
Theorem 1. The atom graph of a connected graph G can be computed:
(a) in time from either an atom tree of G and its subset relation or the weighted intersection graph of the atoms of G,
(b) in time from an atom tree of G,
(c) in time from the set of atoms of G,
(d) in time from G,
where denotes the number of edges of ( is defined in Notation 1).
For a chordal graph H, the atom graph can thus be computed in time, since, in that case, , and an atom tree (clique tree) of G can be computed in linear time.
Other approaches are possible but with no improvement of the time complexity. For instance, as the atom trees of a graph
G are obtained from the atom trees of a minimal triangulation
H of
G by merging the maximal cliques of
H into the atoms of
G [
4], the atom graph of
G is obtained from the atom graph of
H by merging the same maximal cliques of
H.
The different items of Theorem 1 are detailed in the following results: item (a) follows from Theorem 2 and Corollary 1, item (b) follows from item (c) and Theorem 3, item (c) follows from item (a) and Proposition 2, and item (d) follows from item (b) and from the fact that an atom tree of G can be computed in time.
4.1. Algorithm Forest Join
Our first algorithm, Forest Join (Algorithm 1), is based on Characterization 9. Given an atom tree T, a minimal separator S is represented by one or several edges of T. If we remove these edges, we obtain a forest. Let us now further shrink this forest by removing the nodes that do not contain S. Any edge between two nodes of different trees of the resulting forest will correspond to an edge of the atom graph, which also represents S, and all the S representatives are thus encountered.
To implement this remarkable property, our algorithm processes the edges of the atom tree one by one and computes the relevent nodes and edges with the help of relation sub.
Characterization 9. Let G be a connected graph, let T be an atom tree of G, and let S be a minimal separator of G. Then, the edges of associated with S are the pairs of nodes of T whose endpoints are in different connected components of , where is the set of nodes of T containing S, and is the set of edges of T associated with S.
Proof. Let be a pair of nodes of T. Let us show that is an edge of associated with S if and only if X and Y are in different connected components of , i.e., by Characterization 8, and the fact that is connected, that there is an edge of , such that if and only if is a path in having an edge in .
⇒: as is a path in , and as , is in .
⇐: as X and Y are in , . Hence, , and therefore . □
The algorithm Forest Join computes the edges of the atom graph of G according to Characterization 9. Given an atom tree T of G and its subset relation , it scans the edges of T, and for each edge , it computes the set of edges of the atom graph associated with the minimal separator S associated with if it has not been computed yet, i.e., if does not belong to the set of edges computed so far.
It calls the algorithm Components (Algorithm 2), which computes the connected components of the forest defined in Characterization 9. The relation enables us to compute these components at no extra cost than a simple tree search: is the subtree of T whose edges are associated with supersets of S, i.e., satisfy , and is the set of edges of T associated with S, i.e., such that and .
In the algorithm Components,
k is the current number of connected components,
are the current components,
contains the nodes of
T that are reached but not processed yet, and for each reached node
X,
is the index
i of the component
containing
X, and
is the node of
T from which it has been reached (and which should not be processed again).
Algorithm 1: Forest Join.
|
|
Example 3. Figure 3 shows an atom tree T of the graph G from Figure 1 and an execution of the algorithm Forest Join on T and its subset relation. It shows the forest for , where the edges of the atom graph associated with S are represented by dotted lines. For each clique minimal separator S different from , as is of size 2, has a unique edge associated with S, which is also an edge of T. So, is obtained from T by adding the edges associated with that are not already present in T. Theorem 2. Given an atom tree of a connected graph G and its subset relation, the algorithm Forest Join computes the atom graph of G in time, and therefore in time.
Algorithm 2: Components.
|
|
Proof. The correctness follows from Characterization 9. Let us prove the time complexity. As the algorithm Components runs in time and is called less than p times, it globally costs time. As an edge is added to at most once (when processing the first edge of T associated with ), the number of edge additions to is bounded by . Hence, the algorithm Forest Join runs in time, and therefore in time since G has at most n atoms (). □
To evaluate the time complexity of computing the atom graph of G from an atom tree T of G using the algorithm Forest Join, we need the time complexity of computing the subset relation of T.
Proposition 1. Given an atom tree of a connected graph, its subset relation can be computed in time, and therefore in time.
Proof. It follows from the proof of Property 7 that the sets for each edge of T can be computed in time. and that the sum of their sizes is bounded by s. As the inclusion of in or not can be determined in time, the subset relation can be computed in time, i.e., in time.
Alternatively, as is equivalent to , it can be evaluated in time, and therefore in time globally, provided that the values of and have been pre-computed. The values of and for each edge of T can be computed in time, and the values of in time, since they are the elements of the product of the transposition of M by M, where M is the incidence matrix of the (possibly non-simple) hypergraph whose vertex set is V and whose hyperedges are the sets for each edge of T. Hence, this alternative complexity is in time, i.e., in time, since , and .
We obtain a complexity in time, i.e., in time, since and therefore in time, since by Property 6. □
It follows that the atom graph can be computed from an atom tree in time.
We will now discuss using the 2-pairs of the graph defined in Notation 1 to obtain an alternative complexity in time, where is the number of edges of the complement of , through the following lemma.
Lemma 1. Let T be atom tree of a connected graph. Then, , where t is the number of 2-pairs of .
Proof. We consider a rooted directed tree
obtained from
T by choosing an arbitrary root. Thus,
.
, since each vertex
x of
G belongs to
for at most one edge of
, namely the edge
, such that
Y is the root of the subtree of
induced by the nodes containing
x. Hence, it is sufficient to show that
. It is shown in [
4] that, if
G is chordal, then this sum is bounded by the number of 2-pairs of
G. So, it is bounded by
t since
is chordal and by Property 4
T is also an atom tree of
. □
Theorem 3. The atom graph of a connected graph G can be computed from an atom tree T of G in time, and therefore in time, where is the number of edges of the complement of .
Proof. We consider the variant of the algorithm Forest Join, where the subset relation is not given as an input, and ”” and ”” in the algorithm Components are replaced as follows. Condition can be replaced by , since, in the algorithm, satisfies . The values of for each edge of T can be pre-computed in time. Let . As S is a subset of X in the algorithm, and condition is equivalent to , which can be evaluated in time, provided that the sets , and for each edge of T have been pre-computed, which can be done in time. Thus, we add to the time complexity of Algorithm Forest Join in a pre-computation time in and time per call to components. We obtain a time complexity in , and therefore in , since (because the nodes of T are pairwise distinct). We conclude with Lemma 1 □
The 2-pairs of a chordal graph are closely related to its atom graph.
Characterization 10. Let G be a connected chordal graph, and let be a pair of vertices of G. Then, is a 2-pair of G if and only if there is an edge of , such that and .
Proof. ⇒: let . As S is a minimal separator of G and G is chordal, S is a clique. Let K (resp. L) be a maximal clique containing (resp. ). . Hence , and therefore, is an edge of with and .
⇐: let . As is an edge of , S is a minimal -separator. As G is chordal K and L are cliques, so , and as S is an -separator . Hence, , and therefore is a 2-pair of G. □
It follows that the number of 2-pairs of a connected chordal graph G is bounded by the sum of the products for each edge of its atom graph. In particular, in a graph class (of non-necessarily chordal graphs) in which the values of (and ) for each edge of the atom graph are bounded by a given constant, for instance, if the sizes of the atoms are bounded by a constant, the atom graph can be computed from an atom tree in time, where is the number of edges of the computed atom graph. The number of 2-pairs is not equal, in general, to the sum of the products for each edge of its atom graph, since a 2-pair may be associated with several edges of the atom graph. Considering the same relation between the 2-pairs and the edges of an atom tree T of G, a pair associated with an edge of T is a 2-pair, since is an edge of the atom graph, but the converse does not hold. Contrary to the atom graph, can be associated with at most one edge of T, namely the unique edge connecting the subtrees of T induced by the sets of nodes containing x and y, respectively, which are necessarily disjoint and at distance 1 from each other in T.
Thus, the atom graph of G can be computed from an atom tree of G in . This time complexity considers the worst case, where the algorithm Components searches the whole tree T, whereas it only searches the set and its neighborhood, which may be very small w.r.t. the set of nodes of T. It may be more efficient in practice to execute the algorithm Forest Join without pre-computing the subset relation and directly evaluate and when needed.
4.2. Algorithm AG-Max-Weight
Our second algorithm, AG-max-weight (Algorithm 3), takes as input the weighted intersection graph of the atoms (which, in the case of a chordal graph, is the clique graph) and repeatedly adds the edges of weight k in decreasing order of k.
By Characterization 4, the atom trees of a connected graph G are the maximum weight spanning trees of the weighted intersection graph of the atoms of G. We will present a general algorithm computing the union of the maximum weight spanning trees of for each weighted connected graph with natural integer weights on the edges. This general algorithm, called Union-max-weight (Algorithm 4), is inspired by the following algorithm from Kruskal, which computes a minimum weight spanning tree of : initialize graph as edgeless and for each edge of in increasing order of weight, add to if and only if x and y are in different connected components of . As we want to compute a maximum weight spanning tree, we will process the edges in decreasing order of weight; the algorithm computes each maximum weight spanning tree of . Thus, an edge of weight k may be added to by this last algorithm if and only if x and y are in different connected components of just after processing the edges of weight at least . These components are independent of the graph computed so far by item a) of Lemma 2 below.
Lemma 2. Let be a weighted connected graph with natural integer weights on the edges, let T be a maximum weight spanning tree of G, let be the union of the maximum weight spanning trees of G and for a natural integer k, and let (resp. , ) be the graph whose vertex set is V and whose edges are the edges of G (resp. T, ) of weight at least k. Then,
(a) , and have the same connected components;
(b) the edges of of weight k are the edges of G of weight k whose endpoints are in different connected components of .
Proof. (a) As each connected component of is a subset of a connected component of , which is itself a subset of a connected component of , it is sufficient to show that each connected component of is a subset of a connected component of , or equivalently, that, for each edge of , is a path in . Let be an edge of . For each edge of , (otherwise, would be a spanning tree of G of strictly greater weight than T), so is a path in .
(b) Let be an edge of G of weight k. Let us show that is an edge of if and only if x and y are in different connected components of . We assume that is an edge of . Let T be a maximum weight spanning tree of G, such that is an edge of T. x and y are in different connected components of , and therefore of by (a). Conversely, we assume that x and y are in different connected components of . Let T be a maximum weight spanning tree of G. As x and y are in different connected components of , there is an edge of of weight at most k. Then, is a maximum weight spanning tree of G, and therefore is an edge of . □
Item (b) of Lemma 2 provides an inductive definition of the edges of weight k of the union of the maximum weight spanning trees, and therefore a simple iterative algorithm to compute them. Thus, algorithm Union-max-weight computes the union of the maximum weight spanning trees of G by initializing a set F with the empty set and adding to F, for each weight value k in decreasing order, the edges of G of weight k such that x and y are in different connected components of the graph in its state just after adding the edges of weight strictly greater than k.
In the algorithm Union-max-weight,
k is the current value of weight, the sets
are the connected components of the graph
in its state at the beginning of iteration
k and for each vertex
x, and
is the index
i of the component
containing
x. The algorithm is similar to the “maximum weight” variant of Kruskal’s algorithm, the difference being that Kruskal’s algorithm considers the connected components of the graph (tree)
being computed in its current state instead of in its state at the beginning of iteration
k, and therefore would update the variables
and
just after each addition of an edge to
F. It follows that the algorithms and complexity results already published on Kruskal’s algorithm hold for the computation of the union of the maximum weight spanning trees. In particular, the complexity can be improved by using a sophisticated UNION-FIND data structure. However, the simple algorithm presented here is sufficient to compute the atom graph in
time.
Algorithm 3: AG-max-weight. |
input: The weighted intersection graph of the atoms of a connected graph G. output: The atom graph of G. return Union-max-weight |
Algorithm 4: Union-max-weight. |
|
Example 4. Figure 4 shows the weighted intersection graph of the atoms of the graph G from Figure 1 and an execution of the algorithm AG-max-weight, i.e., the algorithm Union-max-weight, on this weighted graph. It shows the state of the computed graph before and after adding the edges of weight 1. Theorem 4. Given a weighted connected graph with natural integer weights on the edges, the algorithm Union-max-weight computes the union of the maximum weight spanning trees of in time, where is the maximum weight of an edge of .
Proof. It follows from Lemma 2 that the property P defined below is an invariant of the main foreach loop, using the notation of this lemma,
P: and ( is the connected component of containing ),
which proves the correctness of the algorithm.
Let us prove its time complexity. and the sets can be computed and scanned in the internal for each loop in time by storing the elements of at index k of an array. The first internal for each loop runs in time globally, and the second one in time globally, since merging two connected components is in time and is performed times. Hence, the algorithm runs in time. □
Corollary 1. Given the weighted intersection graph of the atoms of a connected graph G, the algorithm AG-max-weight computes the atom graph of G in time and therefore in time.
To evaluate the time complexity of computing the atom graph of G from the set of atoms of G using the algorithm AG-max-weight, we need the time complexity of computing the the weighted intersection graph of the atoms of G.
Proposition 2. Given the set of atoms of a connected graph G, the weighted intersection graph of the atoms of G can be computed in time and therefore in time.
Proof. As
can be computed in
time, computing
for each pair
of atoms of
G is in
time. Alternatively, these values can be computed in
time, since they are the elements of the product of the transposition of
M by
M, where
M is the
incidence matrix of the hypergraph
(which will be called the atom hypergraph of
G in
Section 5), i.e., in
time since
. We obtain a time complexity in
and therefore in
, since
by Property 6. □
It follows that the atom graph can be computed from the set of atoms in time.
5. Atom Hypergraph
In this section, we define the atom hypergraph of a graph and relate it to the more general notion of -acyclic hypergraph.
Definition 5. Let be a graph. The atom hypergraph of G is the hypergraph .
Thus, the atom trees of a connected graph are the join trees of its atom hypergraph. We recall that, for each hypergraph H, is the graph whose vertex set is the vertex set of H and whose edges are the pairs of vertices that are contained in a hyperedge of H
Characterization 11. An hypergraph is the atom hypergraph of a connected graph if and only if it is a connected α-acyclic clutter, and in that case, it is the atom hypergraph of the graph , which is a connected chordal graph.
Proof. The atom hypergraph of a connected graph G is connected (since G is and each edge of G is contained in an atom of G), -acyclic (since G has an atom tree) and a clutter (by definition of atoms). Conversely, if H is a connected -acyclic clutter, then by Property 8, it is the atom hypergraph of the graph , which is chordal, and which is connected, since H is. □
Note that, if H is the atom hypergraph of G, then is the graph defined in Notation 1. Thus, we refind that is chordal and has the same atoms as G (Property 3).
Definition 6. The union join graph of an α-acyclic hypergraph H, denoted by , is the union of its join trees.
As the atom graph of a connected graph G is the union of its atom trees by Characterizations 6, we have the following property.
Property 10. The atom graph of a connected graph is the union join graph of its atom hypergraph.
As a generalization of Characterizations 8, the union join graph of an -acyclic hypergraph H can be computed from a join tree of H by the following operation , where stands for “to union join”.
Definition 7. For each join tree of a hypergraph, is the graph whose node set is and whose edges are the pairs of , such that there is an edge of , such that (or equivalently ).
Characterization 12. For each α-acyclic hypergraph H and each join tree T of H, .
Proof. Let and let . Let us show that is an edge of if and only if is an edge of .
⇒: let be a join tree of H, such that is an edge of , and let (resp. ) be the connected component of containing X (resp. Y). As and , there is an edge of such that and . As is a join tree and is an edge of , . Hence, is an edge of .
⇐: let be an edge of , such that , and let be the graph . is a tree with the same weight as T (since ), so by Characterization 4, is also a join tree of H, and therefore, is an edge of . □
Thus, we refind Characterization 8 from Property 10 and Characterization 12. Conversely, Characterization 12 can be deduced from Characterization 8 and Property 11 below, which shows that any -acyclic hypergraph is an atom hypergraph up to isomorphism.
Notation 3. Let and be two sets and let f be a one-to-one mapping from to . For each graph , denotes the graph obtained from K by isomorphism f, i.e., .
Property 11. Let be an α-acyclic hypergraph. Then there is a connected chordal graph and a one-to-one mapping f from to such that:
(1) for each tree , T is a join tree of H if and only if is an atom tree of G;
(2) ;
(3) If H is connected, then for each pair of , ; otherwise, there is an element a of , such that, for each pair of , ;
(4) for each join tree T of H, .
Proof. By Characterization 11, it is sufficient to find a connected -acyclic clutter and a one-to-one mapping f from to , such that: (1) for each tree , T is a join tree of H if and only if is a join tree of ; (2) , and items (3) and (4). Let be defined from by adding a new specific element to each element of , which is not inclusion-maximal in , and adding a new common element a to each element of if H is not connected. Let f map each element of to the element of obtained from it, let , and let . By definition, is a connected clutter satisfying (3). As for each added element (resp. a), the set of elements of containing it is reduced to (resp. equal to ), is -acyclic and satisfies (1); (2) follows from (1), and (4) follows from (3). □
Thus, we can deduce from properties of -acyclic hypergraphs (proved from the definition of -acyclicity) properties of atom graphs, and conversely, we can deduce from properties of atom graphs (proved from properties of the minimal separators of the underlying graph) properties of general -acyclic hypergraphs. This double approach helps to increase knowledge in both domains of atom graphs and -acyclic hypergraphs, as some properties are easier to see in one of these domains than in the other one.
Let us consider the case of a disconnected
-acyclic hypergraph
H. A join tree of
H is obtained from the disjoint union of join trees of its connected components by adding “empty edges”, i.e., edges associated with the empty set, to make it into a tree, and the union join graph of
H is obtained from the disjoint union of the union join graphs of its connected components by adding all edges (which are empty edges) between these union join graphs. Alternatively, if we omit the empty edges, a join tree becomes a forest called
join forest in [
27], whose connected components are the join trees of its connected components, and the union join graph becomes the union of its join forests, whose connected components are the union join graphs of its connected components.
These two alternatives also exist in the graph and minimal separator approach, which correspond to two different definitions of separators in a disconnected graph. According to the definition of separators given in this paper, as the empty set is not a separator and the edges of an atom tree represent the minimal separators, an atom tree naturally extends to an atom forest of a (not necessarily connected) graph, which is the join forest of its atom hypergraph, and its atom graph (Definition 3) is the union of these join forests. According to an alternative definition of separators, which is given, for instance, in [
2], a set
S is an
-separator of
G if
a and
b are in different connected components of
, whether
G is connected or not. It follows that the empty set is the unique minimal
-separator of
G if
a and
b are in different connected components of
G. Thus, according to this alternative definition, an atom tree of a (not necessarily connected) graph is a join tree of its atom hypergraph and its atom graph (Definition 3 again) is the union join graph of its atom hypergraph. In both alternatives, the results for a connected graph naturally extend to a (non necessarily connected) graph using the appropriate definition of separators, as well as to (not necessarily connected)
-acyclic hypergraphs, as will be seen in
Section 6.
6. Computing the Union Join Graph
Algorithms and complexity results of
Section 4 extend to the computation of the union join graph of an
-acyclic hypergraph. They immediately extend to a connected
-acyclic clutter
H, since, in that case,
H is the atom hypergraph of
by Characterization 11. The algorithms still hold for any
-acyclic hypergraph, since the proofs of their correctness do. It is also the case for the complexity bounds in function of parameters
n,
p,
s, and
, whose definitions naturally extend to
-acyclic hypergraphs as follows.
Notation 4. For each α-acyclic hypergraph , , m is the number of edges of , is the number of edges of its complement, , , and for each join tree of H .
We recall that is a real number, such that is the best known time complexity of matrix multiplication. The subset relation of a join tree is defined as that of an atom tree (see Definition 4).
Theorem 5. The union join graph of an α-acyclic hypergraph H can be computed
(a) in time from a join tree of H and either its subset relation or the weighted line graph of H;
(b) in time from the weighted line graph of H;
(c) in time from H, where T is a join tree of H (which is computed along with the union join graph of H).
Proof. Item (a) follows from Theorems 6 and 7, item (b) follows from Corollary 2, item (c) follows from item (b) and Proposition 4 for the
bound, as well as from the extension of Theorem 3 to
-acyclic hypergraphs and the fact that a join tree can be computed in
time [
27] for the
bound. □
The four results below extend Theorem 2, Proposition 1, Corollary 1 and Proposition 2, respectively. The complexity bound is replaced by , which is the original bound appearing in the proofs of the concerned results and has been simplified into since in the case of the atom graph (a graph has at most n atoms).
Theorem 6. Given a join tree of an α-acyclic hypergraph H and its subset relation, the algorithm Forest Join computes the union join graph of H in time.
Proposition 3. Given a join tree of an α-acyclic hypergraph, its subset relation can be computed in time.
Corollary 2. (of Theorem 4) Given the weighted line graph of an α-acyclic hypergraph H, the algorithm Union-max-weight computes the union join graph of H in time.
Proposition 4. Given an α-acyclic hypergraph, its weighted line graph can be computed in time.
We present now the algorithm UJ-min-weight (Algorithm 5), which is an alternative to the algorithm Union-max-weight, computing the union join graph in time instead of time but requiring a join tree of H as input in addition to the weighted line graph of H. This algorithm can obviously be used to compute the atom graph of a connected graph G from an atom tree and the weighted intersection graph of the atoms of G in time and therefore in time, which is already done by the algorithm AG-max-weight with less input. The algorithm follows from Characterization 13 below, which is an immediate consequence of the characterization of as (Characterization 12). The algorithm computes for each pair of hyperedges of H the minimum weight of an edge of the path in T between X and Y and stores it in the variables and to be used later in the execution.
Characterization 13. Let be an α-acyclic hypergraph, let T be a join tree of H, and let . Then, is an edge of if and only if its weight is the minimum weight of an edge of .
Proof. Let be the minimum weight of an edge of . As is a subset of for each edge of , since T is a join tree, , and if and only there is an edge of , such that , i.e., if and only if is an edge of by Characterization 12. □
Algorithm 5: UJ-min-weight. |
|
Theorem 7. Given a join tree and the weighted line graph of an α-acyclic hypergraph H, the algorithm UJ-min-weight computes the union join tree of H in time.
Proof. Correctness follows from the fact that by Characterization 13 the following proposition P is clearly an invariant of the main for each and while loops.
P: , if , then is the minimum weight of an edge of is an edge of ; otherwise, .
The algorithm runs in time by numbering the elements of from 1 to p and storing the values of for each in , such that in an array . □
By Characterization 11, the complexity bounds in function of
n,
m, and
presented in
Section 4 extend to each connected
-acyclic clutter
H replacing
by
, as the graph
is equal to
. In fact, they also hold for each
-acyclic clutter, replacing
m by
. This follows from the fact that the bounds of the parameters
p,
s, and
by functions of
n,
m, and
extend to
-acyclic clutters.
Property 12. For each α-acyclic clutter H, , , and for each join tree T of H, .
Proof. By Characterization 11, these inequalities hold if
H is connected. It can be proved that they also hold if
H is disconnected by checking that the proofs of these inequalities given in
Section 4 still hold. It can also be directly checked as follows. Let
the connected components of
H, and for each
i in
and each variable
v, let
be the value of
v in
. Then,
. Similarly,
. For
, we have
, where
and
, where
. As
, it follows that
. □
Corollary 3. The complexity bounds in function of n, m and presented in Section 4 hold for each α-acyclic clutter H, replacing m by and by . If H is an -acyclic hypergraph, which is not a clutter, the values of p, n, and may be exponential in n. It is the case of the hypergraph , which is -acyclic, since V is a hyperedge of H (the tree whose edges are the pairs of hyperedges containing V is a join tree of H).