This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Computing the Union Join and Subset Graph of Acyclic Hypergraphs in Subquadratic Time

Arne Leitert
Abstract

We investigate the two problems of computing the union join graph as well as computing the subset graph for acyclic hypergraphs and their subclasses. In the union join graph GG of an acyclic hypergraph HH, each vertex of GG represents a hyperedge of HH and two vertices of GG are adjacent if there exits a join tree TT for HH such that the corresponding hyperedges are adjacent in TT. The subset graph of a hypergraph HH is a directed graph where each vertex represents a hyperedge of HH and there is a directed edge from a vertex uu to a vertex vv if the hyperedge corresponding to uu is a subset of the hyperedge corresponding to vv.

For a given hypergraph H=(V,)H=(V,\mathcal{E}), let n=|V|n=|V|, m=||m=|\mathcal{E}|, and N=E|E|N=\sum_{E\in\mathcal{E}}|E|. We show that, if the Strong Exponential Time Hypothesis is true, both problems cannot be solved in 𝒪(N2ε)\mathcal{O}\bigl{(}N^{2-\varepsilon}\bigr{)} time for α\alpha-acyclic hypergraphs and any constant ε>0\varepsilon>0, even if the created graph is sparse. Additionally, we present algorithms that solve both problems in 𝒪(N2/logN+|G|)\mathcal{O}\bigl{(}N^{2}/\log N+|G|\bigr{)} time for α\alpha-acyclic hypergraphs, in 𝒪(Nlog(n+m)+|G|)\mathcal{O}\bigl{(}N\log(n+m)+|G|\bigr{)} time for β\beta-acyclic hypergaphs, and in 𝒪(N+|G|)\mathcal{O}\bigl{(}N+|G|\bigr{)} time for γ\gamma-acyclic hypergraphs as well as for interval hypergraphs, where |G||G| is the size of the computed graph.

1 Introduction

A hypergraph H=(V,)H=(V,\mathcal{E}) is a generalisation of a graph in which each edge EE\in\mathcal{E}, called hyperedge, can contain an arbitrary positive number of vertices from VV. One may also see a hypergraph HH as a family \mathcal{E} of subsets of some set VV. Indeed, we say that the family \mathcal{F} of sets forms the hypergraph H=(V,)H=(V,\mathcal{E}) if V=SSV=\bigcup_{S\in\mathcal{F}}S and =\mathcal{E}=\mathcal{F}. We use n=|V|n=|V|, m=||m=|\mathcal{E}|, and N=E|E|N=\sum_{E\in\mathcal{E}}|E| to respectively denote the cardinality of the vertex set, the cardinality of the hyperedge set, and the total size of all hyperedges of HH.

1.1 Acyclic Hypergraphs

A tree TT is called a join tree for HH if the hyperedges of HH are the nodes of TT and, for each vertex vVv\in V, the hyperedges containing vv induce a subtree of TT. That is, if vEiEjv\in E_{i}\cap E_{j}, then vv is contained in each hyperedge (i. e., node of TT) on the path from EiE_{i} to EjE_{j} in TT. A hypergraph is acyclic if it admits a join tree. There is a linear-time algorithm which determines if a given hypergraph is acyclic and, in that case, constructs a corresponding join tree for it [27].

Acyclic hypergraphs have various applications. They are, for example, a desired structure when designing relational databases [3]. There is also a close relation between acyclic hypergraphs and chordal as well as dually chordal graphs. Namely, a graph is chordal if and only if its maximal cliques form an acyclic hypergraph [18], and a graph is dually chordal if and only if its closed neighbourhoods form an acyclic hypergraph [8].

Tree-decompositions are another application. The idea is to decompose a graph G=(V,E)G=(V,E) into multiple induced subgraphs, usually called bags, where each vertex can be in multiple bags. The set of bags \mathcal{B} forms a tree TT in such a way that the following requirements are fulfilled: Each vertex is in at least one bag, each edge is in at least one bag, and TT is a join tree for the hypergraph (V,)(V,\mathcal{B}). Usually tree-decompositions are considered with additional restrictions. The most known is called tree-width; it limits the maximum cardinality of each bag. For a graph class with bounded tree-width, many NP-complete problems can be solved in polynomial or even linear time. Alternatively, one may limit the distances between vertices inside a bag. Such a tree-decomposition can be used, for example, for constructing tree-spanners [13, 14] and efficient routing schemes [12].

An inclusion-maximal subset of vertices of a graph GG is called an atom if it induces a connected subgraph of GG without a clique separator. It is known that the atoms of a graph form an acyclic hypergraph [23]. The corresponding join tree is then called atom tree.

The most general acyclic hypergraphs are called α\alpha-acyclic (i. e. ., each acyclic hypergraph is α\alpha-acyclic). They are closely related to chordal graphs and to dually chordal graphs. Subclasses of α\alpha-acyclic hypergraphs are β\beta-acyclic hypergraphs which are closely related to strongly chordal graphs and γ\gamma-acyclic hypergraphs which are closely related to ptolemaic graphs (graphs that are chordal and distance-hereditary). We also consider interval hypergraphs. These are acyclic hypergrpahs for which one of their join trees forms a path. As the name suggests, they are closely related to interval graphs. We give formal definitions and more information about each subclass later in their respective sections.

A class of hypergraphs closely related to acyclic hypergraphs are so-called hypertrees. These hypergraphs are defined in the same way as acyclic hypergraphs, except that the roles of vertices and hyperedges are exchanged. That is, a hypergraph is a hypertee if its vertices admit a tree TT such that each hyperedge induces a subtree of TT. The hypergraph resulting from exchanging the roles of vertices and hyperedges is called the dual hypergraph. (See Section 2 for a more formal definition.) Subsequently, a hypergraph is a hypertree if and only if it is the dual of an acyclic hypergraph.

Figure 1 shows the hierarchy of acyclic hypergraphs. See Brandstädt and Dragan [7] for a summary of known properties of acyclic hypergraphs as well as their relations to various graph classes.

α\alpha-acyclichypertreeα\alpha-acyclic \cap hypertreeβ\beta-acyclicγ\gamma-acyclicinterval
Figure 1: Hierarchy of acyclic hypergraphs. An edge from class XX to class YY states that XX is a proper subset of YY.

1.2 Union Join Graph

Note that the join tree of an acyclic hypergraph is not always unique. For example, each tree with nn nodes is a valid join tree for the hypergraph formed by {{0,1},{0,2},,{0,n}}\bigl{\{}\{0,1\},\{0,2\},\ldots,\{0,n\}\bigr{\}}. The union join graph GG of a given acyclic hypergraph HH is the union of all its join trees. That is, each vertex of GG represents a hyperedge of HH and two vertices of GG are adjacent if there exits a join tree TT for HH such that the corresponding hyperedges are adjacent in TT. The union join graph of a hypergraph HH may also be called clique graph if HH represents the maximal cliques of a chordal graph [17, 20], or atom graph if HH represents the atoms of some graph [21]. In [5], Berry and Simonet present algorithms which compute the union join graph of an acyclic hypergraph in 𝒪(Nm)\mathcal{O}(Nm) time.

1.3 Subset Graph

The subset graph of a hypergraph HH is a directed graph GG where each vertex represents a hyperedge of HH and there is a directed edge from a vertex uu to a vertex vv if the hyperedge corresponding to uu is a subset of the hyperedge corresponding to vv. Pritchard presents an algorithm in [26] that computes the subset graph for a given hypergraph in 𝒪(N2/logN)\mathcal{O}\bigl{(}N^{2}/\log N\bigr{)} time. They also show that any subset graph has at most 𝒪(N2/log2N)\mathcal{O}\bigl{(}N^{2}/\log^{2}N\bigr{)} many edges. There are various publications that present algorithms for special cases and different computational models; see for example [15, 25] and the work cited therein.

The Strong Exponential Time Hypothesis, SETH for short, states that there is no algorithm that solves the Boolean satisfiability problem (without limitation on clause size) for some constant ε>0\varepsilon>0 in 𝒪((2ε)n)\mathcal{O}\bigl{(}(2-\varepsilon)^{n}\bigr{)} time where nn is the number of variables in the given instance. A function f(n)f(n) is called truly subquadratic if f(n)𝒪(n2ε)f(n)\in\mathcal{O}\bigl{(}n^{2-\varepsilon}\bigr{)} for some constant ε>0\varepsilon>0. Borassi et al. [6] show that, if SETH holds, then there is no algorithm to compute the subset graph of an arbitrary hypergraph in truly subquadratic time, even if the output is sparse. Note that the results in [6] and [26] are not conflicting, since N2εo(N2/logN)N^{2-\varepsilon}\in o\bigl{(}N^{2}/\log N\bigr{)}.

1.4 Our Contribution

In this paper, we investigate the two problems of computing the union join graph as well as computing the subset graph for acyclic hypergraphs and their subclasses. We show in Section 3 that there is a close relation between both problems by presenting reductions in both directions. It then follows that the result by Borassi et al. still holds when restricted to α\alpha-acyclic hypergraphs and also applies to computing a union join graph. We then develop efficient algorithms to solve both problems for acyclic hypergraphs and their subclasses. In particular, we show that, if |G||G| denotes the size of the computed graph GG, then both problems can be solved in 𝒪(N2/logN+|G|)\mathcal{O}\bigl{(}N^{2}/\log N+|G|\bigr{)} time for α\alpha-acyclic hypergraphs (Section 3), in 𝒪(Nlog(n+m)+|G|)\mathcal{O}\bigl{(}N\log(n+m)+|G|\bigr{)} time for β\beta-acyclic hypergaphs (Section 4), and in 𝒪(N+|G|)\mathcal{O}\bigl{(}N+|G|\bigr{)} time for γ\gamma-acyclic hypergraphs (Section 5) as well as for interval hypergraphs (Section 6).

2 Preliminaries

Two graphs G=(V,E)G=(V,E) and G=(V,E)G^{\prime}=(V^{\prime},E^{\prime}) are isomorphic if there is a bijective function f:VVf\colon V\rightarrow V^{\prime} such that uvEuv\in E if and only if f(u)f(v)Ef(u)f(v)\in E^{\prime}. For simplicity, we write G=GG=G^{\prime} if they are isomorphic.

Let H=(V,)H=(V,\mathcal{E}) be a hypergraph. The incidence graph (H)=(UVU,E)\mathcal{I}(H)=\bigl{(}U_{V}\cup U_{\mathcal{E}},E_{\mathcal{I}}\bigr{)} of HH is a bipartite graph were UVU_{V} represents the vertices of HH, UU_{\mathcal{E}} represents the hyperedges of HH, and there is an edge between two vertices uvUVu_{v}\in U_{V} and uEUu_{E}\in U_{\mathcal{E}} if the corresponding vertex vv (of HH) is in the corresponding hyperedge EE. That is, UV={uvvV}U_{V}=\{\,u_{v}\mid v\in V\,\}, U={uEE}U_{\mathcal{E}}=\{\,u_{E}\mid E\in\mathcal{E}\,\}, and E={uvuEvE}E_{\mathcal{I}}=\{\,u_{v}u_{E}\mid v\in E\,\}. Note that |E|=N\bigl{|}E_{\mathcal{I}}\bigr{|}=N. If not stated or constructed otherwise, the incidence graphs of all hypergraphs occurring in this paper are connected, finite, undirected, and without multiple edges. Additionally, whenever a hypergraph is given, it is given as its incidence graph; hence, the input size is in Θ(N)\Theta(N). We say two hyperedges of HH are distinct if they are represented by two different vertices in (H)\mathcal{I}(H), even if both hyperedges contain the same vertices.

Let (UVU,E)\bigl{(}U_{V}\cup U_{\mathcal{E}},E_{\mathcal{I}}\bigr{)} be the incidence graph of some hypergraph H=(V,)H=(V,\mathcal{E}). One can then exchange the roles of UVU_{V} and UU_{\mathcal{E}} to interpret UU_{\mathcal{E}} as vertices and UVU_{V} as hyperedges. We call the resulting hypergraph the dual hypergraph of HH and denote it as HH^{*}. Observe that, by definition, (H)=H(H^{*})^{*}=H.

The 2-section graph 2SecSec(H)\operatorname{2Sec}Sec(H) of HH is the graph with the vertex set VV where two vertices uu and vv are adjacent if there is a hyperedge EE\in\mathcal{E} with u,vEu,v\in E. The line graph L(H)L(H) of HH is the intersection graph of its hyperedges. That is, L(H)=(,L)L(H)=(\mathcal{E},\mathcal{E}_{L}) with L={EiEjEi,Ej;EiEj}\mathcal{E}_{L}=\{\,E_{i}E_{j}\mid E_{i},E_{j}\in\mathcal{E};E_{i}\cap E_{j}\neq\emptyset\,\}. It directly follows from these definitions that 2SecSec(H)=L(H)\operatorname{2Sec}Sec(H)=L(H^{*}).

A sequence v1,v2,,vk\langle v_{1},v_{2},\ldots,v_{k}\rangle of vertices of HH forms a path in HH if, for each ii with 1i<k1\leq i<k, HH contains a hyperedge EE with vi,vi+1Ev_{i},v_{i+1}\in E. Let XX, YY, and ZZ be sets of vertices of HH. XX separates YY form ZZ if XX\neq\emptyset and each sequence of vertices that forms a path from YY to ZZ in HH contains a vertex from XX.

Let TT be the join tree of some acyclic hypergraph HH and let EiE_{i} and EjE_{j} be two hyperedges of HH which are adjacent in TT. We then call the set S=EiEjS=E_{i}\cap E_{j} a separator of HH with respect to TT. If TT is rooted and EiE_{i} is the parent of EjE_{j}, we call S(Ej):=EiEjS^{\raisebox{0.3014pt}{$\scriptscriptstyle\uparrow$}}(E_{j}):=E_{i}\cap E_{j} the up-separator of EjE_{j}. Note that each separator corresponds to an edge of TT and vice versa. We call the hypergraph formed by the set of all separators of HH the separator hypergraph 𝒮(H)\mathcal{S}(H) for HH with respect to TT. It follows from properties ii and iii of Lemma 3 (see Section 3) that 𝒮(H)\mathcal{S}(H) is always the same for a given HH, independent of the used join tree.

3 α\alpha-Acyclic Hypergraphs

In this section, we investigate the problems of computing a union join graph and computing a subset graph for the most general case of acyclic hypergraphs. We first show that computing these graphs cannot be done in truly subqadratic time if the SETH is true. For that, we use a problem called Sperner Family problem. It asks whether a family of sets contains two sets SS and SS^{\prime} such that SSS\subseteq S^{\prime}. If the SETH is true, then there is no algorithm that solves it truly subquadratic time [6]. Afterwards, we give an algorithm that allows to quickly compute the union join graph if a fast algorithm for the subset graph problem is given. Lastly, we give some additional notes on the Sperner Family problem and its generalisation.

3.1 Hardness Results

Let ={S1,S2,,Sm}\mathcal{F}=\{S_{1},S_{2},\ldots,S_{m}\} be a family of sets. We create an acyclic hypergraph HH from \mathcal{F} as follows. Create a new vertex uu (i. e., uu is not contained in any set SiS_{i}) and, for each set SiS_{i}, create a hyperedge Ei=Si{u}E_{i}=S_{i}\cup\{u\}. Additionally, create a hyperedge 𝒮\mathcal{S} which is the union of all hyperedges EiE_{i}. Formally, we have that H=(V,)H=(V,\mathcal{E}) with V=𝒮V=\mathcal{S} and ={Ei|Si}{𝒮}\mathcal{E}=\big{\{}\,E_{i}\bigm{|}S_{i}\in\mathcal{F}\,\big{\}}\cup\{\mathcal{S}\}. One can create a join tree TT for HH by starting with 𝒮\mathcal{S} and then making each hyperedge EiE_{i} adjacent to it. Thus, HH is acyclic. Note that one can create HH and TT from \mathcal{F} in linear time.

For the remainder of this subsection, assume that we are given a family \mathcal{F}, a hypergraph HH, and a corresponding join tree TT for HH as defined above. Our results in this subsection are based on the following observation.

Lemma 1

\mathcal{F} contains two distinct sets SiS_{i} and SjS_{j} with SiSjS_{i}\subseteq S_{j} if and only if there is a join tree for HH that contains the edge EiEjE_{i}E_{j}.

Proof

First, assume that \mathcal{F} contains two distinct sets SiS_{i} and SjS_{j} with SiSjS_{i}\subseteq S_{j}. In that case, we can create a new join tree TT^{\prime} as follows. Remove the edge Ei𝒮E_{i}\mathcal{S} from TT and make EiE_{i} adjacent to EjE_{j} instead. Since SiSjS_{i}\subseteq S_{j}, each element xEi𝒮x\in E_{i}\cap\mathcal{S} is also contained in EjE_{j}. Thus, TT^{\prime} is a join tree for HH and contains the edge EiEjE_{i}E_{j}.

Next, assume that there is a join tree TT^{\prime} for HH with the edge EiEjE_{i}E_{j}. Without loss of generality, let EjE_{j} be closer to 𝒮\mathcal{S} in TT^{\prime} than EiE_{i}. Recall that Ei𝒮E_{i}\subseteq\mathcal{S}. Therefore, by properties of join trees, each vertex in EiE_{i} is also in EjE_{j}. It then directly follows from the construction of HH that SiSjS_{i}\subseteq S_{j}. \square

We use the Sperner Family problem to show that there is no truly subquadratic-time algorithm to compute the union join graph of a given acyclic hypergraph. To do so, we first show the following.

Lemma 2

If the SETH is true, then there is no algorithm which decides in 𝒪(N2ε)\mathcal{O}\big{(}N^{2-\varepsilon}\big{)} time whether or not a given acyclic hypergraph has a unique join tree.

Proof

Recall that we can create a join tree TT for HH by making each hyperedge EiE_{i} adjacent to the hyperedge 𝒮\mathcal{S}. To prove Lemma 2, we show that \mathcal{F} contains two distinct sets SiS_{i} and SjS_{j} with SiSjS_{i}\subseteq S_{j} if and only if TT is not a unique join tree for HH.

First, assume that \mathcal{F} contains two such sets SiS_{i} and SjS_{j}. In that case, Lemma 1 implies that there is a join tree TT^{\prime} for HH with the edge EiEjE_{i}E_{j}. Since EiEjE_{i}E_{j} is not an edge in TT, TT is not unique. Next, assume that TT is not unique. Then, there is a join tree TT^{\prime} and a hyperedge EiE_{i} such that EiE_{i} is not adjacent to 𝒮\mathcal{S} in TT^{\prime}. Hence, EiE_{i} is adjacent to some hyperedge EjE_{j} that is closer to 𝒮\mathcal{S} in TT^{\prime} than EiE_{i}. Since Ei𝒮E_{i}\subseteq\mathcal{S}, properties of join trees imply that EiEjE_{i}\subseteq E_{j}. Subsequently, due to Lemma 1, SiSjS_{i}\subseteq S_{j}.

It follows that a truly subquadratic-time algorithm which determines if an acyclic hypergraph has a unique join tree would imply an equally fast algorithm to solve the Sperner Family problem for any family of sets. \square

Note that, by definition of a union join graph, HH has a unique join tree if and only if the union join graph of HH is a tree. Therefore, we get the following.

Theorem 3.1

If the SETH is true, then there is no algorithm which constructs the union join graph of a given acyclic hypergraph in 𝒪(N2ε)\mathcal{O}\big{(}N^{2-\varepsilon}\big{)} time, even if that graph is sparse.

We now show that computing the subset graph of an acyclic hypergraph is as hard as computing the subset graph for a general family of sets.

Theorem 3.2

If the SETH is true, then there is no algorithm which constructs the subset graph of a given acyclic hypergraph in truly subquadratic time.

Proof

Let GG be the subset graph for HH and GG_{\mathcal{F}} be the subset graph for \mathcal{F}. Since, by construction of HH, EiEjE_{i}\subseteq E_{j} if and only if SiSjS_{i}\subseteq S_{j}, GG contains the edge (Ei,Ej)(E_{i},E_{j}) if and only if GG_{\mathcal{F}} contains the edge (Si,Sj)(S_{i},S_{j}). We can therefore construct GG_{\mathcal{F}} from GG by simply removing the vertex representing 𝒮\mathcal{S} from GG (and its incident edges).

Recall that we can construct HH from \mathcal{F} in linear time. Therefore, a truly subquadratic-time algorithm to construct the subset graph of a given acyclic hypergraph would imply an equally fast algorithm to construct a subset graph of a given family of sets. \square

3.1.1 Note on Hypertrees.

Observe that, in the hypergraph HH as constructed above, each hyperedge contains the vertex uu. We can therefore create a tree TT by making each other vertex a leaf adjacent to uu. Each hyperedge of HH now induces a subtree of TT, i. e., HH is a hypertree.

It follows that Lemma 2 and Theorem 3.1 still hold if the given hypergraph is both acyclic and a hypertree. Therefore, there is no truly subquadratic-time algorithm which, in general, computes the union join graph of such a hypergraph or determines if has a unique join tree.

3.2 Union Join Graph via Subset Graph

In the previous subsection, we show how to compute the subset graph using the union join graph of an acyclic hypergraph. We now present an algorithm that computes the union join graph of a given acyclic hypergraph with the help of a subset graph. The runtime of our algorithm then depends on the runtime required to compute that subset graph.

For the remainder of this subsection, assume that we are given an acyclic hypergraph H=(V,)H=(V,\mathcal{E}) and let GG be the union join graph of HH (with for us unknown edges). Lemma 3 below gives various characterisations for GG.

Lemma 3

For any distinct Ei,EjE_{i},E_{j}\in\mathcal{E}, the following are equivalent.

  1. (i)

    EiEjE_{i}E_{j} is an edge of GG.

  2. (ii)

    HH has a join tree with the edge EiEjE_{i}E_{j}.

  3. (iii)

    Each join tree TT of HH has an edge EiEjE_{i}^{\prime}E_{j}^{\prime} on the path from EiE_{i} to EjE_{j} in TT such that EiEj=EiEjE_{i}\cap E_{j}=E_{i}^{\prime}\cap E_{j}^{\prime}.

  4. (iv)

    Each join tree TT of HH has a separator SS on the path PijP_{ij} from EiE_{i} to EjE_{j} in TT with SSiS\subseteq S_{i} and SSjS\subseteq S_{j} where SiS_{i} and SiS_{i} are the separators in PijP_{ij} which are respectively closest to EiE_{i} and EjE_{j}.

  5. (v)

    EiEjE_{i}\cap E_{j} separates EiEjE_{i}\setminus E_{j} from EjEiE_{j}\setminus E_{i}.

Most of the properties in Lemma 3 repeat, generalise, or paraphrase existing results (see [5, 17, 20]). Property iv is, to the best of our knowledge, a new observation. For completeness, however, we prove all of them.

Proof

By definition of GG, properties i and ii are equivalent. It follows from properties of join trees that ii implies v.

We next show that v implies iii. Assume that EiE_{i} and EjE_{j} are not adjacent in a join tree TT. Then there is a path Ei=X1,X2,,Xk=Ej\langle E_{i}=X_{1},X_{2},\ldots,X_{k}=E_{j}\rangle of hyperedges from EiE_{i} to EjE_{j} in TT. For each pp with 1p<k1\leq p<k, let Sp=XpXp+1S_{p}=X_{p}\cap X_{p+1} be the separator corresponding to the edge XpXp+1X_{p}X_{p+1} of TT. By properties of join trees, EiEjSpE_{i}\cap E_{j}\subseteq S_{p} for each SpS_{p}. Now assume that each SpS_{p} contains a vertex vpEiEjv_{p}\notin E_{i}\cap E_{j}. Then, v1,v2,,vk1\langle v_{1},v_{2},\ldots,v_{k-1}\rangle would form a path in HH from v1EiEjv_{1}\in E_{i}\setminus E_{j} to vk1EjEiv_{k-1}\in E_{j}\setminus E_{i}. That contradicts with property v. Therefore, there is at least one separator SpS_{p} with SpEiEjS_{p}\subseteq E_{i}\cap E_{j}, i. e., there is an edge XpXp+1X_{p}X_{p+1} in TT with EiEj=XpXp+1E_{i}\cap E_{j}=X_{p}\cap X_{p+1}.

To show that iii implies ii, consider a join tree TT where EiE_{i} and EjE_{j} are not adjacent. We can create a join tree TT^{\prime} by removing the edge EiEjE_{i}^{\prime}E_{j}^{\prime} and adding the edge EiEjE_{i}E_{j} instead. Since EiE_{i} and EjE_{j} are on different sides of EiEjE_{i}^{\prime}E_{j}^{\prime} in TT, TT^{\prime} is also a tree. Additionally, because EiEj=EiEjE_{i}\cap E_{j}=E_{i}^{\prime}\cap E_{j}^{\prime}, TT^{\prime} is a valid join tree for HH.

It remains to show that iv is equivalent to iii. We first assume property iii. Let S=EiEjS=E_{i}\cap E_{j} be a separator on the path from EiE_{i} to EjE_{j} in some join tree TT. Since, by properties of join trees, each vertex in S=EiEjS=E_{i}\cap E_{j} is also in SiS_{i} and SjS_{j}, it follows that SSiS\subseteq S_{i} and SSjS\subseteq S_{j}. Now assume property iv. Because SSiEiS\subseteq S_{i}\subseteq E_{i} and SSjEjS\subseteq S_{j}\subseteq E_{j}, it is also the case that SEiEjS\subseteq E_{i}\cap E_{j}. Since SS is on the path from EiE_{i} to EjE_{j} in TT, each vertex that is in both EiE_{i} and EjE_{j} also has to be in SS, i. e., SEiEjS\supseteq E_{i}\cap E_{j}. Therefore, S=EiEjS=E_{i}\cap E_{j}. \square

Based on Lemma 3, we can construct GG as follows. Compute a join tree TT for HH, the separator hypergraph 𝒮(H)\mathcal{S}(H) (with respect to TT), and its subset graph G𝒮G_{\mathcal{S}}. Next, use G𝒮G_{\mathcal{S}} to find all triples Si,Sj,SS_{i},S_{j},S of separators which satisfy property iv of Lemma 3. Since their corresponding hyperedges are then adjacent in some join tree of HH, make the corresponding vertices adjacent in GG.

Before analysing our approach further, we address some needed preprocessing. Assume that HH contains two hyperedges EiE_{i} and EjE_{j} which are not adjacent in TT, but are adjacent in some other join tree. There might then be multiple separators SS on the path from EiE_{i} to EjE_{j} in TT which satisfy property iv of Lemma 3. Our algorithm would, therefore, add the edge EiEjE_{i}E_{j} to GG multiple times, once for each such SS. While it is easy to remove redundant edges from GG afterwards, we still want to ensure that the time needed to create and remove these edges does not become too much. To achieve that, Algorithm 1 modifies TT such that each hyperedge becomes adjacent to its highest possible ancestor in TT. As by-product, Algorithm 1 also computes the up-separator of each hyperedge (and, thus, the separator hypergraph 𝒮(H)\mathcal{S}(H)).

1
Input: An acyclic hypergraph H=(V,)H=(V,\mathcal{E}) and a join tree TT for HH.
2
Output: A modified join tree TT^{\prime} for HH and the separator hypergraph 𝒮(H)\mathcal{S}(H).
3
4Root TT in an arbitrary hyperedge RR and then run a pre-order on TT. Let σ=R=E1,E2,,Em\sigma=\langle R=E_{1},E_{2},\ldots,E_{m}\rangle be the resulting order.
5For each vertex vv, set λ(v):=min{ivEi}\lambda(v):=\min\{\,i\mid v\in E_{i}\,\}.
6for i:=2i:=2 to mm  do
7      Set S(Ei):={vEi|λ(v)<i}S^{\raisebox{0.3014pt}{$\scriptscriptstyle\uparrow$}}(E_{i}):=\bigl{\{}\,v\in E_{i}\bigm{|}\lambda(v)<i\,\bigr{\}}.
8      Let j=max{λ(v)|vS(Ei)}j=\max\bigl{\{}\,\lambda(v)\bigm{|}v\in S^{\raisebox{0.3014pt}{$\scriptscriptstyle\uparrow$}}(E_{i})\,\bigr{\}} and make EjE_{j} the parent of EiE_{i}.
9
Let 𝒮(H)\mathcal{S}(H) be the hypergraph formed by the family {S(Ei)|Ei,EiR}\bigl{\{}\,S^{\raisebox{0.3014pt}{$\scriptscriptstyle\uparrow$}}(E_{i})\bigm{|}E_{i}\in\mathcal{E},E_{i}\neq R\,\bigr{\}}.
Algorithm 1 Modifies the join tree of a given acyclic hypergraph such that each hyperedge becomes adjacent to its highest possible ancestor.
Lemma 4

Algorithm 1 runs in linear time.

Proof

Line 1 runs in 𝒪(m)\mathcal{O}(m) time, since the nodes of TT are the hyperedges of HH. Recall that HH is given as an incidence graph (H)\mathcal{I}(H). Hence, the following are equivalent (with respect to runtime): (i) for each vertex, iterating over all hyperedges containing it; (ii) for each hyperedge, iterating over all vertices it contains; and (iii) iterating over all edges of (H)\mathcal{I}(H). Therefore, line 1, line 1, and line 1 (and subsequently Algorithm 1) run in 𝒪(N)\mathcal{O}(N) total time. \square

Lemma 5

The tree TT^{\prime} created by Algorithm 1 is a valid join tree for HH.

Proof

Let TiT_{i} be the tree after processing EiE_{i}, i. e., T=T1T=T_{1} and Tm=TT_{m}=T^{\prime}. Thus, T1T_{1} is a valid join tree for HH. Assume, by induction, that Ti1T_{i-1} (with i2i\geq 2) is a valid join tree for HH too. Recall that, by definition of join trees, the set of hyperedges containing a vertex vv form a subtree TvT_{v} of TT. The roots of all such TvT_{v} where vS(Ei)v\in S^{\raisebox{0.3014pt}{$\scriptscriptstyle\uparrow$}}(E_{i}) are ancestors of EiE_{i} in TT and, thus, form a path. By definition of jj (line 1), EjE_{j} is the lowest of such roots in TT. It therefore follows that S(Ei)EjS^{\raisebox{0.3014pt}{$\scriptscriptstyle\uparrow$}}(E_{i})\subseteq E_{j}. Subsequently, for each vS(Ei)v\in S^{\raisebox{0.3014pt}{$\scriptscriptstyle\uparrow$}}(E_{i}), the hyperedges containing vv still form a subtree of TiT_{i} after changing the parent of EiE_{i} if they did so in Ti1T_{i-1}. Note that each subtree TuT_{u} of a vertex uS(Ei)u\notin S^{\raisebox{0.3014pt}{$\scriptscriptstyle\uparrow$}}(E_{i}) remains unchanged, since it does not contain the edge EiEkE_{i}E_{k}. Therefore, for each vertex, the hyperedges containing it form a subtree of TiT_{i} and, thus, TiT_{i} is a join tree for HH. \square

Lemma 6

Let EiE_{i} and EjE_{j} be two hyperedges of HH, TT^{\prime} be the tree computed by Algorithm 1, and PijP_{ij} be the path from EiE_{i} to EjE_{j} in TT^{\prime}. Additionally, let SiS_{i} and SjS_{j} be the separators on PijP_{ij} which are closest to EiE_{i} and EjE_{j}, respectively. There are at most two separators SS on PijP_{ij} such that SSiS\subseteq S_{i} and SSjS\subseteq S_{j}.

Proof

Let EkE_{k} be the lowest common ancestor of EiE_{i} and EjE_{j} in TT^{\prime}. Although TT^{\prime} has a potentially different structure than TT, it is still the case that the parent of a hyperedge in TT^{\prime} was an ancestor of it in TT. Thus, ki,jk\leq i,j. Note that PijP_{ij} goes through EkE_{k} and let PikP_{ik} and PkjP_{kj} be the respective subpaths of PijP_{ij}. If PijP_{ij} contains more than two separators SS as defined in Lemma 6, at least two of them are either part of PikP_{ik} or PkjP_{kj}. Without loss of generality, let them be on PkjP_{kj} and let SS be the lowest such separator. Additionally, let XX be the hyperedge directly below SS, i. e., S(X)=SS^{\raisebox{0.3014pt}{$\scriptscriptstyle\uparrow$}}(X)=S. It follows that XX is not adjacent to EkE_{k} in TT^{\prime}.

Since SSiS\subseteq S_{i}, each vertex in SS is in all hyperedges on the path from XX to EiE_{i} in TT^{\prime}, including EkE_{k}. Therefore, SEkS\subseteq E_{k} and max{λ(v)|vS}k\max\bigl{\{}\,\lambda(v)\bigm{|}v\in S\,\bigr{\}}\leq k. That is a contradiction, since Algorithm 1 would have made XX adjacent to EkE_{k} or one of its ancestors. \square

Algorithm 2 now implements the approach described above. It also uses Algorithm 1 as preprocessing. Therefore, due to Lemma 6, the algorithm adds each edge EiEjE_{i}E_{j} at most two times into GG.

1
Input: An acyclic hypergraph H=(V,)H=(V,\mathcal{E}) and an algorithm 𝒜\mathcal{A} that computes the subset graph for a given family of sets.
2
Output: The union join graph GG of HH.
3
4Find a join tree for HH (see [27]) and call Algorithm 1. Let TT be the resulting join tree and 𝒮\mathcal{S} the resulting family of separators (i. e., the hyperedges of 𝒮(H)\mathcal{S}(H)).
5Use algorithm 𝒜\mathcal{A} to compute the subset graph G𝒮G_{\mathcal{S}} of 𝒮\mathcal{S}.
6Create a new graph G=(,EG)G=(\mathcal{E},E_{G}) with EG=E_{G}=\emptyset.
7foreach S𝒮S\in\mathcal{S}  do
8       Use G𝒮G_{\mathcal{S}} to determine all separators SS^{\prime} with SSS\subseteq S^{\prime} (including SS itself).
9      For each such SS^{\prime}, let EEEE^{\prime} be the edge of TT which SS^{\prime} represents and let EE be the hyperedge farther away from SS in TT. Add EE to a set 𝔼\mathbb{E} of hyperedges. If SS and SS^{\prime} represent the same edge of TT, also add EE^{\prime}.
10      Partition 𝔼\mathbb{E} into two sets 𝔼1\mathbb{E}_{1} and 𝔼2\mathbb{E}_{2} based on which side of SS they are in TT.
11      For each pair E1,E2E_{1},E_{2} with E1𝔼1E_{1}\in\mathbb{E}_{1} and E2𝔼2E_{2}\in\mathbb{E}_{2}, add E1E2E_{1}E_{2} into EGE_{G}.
Algorithm 2 Computes the union join graph of an acyclic hypergraph.
Theorem 3.3

Algorithm 2 computes the union join graph GG of a given acyclic hypergraph HH in 𝒪(T𝒜(H)+N+|G|)\mathcal{O}\bigl{(}T_{\mathcal{A}}(H)+N+|G|\bigr{)} time where T𝒜(H)T_{\mathcal{A}}(H) is the runtime of a given algorithm 𝒜\mathcal{A} with the separator hypergraph of HH as input.

Proof (Correctness)

Let EiE_{i} and EjE_{j} be two hyperedges of HH. Additionally, let SiS_{i} and SjS_{j} be the separators on the path from EiE_{i} to EjE_{j} in TT (computed in line 2) which are closest to EiE_{i} and EjE_{j}, respectively. We show the correctness of Algorithm 2 by showing that EiEjE_{i}E_{j} is an edge of GG if and only if there is a join tree for HH with the edge EiEjE_{i}E_{j}.

First, assume that there is a join tree for HH with the edge EiEjE_{i}E_{j}. Lemma 3 then implies that there is a separator S𝒮S\in\mathcal{S} such that SSiS\subseteq S_{i}, SSjS\subseteq S_{j}, and EiE_{i} and EjE_{j} are on different sides of SS in TT. Therefore, when processing SS, the algorithm finds SiS_{i} and SjS_{j} (line 2) and consequently adds EiE_{i} and EjE_{j} into 𝔼\mathbb{E} (line 2). Since both hyperedges are on different sides of SS, Algorithm 2 then also adds the edge EiEjE_{i}E_{j} to GG (line 2).

We now assume that EiEjE_{i}E_{j} is an edge of GG. Note that Algorithm 2 only adds edges to GG in line 2. Thus, there is a separator S𝒮S\in\mathcal{S} for which the algorithm adds EiEjE_{i}E_{j} to GG. For that SS, one of EiE_{i} and EjE_{j} is in 𝔼1\mathbb{E}_{1} and the other is in 𝔼2\mathbb{E}_{2} (line 2) and, hence, EiE_{i} and EjE_{j} are on different sides of SS in TT (line 2). This implies that SSiS\subseteq S_{i} and SSjS\subseteq S_{j} (line 2 and line 2). Therefore, by Lemma 3, there is a join tree for HH with the edge EiEjE_{i}E_{j}. \square

Proof (Complexity)

Creating a join tree for a given acyclic hypergraph HH can be implemented in 𝒪(N)\mathcal{O}(N) time [27]. Modifying that join tree (thereby computing TT) and computing 𝒮(H)\mathcal{S}(H) using Algorithm 1 can also be done in 𝒪(N)\mathcal{O}(N) time (Lemma 4). Thus, line 2 runs in total 𝒪(N)\mathcal{O}(N) time. Computing the subset graph G𝒮G_{\mathcal{S}} in line 2 requires 𝒪(T𝒜(H))\mathcal{O}\bigl{(}T_{\mathcal{A}}(H)\bigr{)} time. Since the hyperedges of HH form the vertices of GG and since GG is created without edges, line 2 runs in 𝒪(m)\mathcal{O}(m) time.

We show next that a single iteration of the loop starting in line 2 runs in 𝒪(|𝔼1||𝔼2|)\mathcal{O}\bigl{(}|\mathbb{E}_{1}|\cdot|\mathbb{E}_{2}|\bigr{)} time. That is, the runtime for a single iteration is (asymptotically) equivalent to the number of edges of GG created. Note that each iteration creates at least one such edge, namely the edge in TT that SS represents. Additionally, Lemma 3 and Lemma 6 imply that each edge EiEjE_{i}E_{j} is added at most twice to GG. Therefore, line 2 to line 2 run in 𝒪(|G|)\mathcal{O}\bigl{(}|G|\bigr{)} total time.

For a separator S𝒮S\in\mathcal{S}, let 𝕊\mathbb{S} denote the set of separators SS^{\prime} with SSS\subseteq S^{\prime}. Since the subset graph G𝒮G_{\mathcal{S}} is given, one can compute 𝕊\mathbb{S} (line 2) in 𝒪(|𝕊|)\mathcal{O}\bigl{(}|\mathbb{S}|\bigr{)} time by determining all incoming edges of SS in G𝒮G_{\mathcal{S}}. For each S𝕊S^{\prime}\in\mathbb{S}, the algorithm adds, in line 2, exactly one hyperedge into 𝔼\mathbb{E} plus one additional hyperedge for SS. Thus, |𝔼|=|𝕊|+1|\mathbb{E}|=|\mathbb{S}|+1.

One can determine the hyperedges EE and EE^{\prime} that form a separator SS^{\prime}, which one is farther from SS, and on which side of SS they are in TT as follows. When creating SS^{\prime}, add a reference to both hyperedges and include which is the parent and which is the child in TT. Now assume that each SS^{\prime} is also a node of TT adjacent to EE and EE^{\prime}. Root TT in an arbitrary hyperedge, run a pre-order and post-order on TT, and let pre(x)\mathrm{pre}(x) and post(x)\mathrm{post}(x) be the indices of a node xx in that respective order. For two distinct nodes xx and yy of TT (representing either separators or hyperedges), xx is then a descendant of yy if and only if pre(x)>pre(y)\mathrm{pre}(x)>\mathrm{pre}(y) and post(x)<post(y)\mathrm{post}(x)<\mathrm{post}(y). There are four cases when determining which of EE and EE^{\prime} to add into 𝔼\mathbb{E}: if SS and SS^{\prime} represent the same edge of TT, add both hyperedges; if SS^{\prime} is a descendant of SS, add the child-hyperedge; if SS^{\prime} is an ancestor of SS, add the parent-hyperedge; and if SS^{\prime} is neither an ancestor nor a descendant of SS, add the child-hyperedge. Clearly, one side of SS contains all its descendants and the other side all remaining hyperedges and separators. That allows us, after a 𝒪(m)\mathcal{O}(m)-time preprocessing, to determine in constant time on which side of SS a give a hyperedge is. Therefore, line 2 and line 2 run in 𝒪(|𝔼|)\mathcal{O}\bigl{(}|\mathbb{E}|\bigr{)} time.

Line 2 clearly runs in 𝒪(|𝔼1||𝔼2|)\mathcal{O}\bigl{(}|\mathbb{E}_{1}|\cdot|\mathbb{E}_{2}|\bigr{)} time. Recall that |𝕊|+1=|𝔼|=|𝔼1|+|𝔼2||\mathbb{S}|+1=|\mathbb{E}|=|\mathbb{E}_{1}|+|\mathbb{E}_{2}|. Therefore, a single iteration of the loop starting in line 2 also runs in 𝒪(|𝔼1||𝔼2|)\mathcal{O}\bigl{(}|\mathbb{E}_{1}|\cdot|\mathbb{E}_{2}|\bigr{)} time. \square

Recall that there is an algorithm which computes the subset graph for any given hypergraph in 𝒪(N2/logN)\mathcal{O}\bigl{(}N^{2}/\log N\bigr{)} time [26]. Thus, we have the following.

Theorem 3.4

There is an algorithm that computes the union join graph GG of an acyclic hypergraph in 𝒪(N2/logN+|G|)\mathcal{O}\bigl{(}N^{2}/\log N+|G|\bigr{)} time.

The upper bound of at most Θ(N2/log2N)\Theta\bigl{(}N^{2}/\log^{2}N\bigr{)} many edges for any subset graph [26] does not apply to union join graphs. Consider a hypergraph H=(V,)H=(V,\mathcal{E}) with V={u,v1,,vn}V=\{u,v_{1},\ldots,v_{n}\} and ={Ei1in}\mathcal{E}=\{\,E_{i}\mid 1\leq i\leq n\,\} where Ei={u,vi}E_{i}=\{u,v_{i}\}. Note that N=2nN=2n and that each tree with \mathcal{E} as nodes is a valid join tree for HH. Hence, the union join graph of HH is a complete graph with Θ(N2)\Theta\bigl{(}N^{2}\bigr{)} edges.

3.3 Notes on the Sperner Family Problem and its Generalisation

An interesting question that remains is the complexity of solving the Sperner Family problem for acyclic hypergraphs and hypertrees. We first answer this question for hypertrees.

Theorem 3.5

If the SETH is true, then there is no algorithm which solves the Sperner Family problem for a given hypertree in 𝒪(N2ε)\mathcal{O}\big{(}N^{2-\varepsilon}\big{)} time.

Proof

We prove the theorem by making a simple linear-time reduction. Consider a family ={S1,S2,,Sm}\mathcal{F}=\{S_{1},S_{2},\ldots,S_{m}\} of sets. Create a new vertex uu and add it to each set SiS_{i}\in\mathcal{F}. Let SiS^{\prime}_{i} be the resulting set. The family ={S1,S2,,Sm}\mathcal{F}^{\prime}=\{S^{\prime}_{1},S^{\prime}_{2},\ldots,S^{\prime}_{m}\} then forms a hypertree. Clearly, adding uu to each set does not change any subset relations. Therefore, \mathcal{F} contains two distinct sets SiS_{i} and SjS_{j} with SiSjS_{i}\subseteq S_{j} if and only if \mathcal{F}^{\prime} contains two distingt sets SiS^{\prime}_{i} and SjS^{\prime}_{j} with SiSjS^{\prime}_{i}\subseteq S^{\prime}_{j}. \square

For acyclic hypergraphs we have the following result.

Theorem 3.6

There is a linear-time algorithm to solve the Sperner Family problem for acyclic hypergraphs.

Proof

Let HH be an acyclic hypergraph with a join tree TT. We first show that the following are equivalent: (i) HH has two distinct hyperedges EiE_{i} and EjE_{j} with EiEjE_{i}\subseteq E_{j}, and (ii) TT has an edge EEEE^{\prime} with EEE\subseteq E^{\prime}. Clearly, (ii) implies (i). To show that (i) implies (ii), let EiE_{i} and EjE_{j} be two distinct hyperedges of HH with EiEjE_{i}\subseteq E_{j}. It follows from the definition of join trees that EiEkE_{i}\subseteq E_{k} for each hyperedge EkE_{k} on the path from EiE_{i} to EjE_{j} in TT. Therefore, TT contains an edge EiEkE_{i}E_{k} with EiEkE_{i}\subseteq E_{k} and, thus, (i) is equivalent to (ii).

Let EEEE^{\prime} be an edge of TT with EEE\subseteq E^{\prime}, and let S=EES=E\cap E^{\prime} be the separator corresponding to that edge. Note that |S|=|E||S|=|E| in such a case. Hence, it follows that (i) is true if and only if HH admits a separator S=EES=E\cap E^{\prime} such that |S|=|E||S|=|E| or |S|=|E||S|=|E^{\prime}|.

We can now solve the Sperner Family problem for a given acyclic hypergraph HH in linear time as follows. Construct the separator hypergraph for HH (see Algorithm 1). For each separator S=EES=E\cap E^{\prime}, determine if |S|=|E||S|=|E| or |S|=|E||S|=|E^{\prime}|. In that case, return True. Otherwise, if no such separator is found, return False. \square

Theorem 3.2 and Theorem 3.6 together give an interesting observation: Let 𝒞\mathcal{C} he a class of hypergraphs. Existence of an algorithm that solves the Sperner Family Problem for 𝒞\mathcal{C} in truly subquadratic time does not imply that there is such an algorithm to compute a subset graph for hypergraphs in 𝒞\mathcal{C}, even if the resulting graph is sparse.

One can generalise the Sperner Family Problem as follows: How many pairs of distinct sets Si,SjS_{i},S_{j} with SiSjS_{i}\subseteq S_{j} does a given a family \mathcal{F} contain? Let pp be that number. The Sperner Family problem is then equal to the question whether or not p1p\geq 1. Thus, Theorem 3.6 gives linear-time algorithm to determine if p1p\geq 1 for acyclic hypergraphs. The reduction for Lemma 2, however, implies that there is no truly subquadratic-time algorithm that determines if pmp\geq m. What remains an open question is the required runtime to determine if pkp\geq k for any fixed kk with 1<k<m1<k<m.

4 β\beta-Acyclic Hypergraphs

A hypergraph H=(V,)H=(V,\mathcal{E}) is β\beta-acyclic if each subset of \mathcal{E} forms an acyclic hypergraph. They are also known as totally balanced hypergraphs [11]. See [16] for more definitions. In this section, we present an algorithm to compute the subset graph GG of β\beta-acyclic hypergraphs in 𝒪(Nlog(n+m)+|G|)\mathcal{O}\bigl{(}N\log(n+m)+|G|\bigr{)} time. Afterwards, we show that one can use that algorithm together with Algorithm 2 to compute the union join graph in the same amount of time.

4.1 Constructing the Subset Graph

A matrix is binary if its entries are either 0 or 11. The binary matrix [1110]\bigl{[}\begin{smallmatrix}1&1\\ 1&0\end{smallmatrix}\bigr{]} is called Γ\mathrm{\Gamma}. A matrix is Γ\mathrm{\Gamma}-free if it contains no Γ\mathrm{\Gamma} as submatrix. Note that the rows and columns which form a Γ\mathrm{\Gamma} submatrix do not need to be adjacent in the original matrix. One can use a binary n×mn\times m matrix MM to represent a given hypergraph H=(V,)H=(V,\mathcal{E}) as follows. Let each row ii represent a vertex viVv_{i}\in V and each column jj represent a hyperedge EjE_{j}\in\mathcal{E}. An entry Mi,jM_{i,j} is then 11 if and only if viEjv_{i}\in E_{j}. That matrix is called the incidence matrix of HH.

A matrix is doubly lexically ordered if rows and columns are permuted in such a way that rows vectors and columns are both in non-decreasing lexicographic order (rows from left to right and columns from top to bottom). Within a row, priorities of entries are decreasing from right to left, and, within a column, priorities of entries are decreasing from bottom to top. One can compute such an ordering in 𝒪(Nlog(n+m))\mathcal{O}\bigl{(}N\log(n+m)\bigr{)} time [24]. Note that the algorithm in [24] does not compute the actual matrix; it only computes the corresponding ordering of vertices and hyperedges, thereby avoiding a quadratic runtime.

Lemma 7

[4, 11] A hypergraph is β\beta-acyclic if and only if its doubly lexically ordered incidence matrix is Γ\mathrm{\Gamma}-free.

For the remainder of this subsection, assume that we are given a β\beta-acyclic hypergraph H=(V,)H=(V,\mathcal{E}). Let MM be a doubly lexically ordered (hence, Γ\mathrm{\Gamma}-free) incidence matrix for HH. We assume that we know the ordering of vertices and hyperedges in MM, even though we are not given MM itself. For two hyperedges EiE_{i} and EjE_{j} of HH, we say EiEjE_{i}\preceq E_{j} if the column of EiE_{i} is lexicographically smaller than or equal to the column of EjE_{j} with respect to MM. Accordingly, we write EiEjE_{i}\prec E_{j} to exclude equality.

Lemma 8

Let EiE_{i} and EjE_{j} be two hyperedges of HH and let vv be the vertex in EiE_{i} which is earliest in the doubly lexical ordering (i. e., highest in MM). Then, EiEjE_{i}\subseteq E_{j} if and only if EiEjE_{i}\preceq E_{j} and vEjv\in E_{j}.

Proof

We first show that EiEjE_{i}\preceq E_{j} and vEjv\in E_{j} implies EiEjE_{i}\subseteq E_{j}. Clearly, EiEjE_{i}\subseteq E_{j} if Ei=EjE_{i}=E_{j}. Assume now that EiEjE_{i}\nsubseteq E_{j}, i. e., EiE_{i} contains a vertex uEju\notin E_{j}. By definition of vv, uu is lower in MM than vv. EiEjE_{i}\preceq E_{j} and vEjv\in E_{j} then imply that EiE_{i}, EjE_{j}, uu, and vv form a Γ\mathrm{\Gamma} in MM. That contradicts with MM being Γ\mathrm{\Gamma}-free (see Lemma 7). Therefore, EiEjE_{i}\succ E_{j} or vEjv\notin E_{j}.

Clearly, vEjv\notin E_{j} implies EiEjE_{i}\nsubseteq E_{j}. Now assume that EiEjE_{i}\succ E_{j}. Since EiEjE_{i}\neq E_{j}, there is a lowest vertex uu in MM which is in one of these hyperedges but not in both. Recall that MM is ordered lexicographically. Therefore, EiEjE_{i}\succ E_{j} implies that uEiu\in E_{i} (11 in MM) and uEju\notin E_{j} (0 in MM), i. e., EiEjE_{i}\nsubseteq E_{j}. \square

Lemma 8 allows to compute the subset graph GG of a β\beta-acyclic hypergraph as follows. First, find doubly lexicographical ordering of vertices and hyperedges. For each hyperedge EE, determine all hyperedges EE^{\prime} with EEE\preceq E^{\prime} which contain vv as defined in Lemma 8. Then, add the edge (E,E)(E,E^{\prime}) to GG for each such pair EE and EE^{\prime}. Algorithm 3 implements that approach.

1
Input: A β\beta-acyclic hypergraph H=(V,)H=(V,\mathcal{E}).
2
Output: The subset graph GG of HH.
3
4Find doubly lexicographical ordering σ\sigma of vertices and hyperedges (see [24]) and order the adjacency list of (H)\mathcal{I}(H) according to σ\sigma.
5Create a new directed graph G=(,EG)G=(\mathcal{E},E_{G}) with EG=E_{G}=\emptyset.
6foreach EE\in\mathcal{E}  do
7      Let vv be the vertex in EE which is first in σ\sigma.
8      foreach hyperedge EE^{\prime} containing vv with EEE\preceq E^{\prime}  do (\preceq with respect to σ\sigma)
9            Add (E,E)(E,E^{\prime}) to EGE_{G}.
10      
11
Algorithm 3 Computes the subset graph of a given β\beta-acyclic hypergraph.
Theorem 4.1

Algorithm 3 computes the subset graph GG of a given β\beta-acyclic hypergraph in 𝒪(Nlog(n+m)+|G|)\mathcal{O}\bigl{(}N\log(n+m)+|G|\bigr{)} time.

Proof (Correctness)

We show the correctness of Algorithm 3 by showing that GG contains an edge (Ei,Ej)(E_{i},E_{j}) if and only if EiEjE_{i}\subseteq E_{j}. First assume that GG contains an edge (Ei,Ej)(E_{i},E_{j}). Note that Algorithm 3 only adds (Ei,Ej)(E_{i},E_{j}) to GG (line 3) if EiEjE_{i}\preceq E_{j} and vEjv\in E_{j} (line 3). Therefore, due to Lemma 8, GG containing an edge (Ei,Ej)(E_{i},E_{j}) implies EiEjE_{i}\subseteq E_{j}.

Next, assume that HH contains two hyperedges EiE_{i} and EjE_{j} with EiEjE_{i}\subseteq E_{j}. It then follows from Lemma 8 that EiEjE_{i}\preceq E_{j} and vEjv\in E_{j}. Since the algorithm checks all pairs of hyperedges satisfying this condition (line 3 and line 3), it eventually finds EiE_{i} and EjE_{j} and adds (Ei,Ej)(E_{i},E_{j}) as edge to GG (line 3). \square

Proof (Complexity)

One can compute a doubly lexicographical ordering σ\sigma (line 3) in 𝒪(Nlog(n+m))\mathcal{O}\bigl{(}N\log(n+m)\bigr{)} time [24]. Creating the graph GG (line 3) can easily be done in 𝒪(m)\mathcal{O}(m) time.

There are various ways to then order the adjacency list of (H)\mathcal{I}(H) (line 3) in 𝒪(N)\mathcal{O}(N) time. One option is to reconstruct (H)\mathcal{I}(H) as follows. Iterate over all vertices vv of HH as ordered in σ\sigma. For each hyperedge EE containing vv, add vv to the new list of EE. Afterwards, the list of vertices in EE is ordered with respect to σ\sigma. The same approach (with hyperedges and vertices swapped) allows to sort, for each vertex vv, the list of hyperedges containing it.

We now show that the loop starting in line 3 runs is in 𝒪(|G|)\mathcal{O}\bigl{(}|G|\bigr{)} total time. Note that the hyperedges \mathcal{E} form the vertices of GG. Hence, there is exactly one iteration of the loop starting in line 3 for each vertex of GG. Since the adjacency list of (H)\mathcal{I}(H) is ordered according to σ\sigma (line 3), we can determine vv (line 3) in constant time for each hyperedge EE. For the same reason, we can determine the set 𝔼v={EvE,EE}\mathbb{E}_{v}=\{\,E^{\prime}\in\mathcal{E}\mid v\in E^{\prime},E\preceq E^{\prime}\,\} in 𝒪(|𝔼v|)\mathcal{O}\bigl{(}|\mathbb{E}_{v}|\bigr{)} time by iterating backwards over the hyperedges containing vv. Since we add exactly one edge (E,E)(E,E^{\prime}) to GG for each EE^{\prime} in such 𝔼v\mathbb{E}_{v}, line 3 and line 3 run in 𝒪(|G|)\mathcal{O}\bigl{(}|G|\bigr{)} total time. \square

4.2 Constructing the Union Join Graph

We now address how to compute the union join graph for β\beta-acyclic hypergraphs. For that, we do not present a new algorithm. Instead, we show that one can use Algorithm 2 together with Algorithm 3. This is possible due to Lemma 9 below.

Lemma 9

If a hypergraph is β\beta-acyclic, then its separator hypergraph is β\beta-acyclic, too.

Before proving Lemma 9, we need a few auxiliary definitions. Assume we are given a graph G=(V,E)G=(V,E). A clique is a set of vertices of GG such that all these vertices are pairwise adjacent. Such a clique KK is maximal if no vertex in GG is adjacent to all vertices in KK. For a cycle v1,v2,,vk,v1\langle v_{1},v_{2},\ldots,v_{k},v_{1}\rangle, a chord is an edge between two non-consecutive vertices. A graph is called chordal if each cycle with four or more vertices has a chord. A hypergraph HH is conformal if, for each maximal clique KK of 2SecSec(H)\operatorname{2Sec}Sec(H), HH contains a hyperedge EE with KEK\subseteq E.

Proof (Lemma 9)

Let H=(V,)H=(V,\mathcal{E}) be a β\beta-acyclic hypergraph with a join tree TT and let 𝒮\mathcal{S} be the hyperedges of 𝒮(H)\mathcal{S}(H). To prove that 𝒮(H)\mathcal{S}(H) is β\beta-acyclic, we show that each 𝒮𝒮\mathcal{S}^{\prime}\subseteq\mathcal{S} forms an acyclic hypergraph. It is known that a hypergraph HH is acyclic if and only if HH is conformal and 2SecSec(H)\operatorname{2Sec}Sec(H) is chordal [3]. It is therefore sufficient for us to show that each 𝒮\mathcal{S}^{\prime} is conformal and its 2-section graph is chordal.

We start by showing that G2=2SecSec(𝒮)G_{2}=\operatorname{2Sec}Sec\bigl{(}\mathcal{S}^{\prime}\bigr{)} is chordal. Let us assume that G2G_{2} is not chordal. It then contains a chordless cycle C={v1,v2,,vk}C=\{v_{1},v_{2},\ldots,v_{k}\} with k4k\geq 4. Since each edge vivi+1v_{i}v_{i+1} of G2G_{2} implies that its vertices are in a common hyperedge, there is a sequence of separators σ=S1,S2,Sk\sigma=\langle S_{1},S_{2},\ldots S_{k}\rangle that form CC in G2G_{2}. In particular, we have that viSiSi+1v_{i}\in S_{i}\cap S_{i+1} (with index arithmetic modulo kk). Recall that each separator SiS_{i} corresponds to an edge of TT. Let TσT_{\sigma} be the smallest subtree of TT that contains all separators of σ\sigma. Note that viSjv_{i}\notin S_{j} for all j{i,i+1}j\notin\{i,i+1\}; otherwise CC would have a chord. Therefore, by properties of join trees, there is no ii and jj such that SjS_{j} separates SiS_{i} and Si+1S_{i+1} in TT. Hence, each SiS_{i} in σ\sigma corresponds to a leaf EiE_{i} of TσT_{\sigma}. By properties of join trees, EiEj=SiSjE_{i}\cap E_{j}=S_{i}\cap S_{j}. Hence, 2SecSec({E1,E2,,Ek})\operatorname{2Sec}Sec\bigl{(}\{E_{1},E_{2},\ldots,E_{k}\}\bigr{)} is not chordal implying that {E1,E2,,Ek}\{E_{1},E_{2},\ldots,E_{k}\} does not form an acyclic hypergraph. This contradicts with HH being β\beta-acyclic. Therefore, 2SecSec(𝒮)\operatorname{2Sec}Sec\bigl{(}\mathcal{S}^{\prime}\bigr{)} is chordal.

We now show that each 𝒮\mathcal{S}^{\prime} forms a conformal hypergraph. Gilmore’s Theorem [4] states that a hypergraph HH is conformal if and only if, for all its hyperedges E1E_{1}, E2E_{2}, and E3E_{3}, HH contains a hyperedge EE such that (E1E2)(E2E3)(E1E3)E(E_{1}\cap E_{2})\cup(E_{2}\cap E_{3})\cup(E_{1}\cap E_{3})\subseteq E. 𝒮\mathcal{S}^{\prime} is therefore clearly conformal if |𝒮|2|\mathcal{S}^{\prime}|\leq 2. Now let |𝒮|3|\mathcal{S}^{\prime}|\geq 3 and let S1S_{1}, S2S_{2}, and S3S_{3} be three hyperedges in 𝒮\mathcal{S}^{\prime}. We distinguish between two cases. Case 1: S1S_{1}, S2S_{2}, and S3S_{3} are on a path in TT. Without loss of generality, let S2S_{2} be between S1S_{1} and S3S_{3}. Then, by properties of join trees, S1S3S2S_{1}\cap S_{3}\subseteq S_{2}. Case 2: There is a hyperedge EE in HH such that S1S_{1}, S2S_{2}, and S3S_{3} are in different subtrees when removing EE from TT. For all i{1,2,3}i\in\{1,2,3\}, let SiS_{i} represent the edge EiEiE_{i}E^{\prime}_{i} of TT and let EiE^{\prime}_{i} be closer to EE in TT than EiE_{i}. Since HH is β\beta-acyclic, the set {E1,E2,E3}\{E_{1},E_{2},E_{3}\} also forms an acyclic and, hence, conformal hypergraph. Without loss of generality, let E3E_{3} be the hyperedge that satisfies Gilmore’s Theorem for {E1,E2,E3}\{E_{1},E_{2},E_{3}\}, i. e., let E1E2E3E_{1}\cap E_{2}\subseteq E_{3}. Note that, by properties of join trees, EiEj=SiSjE_{i}\cap E_{j}=S_{i}\cap S_{j} for all i,j{1,2,3}i,j\in\{1,2,3\}, and vS3v\in S_{3} if v(E1E2)E3v\in(E_{1}\cup E_{2})\cap E_{3}. Therefore, S1S2S3S_{1}\cap S_{2}\subseteq S_{3}. Overall, it then follows each 𝒮\mathcal{S}^{\prime} forms a conformal hypergraph. \square

Due to Lemma 9, we can conclude this section as follows.

Theorem 4.2

There is an algorithm that computes the union join graph GG of a given β\beta-acyclic hypergraph in 𝒪(Nlog(n+m)+|G|)\mathcal{O}\bigl{(}N\log(n+m)+|G|\bigr{)} time.

Proof

Let HH be the given hypergraph. Because the separator hypergraph 𝒮(H)\mathcal{S}(H) is β\beta-acyclic (Lemma 9), we can use Algorithm 3 to compute its subset graph GG^{\prime} in 𝒪(Nlog(n+m)+|G|)\mathcal{O}\bigl{(}N\log(n+m)+|G^{\prime}|\bigr{)} time. Thus, when using HH and Algorithm 3 as input, Algorithm 2 computes the union join graph GG of HH in 𝒪(Nlog(n+m)+|G|+|G|)\mathcal{O}\bigl{(}N\log(n+m)+|G^{\prime}|+|G|\bigr{)} time. Consider again line 2 to line 2 of Algorithm 2. Note that for each edge (S,S)(S,S^{\prime}) of GG^{\prime}, there is at least one edge added to GG. It follows that |G||G||G^{\prime}|\leq|G| and, therefore, one can compute GG in 𝒪(Nlog(n+m)+|G|)\mathcal{O}\bigl{(}N\log(n+m)+|G|\bigr{)} total time. \square

5 γ\gamma-Acyclic Hypergraphs

In [16], Fagin gives various definitions of γ\gamma-acyclic hypergraphs and presents a polynomial-time recognition algorithm for them. The definition for γ\gamma-acyclic hypergraphs we give below uses a strong relation between these hypergraphs and distance-hereditary graphs. Before that, we give a few auxiliary definitions and an interesting property of distance-hereditary graphs.

Let G=(V,E)G=(V,E) be a connected, undirected, and simple graph without loops or multiple edges. The open and closed neighbourhood of a vertex vVv\in V are respectively defined as N(v)={uuvE}N(v)=\{\,u\mid uv\in E\,\} and N[v]=N(v){v}N[v]=N(v)\cup\{v\}. A vertex vv is pendant if |N(v)|=1\bigl{|}N(v)\bigr{|}=1. Two vertices uu and vv are false twins if N(u)=N(v)N(u)=N(v), and are true twins if N[u]=N[v]N[u]=N[v]. A graph GG is distance-hereditary if every induced subgraph is distance preserving, i. e., the distance between two vertices uu and vv remains the same in every connected induced subgraph of GG that contains uu and vv.

An ordering σ=v1,v2,,vn\sigma=\langle v_{1},v_{2},\ldots,v_{n}\rangle for a graph GG is called a pruning sequence if each viv_{i} with i>1i>1 satisfies one of the following conditions in the subraph of GG induced by {v1,v2,,vi}\{v_{1},v_{2},\ldots,v_{i}\}: (i) viv_{i} is pendant, (ii) viv_{i} is a true twin of some vertex vjv_{j}, or (iii) viv_{i} is a false twin of some vertex vjv_{j}. A graph GG is distance-hereditary if and only if GG admits a pruning sequence [2].

The recognition algorithm in [16] decides whether or not a given hypergraph is γ\gamma-acyclic by determining if the corresponding incidence graph admits a pruning sequence. Additionally, Ausiello et al. [1] show that the incidence graphs of γ\gamma-acyclic hypergraphs are so-called (6, 2)-chordal bipartite graph which are known to be equivalent to bipartite distance-hereditary graphs [10]. Therefore, we can define γ\gamma-acyclic hypergraphs as follows.

Corollary 1

[1, 10][16] A hypergraph is γ\gamma-acyclic if and only if its incidence graph is distance-hereditary.

5.1 Constructing the Union Join Graph

Lemma 10

An acyclic hypergraph is γ\gamma-acyclic if and only if its line graph is isomorphic to its union join graph.

Proof

Let HH be an acyclic hypergraph with two distinct hyperedges EiE_{i} and EjE_{j}, and let GG be the union join graph of HH. Consider the following statements: (i) EiEjE_{i}E_{j} is an edge of L(H)L(H), (ii) EiEjE_{i}\cap E_{j}\neq\emptyset, (iii) EiEjE_{i}\cap E_{j} separates EiEjE_{i}\setminus E_{j} from EjEiE_{j}\setminus E_{i}, and (iv) EiEjE_{i}E_{j} is an edge of GG. Due to definitions and due to Lemma 3, it follows that (i) is equivalent to (ii), that (iii) implies (ii), and that (iii) is equivalent to (iv).

To prove Lemma 10, we first assume that HH is γ\gamma-acyclic. It is know [16] that a hypergraph is γ\gamma-acyclic if and only if (ii) implies (iii) for all distinct hyperedges EiE_{i} and EjE_{j}. Therefore, if HH is γ\gamma-acyclic, the statements (i), (ii), (iii), and (iv) are equivalent and, subsequently, L(H)=GL(H)=G.

Now assume that L(H)=GL(H)=G, i. e., that (i) and (iv) are equivalent for all distinct hyperedges EiE_{i} and EjE_{j}. It then follows that (ii) and (iii) are equivalent and, as a result, that (ii) implies (iii). The same observation from [16] then implies that HH is γ\gamma-acyclic if L(H)=GL(H)=G. \square

Theorem 5.1

There is an algorithm that computes the union join graph GG of a given γ\gamma-acyclic hypergraph in 𝒪(N+|G|)\mathcal{O}\bigl{(}N+|G|\bigr{)} time.

Proof

Due to Lemma 10, we can compute the union join graph GG of a γ\gamma-acyclic hypergraph HH by computing its line graph. Note that, by definition, L(H)=2SecSec(H)L(H)=\operatorname{2Sec}Sec(H^{*}). It follows from Corollary 1 that the dual hypergraph HH^{*} is γ\gamma-acyclic too. Therefore, we can compute G=2SecSec(H)G=\operatorname{2Sec}Sec(H^{*}) as follows.

Let TT be a join tree of HH^{*} rooted in an arbitrary node. Process each hyperedge of HH^{*} according to a pre-order on TT. When processing a hyperedge EE of HH^{*}, pick a vertex vEv\in E that has not been flagged, make vv adjacent (in GG) to all flagged vertices in EE, and then flag vv. Repeat that until all vertices in EE are flagged and afterwards continue with the next hyperedge.

By flagging vertices, we ensure that an edge uvuv is added to GG at most once even if both vertices are together in multiple hyperedges of HH^{*}. Therefore, since we can construct TT in 𝒪(N)\mathcal{O}(N) time [27], we can construct GG from HH in 𝒪(N+|G|)\mathcal{O}\bigl{(}N+|G|\bigr{)} time. \square

5.2 Constructing the Subset Graph

5.2.1 Bachman Diagrams.

Consider a hypergraph H=(V,)H=(V,\mathcal{E}), let \mathcal{E}^{\prime} be a subset of \mathcal{E}, and let 𝔛\mathfrak{X} be the intersection of all hyperedges in \mathcal{E}^{\prime}. We then define 𝒳\mathcal{X} as the set of all such 𝔛\mathfrak{X} which are non-empty, i. e.,

𝒳={𝔛|𝔛=EE,𝔛}.\mathcal{X}=\bigcup_{\mathcal{E}^{\prime}\subseteq\mathcal{E}}\Bigl{\{}\,\mathfrak{X}\Bigm{|}{\textstyle\mathfrak{X}=\bigcap_{E\in\mathcal{E}^{\prime}}E},\mathfrak{X}\neq\emptyset\,\Bigr{\}}.

The Bachman diagram (H)\mathcal{B}(H) of HH is a directed graph with the node set 𝒳\mathcal{X} such that there is an edge from 𝔛\mathfrak{X} to 𝔜\mathfrak{Y} if 𝔛𝔜\mathfrak{X}\supset\mathfrak{Y} and there is no \mathfrak{Z} with 𝔛𝔜\mathfrak{X}\supset\mathfrak{Z}\supset\mathfrak{Y}. Note that, if HH contains two distinct hyperedges EiE_{i} and EjE_{j} with the same vertices, they are represented by the same node in (H)\mathcal{B}(H).

Lemma 11

[16] A hypergraph is γ\gamma-acyclic if and only if its Bachman diagram forms a tree.

In a Bachman diagram (H)\mathcal{B}(H) as defined above, a vertex vv of HH is often contained in multiple nodes. A technique from [28] allows us to construct a more compact representation of (H)\mathcal{B}(H). Let N(𝔛)N(\mathfrak{X}) be the set of nodes 𝔜\mathfrak{Y} such that (𝔛,𝔜)(\mathfrak{X},\mathfrak{Y}) is an edge of (H)\mathcal{B}(H). We then define the label of 𝔛\mathfrak{X} as (𝔛):=𝔛𝔜N(𝔛)𝔜\ell(\mathfrak{X}):=\mathfrak{X}\setminus\bigcup_{\mathfrak{Y}\in N(\mathfrak{X})}\mathfrak{Y}. As a result, a vertex vv of HH is only in the label of the “smallest” node 𝔜\mathfrak{Y} containing it. Consider now a Bachman diagram (H)\mathcal{B}(H) with the node set 𝒳\mathcal{X} where we replace each node 𝔛𝒳\mathfrak{X}\in\mathcal{X} with X=(𝔛)X=\ell(\mathfrak{X}). We call the resulting graph BB a simplified Bachman diagram of HH. Figure 2 gives an example.

a,b,ca,b,ca,da,dc,e,fc,e,fb,cb,caacc
(a)
dde,fe,fbbaacc
(b)
Figure 2: The Bachman diagram LABEL:sub@fig:Bachman and its simplified version LABEL:sub@fig:BachmanSimple for a γ\gamma-acyclic hypergraph HH with the hyperedges {a,b,c}\{a,b,c\}, {a,d}\{a,d\}, {b,c}\{b,c\}, and {c,e,f}\{c,e,f\}. Nodes which represent hyperedges of HH are drawn as rectangles; other nodes are drawn as circles.

Let BB be a simplified Bachman diagram for a hypergraph H=(V,)H=(V,\mathcal{E}). We use the following functions and notations when working with BB and HH. The function ϕ\phi maps \mathcal{E} onto the nodes of BB such that ϕ(E)\phi(E) returns the node which represents EE. Accordingly, we define Φ(X):={E|ϕ(E)=X}\Phi(X):=\bigl{\{}\,E\in\mathcal{E}\bigm{|}\phi(E)=X\,\} for all nodes XX of BB. Similar to ϕ\phi, we define ψ\psi as a function that maps VV onto the nodes of BB such that ψ(v)\psi(v) returns the node which contains vv. For two nodes XX and YY, we write XYX\leadsto Y to state that there is a path form XX to YY in BB. Note that we assume that XXX\leadsto X. Lastly, we define 𝕍(X)={vYXY}\mathbb{V}(X)=\{\,v\in Y\mid X\leadsto Y\,\}. Note that 𝕍\mathbb{V} is effectively the inverse of the label function \ell we used above.

5.2.2 Subset Graph via Simplified Bachman Diagrams.

We can make the following observation: For two hyperedges EiE_{i} and EjE_{j} of HH, EiEjE_{i}\subseteq E_{j} if and only if ϕ(Ej)ϕ(Ei)\phi(E_{j})\leadsto\phi(E_{i}) in the (simplified) Bachman diagram of HH. In the remainder of this subsection, we present algorithms which first constructs a simplified Bachman diagram for a given γ\gamma-acyclic hypergraph HH and then uses the previous observation to compute the subset graph GG of HH in 𝒪(N+|G|)\mathcal{O}\bigl{(}N+|G|\bigr{)} time.

To the best of our knowledge, there exist only two published algorithms which compute (simplified) Bachman diagrams. Kumar et al. [22] present an 𝒪(nm2)\mathcal{O}\bigl{(}nm^{2}\bigr{)}-time algorithm to compute a Bachman diagram for a γ\gamma-acyclic database schema. Uehara and Uno [28] present a linear-time algorithm that computes a simplified Bachman diagram for the maximal cliques of a ptolemaic graph; these cliques form a γ\gamma-acyclic hypergraph [11]. Using that algorithm would require us to first compute the 2-section graph of HH. That may result in overall quadratic runtime for some hypergraphs. We therefore use neither of these algorithms. Instead, we present a new algorithm which computes a simplified Bachman diagram for a given γ\gamma-acyclic hypergraph in 𝒪(N)\mathcal{O}(N) time.

Recall that the incidence graph of a γ\gamma-acyclic hypergraph HH is distance-hereditary. It therefore admits a pruning sequence σ=x1,x2,,xn+m\sigma=\langle x_{1},x_{2},\ldots,x_{n+m}\rangle. Note that each xix_{i} in σ\sigma can represent either a vertex or a hyperedge of HH. The idea for our algorithm is to iterate over σ\sigma and to step by step construct BB. For that, let i\mathcal{I}_{i} denote the subgraph of (H)\mathcal{I}(H) induced by {x1,x2,,xi}\{x_{1},x_{2},\ldots,x_{i}\}.

We start the construction with x1x_{1} and x2x_{2}. Note that one of them has to represent a vertex vv and the other a hyperedge EE of HH. Therefore, we initialise BB with a single node X={v}X=\{v\} and set ϕ(E):=X\phi(E):=X and ψ(v):=X\psi(v):=X.

Next, we iterate over σ\sigma, starting with x3x_{3}. Since incidence graphs are bipartite, it is never the case that xix_{i} is the true twin of some xjx_{j} (with the exception of i=2i=2). Hence, we have four possible cases for each xix_{i}: (i) xix_{i}represents a vertex of HH and is a false twin in i\mathcal{I}_{i}, (ii) xix_{i}represents a hyperedge and is a false twin, (iii) xix_{i}represents a vertex and is pendant, or (iv) xix_{i}represents a hyperedge and is pendant.

If xix_{i} is a twin (cases i and ii), the idea is to make the new vertex or hyperedge behave as its twin. For a vertex vv, that means to add vv into the same node of BB. In case of a hyperedge EE, it is represented by the same node of BB as its twin.

If xix_{i} is pendant, adding it may affect the structure of BB. For example, let xix_{i} represent a vertex vv added to a hyperedge EE (case iii). If, with respect to i1\mathcal{I}_{i-1}, EE is not subset of another hyperedge (including not being a twin), then we can simply add vv into ϕ(E)\phi(E). However, if EE is subset of some hyperedge, it is no longer after adding vv. We subsequently need to update the structure of BB. To do so, we add a new node YY, make it the representative of EE, and add an edge from YY to the node of BB which previously represented EE. We handle case iv in a similar way.

Algorithm 4 implements the approach above and describes in detail how to handle each of the four cases for xix_{i}.

1
Input: A γ\gamma-acyclic hypergraph H=(V,)H=(V,\mathcal{E}).
2
Output: A simplified Bachman diagram BB for HH.
3
4Compute a pruning sequence σ=x1,x2,,xn+m\sigma=\langle x_{1},x_{2},\ldots,x_{n+m}\rangle for (H)\mathcal{I}(H) (see [9]).
5Create a new empty graph BB.
6Let x1x_{1} and x2x_{2} represent the vertex vv and hyperedge EE of HH. Create a new set X={v}X=\{v\}, add it as node to BB, and set ϕ(E):=X\phi(E):=X and ψ(v):=X\psi(v):=X.
7for i:=3i:=3 to n+mn+m  do
8      if xix_{i} represents a vertex vVv\in V and is a false twin in i\mathcal{I}_{i}  then
9            Let uu be the vertex represented by a twin of xix_{i} in i\mathcal{I}_{i} and let X=ψ(u)X=\psi(u).
10            Add vv into XX, i. e., set ψ(v):=X\psi(v):=X and X:=X{v}X:=X\cup\{v\}.
11      
12      
13      if xix_{i} represents a hyperedge EE\in\mathcal{E} and is a false twin in i\mathcal{I}_{i}  then
14            Let EE^{\prime} be the hyperedge represented by a twin of xix_{i} in i\mathcal{I}_{i}.
15            Set ϕ(E):=ϕ(E)\phi(E):=\phi(E^{\prime}).
16      
17      
18      if xix_{i} represents a vertex vVv\in V and is pendant in i\mathcal{I}_{i}  then
19            Let EE be the hyperedge represented by the neighbour of xix_{i} in i\mathcal{I}_{i} and let X=ϕ(E)X=\phi(E).
20            if |Φ(X)|=1\bigl{|}\Phi(X)\bigr{|}=1 and XX has no incoming edges in BB  then
21                  Add vv into XX, i. e., set ψ(v):=X\psi(v):=X and X:=X{v}X:=X\cup\{v\}.
22             else
23                  Create a new set Y={v}Y=\{v\}, add it as node to BB, set ψ(v):=Y\psi(v):=Y and ϕ(E):=Y\phi(E):=Y, and add the edges (Y,X)(Y,X) to BB.
24            
25      
26      
27      if xix_{i} represents a hyperedge EE\in\mathcal{E} and is pendant in i\mathcal{I}_{i}  then
28            Let vv be the vertex represented by the neighbour of xix_{i} in i\mathcal{I}_{i} and let X=ψ(v)X=\psi(v).
29            if |X|=1|X|=1 and XX has no outgoing edges in BB  then
30                  Set ϕ(E):=X\phi(E):=X.
31             else
32                  Create a new set Y={v}Y=\{v\}, add it as node to BB, set X:=X{v}X:=X\setminus\{v\}, set ψ(v):=Y\psi(v):=Y and ϕ(E):=Y\phi(E):=Y, and add the edge (X,Y)(X,Y) to BB.
33            
34      
Algorithm 4 Computes the Bachman diagram for a given γ\gamma-acyclic hypergraph.
Lemma 12

Algorithm 4 computes a simplified Bachman diagram for a given γ\gamma-acyclic hypergraph in linear time.

Proof (Correctness)

We start by showing that BB forms a tree. Algorithm 4 starts constructing BB with a single node (line 4). Whenever the algorithm adds a new node to BB (line 4 and line 4), it is incident to exactly one edge. Additionally, no other edge is ever added to or removed from BB. Therefore, BB forms a tree.

To show that BB is a simplified Bachman diagram for HH, we show that it satisfies the following two properties:

  1. (1)

    For each vertex vv of HH, BB contains exactly one node XX with vXv\in X; additionally, ψ(v)=X\psi(v)=X.

  2. (2)

    There is a bijection ff mapping 𝒳\mathcal{X} onto the nodes of BB such that ((2.)) f(𝔛)=Xf(\mathfrak{X})=Xif and only if 𝔛=𝕍(X)\mathfrak{X}=\mathbb{V}(X), and ((2.)) 𝔛=E\mathfrak{X}=Efor some hyperedge EE implies f(𝔛)=ϕ(E)f(\mathfrak{X})=\phi(E).

Property 2 ensures that the nodes of BB represent the nodes of a Bachman diagram for HH. Property 1 then enforces that the nodes of BB are connected properly. Without it, one could satisfy 2 by constructing a graph B=(𝒳,)B=(\mathcal{X},\emptyset). Additionally, since BB forms a tree, it does not contain transitive edges.

Observe that whenever a new vertex vv is added (lines 4, 4, 4, and 4), Algorithm 4 adds it into a node XX and sets ψ(v)\psi(v) accordingly. In the case that an existing vertex vv is added into a new node YY (line 4), the algorithms removes it from its previous node XX and updates ψ(v)\psi(v) accordingly. Therefore, the graph BB constructed by Algorithm 4 satisfies property 1.

In the remainder of this proof, we show that BB satisfies property 2 via an induction over ii. For that purpose, let HiH_{i} denote the hypergraph formed by i\mathcal{I}_{i} and let BiB_{i} be graph constructed after processing xix_{i}. We also use subscript ii to indicate that we refer to a version of a set, node, hyperedge, or function with respect to BiB_{i} or HiH_{i}; for larger expressions ε\varepsilon, we may write [ε]i[\varepsilon]_{i}.

Since H2H_{2} has only one hyperedge and one vertex, B2B_{2} (constructed in line 4) is clearly a simplified Bachman diagram for H2H_{2} and satisfies property 2. In the following, we therefore assume that i3i\geq 3 and that Bi1B_{i-1} satisfies property 2. We distinguish between four possible cases for xix_{i}.

Case i: xix_{i} represents a vertex vVv\in V and is a false twin in i\mathcal{I}_{i}.

Let uu be the vertex represented by a twin of xix_{i}. Since uu and vv are twins, it follows that vEiv\in E_{i} if and only if uEi1u\in E_{i-1} for each hyperedge EE of HiH_{i} Subsequently, the only change to 𝒳\mathcal{X} is that vv is added to the sets 𝔛\mathfrak{X} which contain uu. That is, for each 𝔛𝒳i\mathfrak{X}\in\mathcal{X}_{i}, 𝔛i=𝔛i1\mathfrak{X}_{i}=\mathfrak{X}_{i-1} if u𝔛i1u\notin\mathfrak{X}_{i-1} and 𝔛i=𝔛i1{u}\mathfrak{X}_{i}=\mathfrak{X}_{i-1}\cup\{u\} if u𝔛i1u\in\mathfrak{X}_{i-1}. Observe that the algorithm neither adds any nodes nor any edges to the graph. It only adds vv into ψ(u)i1\psi(u)_{i-1}. Hence, for each node XX of BiB_{i}, 𝕍(X)i=𝕍(X)i1\mathbb{V}(X)_{i}=\mathbb{V}(X)_{i-1} if u𝕍(X)i1u\notin\mathbb{V}(X)_{i-1} and 𝕍(X)i=𝕍(X)i1{v}\mathbb{V}(X)_{i}=\mathbb{V}(X)_{i-1}\cup\{v\} if u𝕍(X)i1u\in\mathbb{V}(X)_{i-1}. Therefore, BiB_{i} satisfies property 2.

Case ii: xix_{i} represents a hyperedge EE\in\mathcal{E} and is a false twin in i\mathcal{I}_{i}.

Recall that we defined Bachman diagrams and the family 𝒳\mathcal{X} in such a way that 𝒳\mathcal{X} does not contain two equal sets, even if HH contains multiple equal hyperedges. Hence, adding a hyperedge EE which is equivalent to an existing hyperedge EE^{\prime} does neither change 𝒳\mathcal{X} nor any of the sets contained in it. It follows that setting ϕ(E)i=ϕ(E)i1\phi(E)_{i}=\phi(E^{\prime})_{i-1} is the only change needed for BiB_{i} to satisfy property 2 (otherwise BiB_{i} would violate 2(2.)). Algorithm 4 does exactly that in line 4.

Case iii: xix_{i} represents a vertex vVv\in V and is pendant in i\mathcal{I}_{i}.

Let EE be the hyperedge represented by the neighbour of xix_{i} in i\mathcal{I}_{i} (i. e., Ei=Ei1E_{i}=E_{i-1}), and let X=ϕi1(E)X=\phi_{i-1}(E). Assume that, for each hyperedge EE^{\prime} of Hi1H_{i-1} which is distinct from EE, Ei1Ei1E_{i-1}\nsubseteq E^{\prime}_{i-1}. In that case, |Φ(X)|i1=1\bigl{|}\Phi(X)\bigr{|}_{i-1}=1 and XX has incoming edge in Bi1B_{i-1}. (As result, Algorithm 4 calls line 4.) Since vv is only added into EE, 𝒳i\mathcal{X}_{i} is almost identical to 𝒳i1\mathcal{X}_{i-1} except that the set 𝔛\mathfrak{X} which represents EE now contains vv. Because XX has incoming edge in Bi1B_{i-1}, adding vv into it (line 4) does not affect other nodes. In particular, 𝕍(Y)i=𝕍(Y)i1\mathbb{V}(Y)_{i}=\mathbb{V}(Y)_{i-1} for all nodes YY of BiB_{i} which are distinct from XX, and 𝕍(X)i=𝕍(X)i1{v}\mathbb{V}(X)_{i}=\mathbb{V}(X)_{i-1}\cup\{v\}. Therefore, BiB_{i} satisfies property 2.

Assume now that Hi1H_{i-1} contains a hyperedge EE^{\prime} distinct from EE with Ei1Ei1E_{i-1}\subseteq E^{\prime}_{i-1}. In that case, [ϕ(E)X]i1\bigl{[}\phi(E^{\prime})\leadsto X\bigr{]}_{i-1} and, thus, |Φ(X)|i1>1\bigl{|}\Phi(X)\bigr{|}_{i-1}>1 (if ϕ(E)i1=X\phi(E^{\prime})_{i-1}=X) or XX has incoming edge in Bi1B_{i-1}. (As result, Algorithm 4 calls line 4.) Since vv is only added into EE but not EE^{\prime}, EiEiE_{i}\nsubseteq E^{\prime}_{i}. However, for all i\mathcal{E}^{\prime}\subseteq\mathcal{E}_{i} with EE\in\mathcal{E}^{\prime} and ||>1|\mathcal{E}^{\prime}|>1, [EE]i=[EE]i1\Bigl{[}\bigcap_{E\in\mathcal{E}^{\prime}}E\Bigr{]}_{i}=\Bigl{[}\bigcap_{E\in\mathcal{E}^{\prime}}E\Bigr{]}_{i-1}. Therefore, 𝒳i=𝒳i1{𝔜}\mathcal{X}_{i}=\mathcal{X}_{i-1}\cup\{\mathfrak{Y}\} with 𝔜i=Ei\mathfrak{Y}_{i}=E_{i}. For each 𝔛𝒳i1\mathfrak{X}\in\mathcal{X}_{i-1}, let fi(𝔛)=fi1(𝔛)f_{i}(\mathfrak{X})=f_{i-1}(\mathfrak{X}). Additionally, let fi(𝔜)=Yf_{i}(\mathfrak{Y})=Y where Y={v}Y=\{v\} is the node added to BB in line 4. Thus, fif_{i} is a bijection mapping 𝒳i\mathcal{X}_{i} onto the nodes of BiB_{i}. Since the added edge (Y,X)(Y,X) points towards XX, 𝕍(Z)i=𝕍(Z)i1\mathbb{V}(Z)_{i}=\mathbb{V}(Z)_{i-1} for all nodes ZZ of Bi1B_{i-1} and 𝕍(Y)i=𝔜\mathbb{V}(Y)_{i}=\mathfrak{Y}. Hence, BiB_{i} satisfies property 2(2.). Additionally, since the algorithm also sets ϕ(E)i=Y\phi(E)_{i}=Y, BiB_{i} also satisfies property 2(2.).

Case iv: xix_{i} represents a hyperedge EE\in\mathcal{E} and is pendant in i\mathcal{I}_{i}.

Let vv be the vertex represented by the neighbour of xix_{i} in i\mathcal{I}_{i} (i. e., Ei={v}E_{i}=\{v\}), and let X=ψ(v)i1X=\psi(v)_{i-1}. Assume that 𝒳i1\mathcal{X}_{i-1} contains a set 𝔛\mathfrak{X} with 𝔛i1={v}\mathfrak{X}_{i-1}=\{v\}. In that case, adding EE does neither change 𝒳\mathcal{X} nor any of the sets contained in it. Additionally, |Xi|=1|X_{i}|=1 and XX has no outgoing edges in Bi1B_{i-1}. It follows that setting ϕ(E)i=X\phi(E)_{i}=X is the only change needed for BiB_{i} to satisfy property 2 (similar to case ii). Algorithm 4 does exactly that in line 4.

Assume now that, for each set 𝔛𝒳i1\mathfrak{X}\in\mathcal{X}_{i-1}, 𝔛i1{v}\mathfrak{X}_{i-1}\neq\{v\}. In that case, 𝒳i=𝒳i1{𝔜}\mathcal{X}_{i}=\mathcal{X}_{i-1}\cup\{\mathfrak{Y}\} with 𝔜i=Ei={v}\mathfrak{Y}_{i}=E_{i}=\{v\}. Additionally, |Xi|>1|X_{i}|>1 or XX has an outgoing edge in Bi1B_{i-1}. Let fi(𝔛)=fi1(𝔛)f_{i}(\mathfrak{X})=f_{i-1}(\mathfrak{X}) for each 𝔛𝒳i1\mathfrak{X}\in\mathcal{X}_{i-1}, and let fi(𝔜)=Yf_{i}(\mathfrak{Y})=Y where Y={v}Y=\{v\} is the node added to BB in line 4. Thus, fif_{i} is a bijection mapping 𝒳i\mathcal{X}_{i} onto the nodes of BiB_{i}. Note that Algorithm 4 (in line 4) moves vv from node XX into the new node YY. However, since the added edge (X,Y)(X,Y) points towards YY, 𝕍(Z)i=𝕍(Z)i1\mathbb{V}(Z)_{i}=\mathbb{V}(Z)_{i-1} for all nodes ZZ of Bi1B_{i-1} and 𝕍(Y)i=𝔜\mathbb{V}(Y)_{i}=\mathfrak{Y}. Therefore, due to the algorithm setting ϕ(E)i=Y\phi(E)_{i}=Y, BiB_{i} satisfies property 2. \square

Proof (Complexity)

One can compute a pruning sequence for a given distance-hereditary graph in linear time [9] and, thus, for (H)\mathcal{I}(H) (line 4) in 𝒪(N)\mathcal{O}(N) time. Creating BB and adding the first node (lines 4 and 4) can then be done in constant time. For each node XX of BB, we create two lists. One stores the vertices in XX and one the hyperedges in Φ(X)\Phi(X). For the functions ϕ\phi and ψ\psi, we store the node XX they map on and a reference to where the hyperedge or vertex is stored in the corresponding list of XX. That way, we can perform each of the following operations in constant time: adding new nodes and edges into BB (lines 4 and 4), assigning a hyperedge to a node and setting ϕ\phi (lines 4, 4, and 4), changing the assignment of a hyperedge to a different node and updating ϕ\phi (line 4), adding a vertex into a node and setting ψ\psi (lines 4, 4, and 4), and moving a vertex from one node into another and updating ψ\psi (line 4). Therefore, each iteration of the loop starting in line 4 run in constant time and, subsequently, Algorithm 4 run in overall linear time. \square

Lemma 13

Each node XX of BB with Φ(X)=\Phi(X)=\emptyset has an in-degree of at least 22.

Proof

We first assume that XX has in-degree 0. Then, there is no hyperedge EE with ϕ(E)X\phi(E)\leadsto X and, subsequently, no such EE with 𝕍(X)E\mathbb{V}(X)\subseteq E. That contradicts with the definition of Bachman diagrams.

Now assume that XX has at least one incoming edge (Y,X)(Y,X). Let X={E|ϕ(E)X}\mathcal{E}_{X}=\bigl{\{}\,E\bigm{|}\phi(E)\leadsto X\,\bigr{\}} and Y={E|ϕ(E)Y}\mathcal{E}_{Y}=\bigl{\{}\,E\bigm{|}\phi(E)\leadsto Y\,\bigr{\}}. Since EXE=𝕍(X)𝕍(Y)=EY\bigcap_{E\in\mathcal{E}_{X}}E=\mathbb{V}(X)\subset\mathbb{V}(Y)=\bigcap_{E\in\mathcal{E}_{Y}}, there is a hyperedge EXYE\in\mathcal{E}_{X}\setminus\mathcal{E}_{Y} with ϕ(E)X\phi(E)\leadsto X and ϕ(E)↝̸Y\phi(E)\not\leadsto Y. Hence, since ϕ(E)X\phi(E)\neq X, there is a path from ϕ(E)\phi(E) to XX in BB that does not contain YY and, therefore, XX has an in-degree of at least 22. \square

1
Input: A γ\gamma-acyclic hypergraph H=(V,)H=(V,\mathcal{E}).
2
Output: A subset graph GG for HH.
3
4Compute a simplified Bachman diagram BB for HH with the corresponding functions ϕ\phi and Φ\Phi (see Algorithm 4).
5Create a new directed graph G=(,)G=(\mathcal{E},\emptyset).
6foreach EE\in\mathcal{E}  do
7      Let X=ϕ(E)X=\phi(E). Compute 𝔼X=YXΦ(Y)\mathbb{E}_{X}=\bigcup_{Y\leadsto X}\Phi(Y).
8      For each E𝔼XE^{\prime}\in\mathbb{E}_{X} distinct from EE, add the edge (E,E)(E,E^{\prime}) to GG.
Algorithm 5 Computes a subset graph for a given γ\gamma-acyclic hypergraph.
Theorem 5.2

Algorithm 5 computes the subset graph GG of a given γ\gamma-acyclic hypergraph in 𝒪(N+|G|)\mathcal{O}\bigl{(}N+|G|\bigr{)} time.

Proof (Correctness)

Let EE and EE^{\prime} be two distinct hyperedges of HH. By definition of (simplified) Bachman diagrams, BB (computed in line 5) contains two nodes X=ϕ(E)X=\phi(E) and Y=ϕ(E)Y=\phi(E^{\prime}) such that YXY\leadsto X if and only if EEE\subseteq E^{\prime}. Additionally, Algorithm 5 adds the edge (E,E)(E,E^{\prime}) to GG (line 5) if and only if YXY\leadsto X. Therefore, for any distinct hyperedges EE and EE^{\prime} of HH, (E,E)(E,E^{\prime}) is an edge of GG if and only if EEE\subseteq E^{\prime}. \square

Proof (Complexity)

Computing the simplified Bachman diagram BB (line 5) can be done in 𝒪(N)\mathcal{O}(N) time (Lemma 12). Creating the graph GG (line 5) can be done in 𝒪(m)\mathcal{O}(m) time. Additionally, once the sets 𝔼X\mathbb{E}_{X} are known for all XX, we can add the edges of GG (line 5) in 𝒪(|G|)\mathcal{O}\bigl{(}|G|\bigr{)} total time. It remains to show that we can compute the sets 𝔼X\mathbb{E}_{X} in the desired runtime. To do that, we show that we can compute 𝔼X\mathbb{E}_{X} for a given XX in 𝒪(|𝔼X|)\mathcal{O}\bigl{(}|\mathbb{E}_{X}|\bigr{)} time.

Recall that BB is a directed graph which forms a tree (Lemma 11). Hence, the the nodes of BB from which there is a path to XX form a tree TXT_{X} rooted in XX where each edge points from a child to its parent. One can compute TXT_{X} in 𝒪(|TX|)\mathcal{O}\bigl{(}|T_{X}|\bigr{)} time by, for example, reversing the edges of BB and then performing a BFS or DFS starting at XX.

Assume that we partition the nodes of TXT_{X} into two sets 𝕐X\mathbb{Y}_{\!X} and X\mathbb{Z}_{X} where 𝕐X={Y|Φ(Y)}\mathbb{Y}_{\!X}=\bigl{\{}\,Y\bigm{|}\Phi(Y)\neq\emptyset\,\} and X\mathbb{Z}_{X} contains all remaining nodes. It follows from Lemma 13 that each node YY of TXT_{X} with at most one child (including leaves) is in 𝕐X\mathbb{Y}_{\!X}, and each node in X\mathbb{Z}_{X} has at least two children. Now assume that we, step by step, remove each node YY from TXT_{X} which has exactly one child YY^{\prime}, and make YY^{\prime} the child of YY’s parent. Let TXT^{\prime}_{X} be the resulting tree. Each node of TXT^{\prime}_{X} then has at least two children. Thus, at least half of the nodes of TXT^{\prime}_{X} are leaves. Since each leaf is in 𝕐X\mathbb{Y}_{\!X} and TXT^{\prime}_{X} contains all nodes in X\mathbb{Z}_{X}, it follows that |X||𝕐X||\mathbb{Z}_{X}|\leq|\mathbb{Y}_{\!X}| and, subsequently, |TX|Θ(|𝕐X|)|T_{X}|\in\Theta\bigl{(}|\mathbb{Y}_{\!X}|\bigr{)}.

Recall that Φ(Y)\Phi(Y)\neq\emptyset for all Y𝕐XY\in\mathbb{Y}_{\!X} and that each hyperedge of HH is associated with at most one such YY. It follows that |𝕐X||𝔼X||\mathbb{Y}_{\!X}|\leq|\mathbb{E}_{X}|. Therefore, we can compute 𝔼X\mathbb{E}_{X} for a given XX in 𝒪(|𝔼X|)\mathcal{O}\bigl{(}|\mathbb{E}_{X}|\bigr{)} time, and line 5 runs in 𝒪(|G|)\mathcal{O}\bigl{(}|G|\bigr{)} total time. \square

6 Interval Hypergraphs

An acyclic hypergraph H=(V,)H=(V,\mathcal{E}) is an interval hypergraph if it admits a join tree that forms a path. That is, there is an order σ=E1,E2,,Em\sigma=\langle E_{1},E_{2},\ldots,E_{m}\rangle for the hyperedges of HH such that, for each vertex vVv\in V, vEiEjv\in E_{i}\cap E_{j} implies that vEkv\in E_{k} for all kk with ikji\leq k\leq j. Interval hypergraphs are closely related to interval graphs which are a subset of chordal graphs. In particular, a graph is an interval graph if and only if its maximal cliques form an interval hypergraph, and an acyclic hypergraph is an interval hypergraph if and only if its 2-section graph is an interval graph.

Algorithm 9 in [19] allows to recognise interval hypergraphs in linear time. It also produces an order σ\sigma as defined above. Note that the first step of that algorithm is to compute a clique tree TT and a vertex ordering ϕ\phi for a given graph. We replace that step by first computing a join tree TT of the given hypergraph and then perform Algorithm 10 from [19] to compute ϕ\phi.

There are multiple ways to compute the subset graph and union join graph once σ\sigma is known for a given hypergraph HH. One may order the vertices of HH based on the right-most hyperedge containing them (with respect to σ\sigma). Note that we can compute such an ordering in linear time from σ\sigma. Both orders together then form a doubly lexically order and allow to construct a Γ\mathrm{\Gamma}-free matrix for HH. Note that Algorithm 3 and the algorithm described in Theorem 4.2 only have a logarithmic overhead in runtime because they compute a doubly lexically order. If such an order is given, both algorithm run in 𝒪(N+|G|)\mathcal{O}\bigl{(}N+|G|\bigr{)} time.

For an alternative approach, we first determine for each vertex vv the index of the left-most hyperedge containing it (with respect to σ\sigma). Let ϕ(v)\phi(v) be that number, i. e., if EiE_{i} is the left-most hyperedge containing vv, then ϕ(v)=i\phi(v)=i. Next, we compute the separators between consecutive hyperedges (see Algorithm 1). Let SiS_{i} denote the separator between Ei1E_{i-1} and EiE_{i} and let ϕ(Si)=maxvSiϕ(v)\phi(S_{i})=\max_{v\in S_{i}}\phi(v). Then, for each EjE_{j} with j<ij<i, it holds that (i) EjEiE_{j}\supseteq E_{i} if and only if |Ei|=|Si||E_{i}|=|S_{i}| and jϕ(Si)j\geq\phi(S_{i}), and (ii) EiEjE_{i}E_{j} is an edge of the union join graph of HH if and only if jϕ(Si)j\geq\phi(S_{i}). Running the same approach again using the reverse of σ\sigma therefore allows to compute the subset graph and union join graph in 𝒪(N+|G|)\mathcal{O}\bigl{(}N+|G|\bigr{)} time.

Theorem 6.1

There is an algorithm that computes the union join graph and subset graph of a given interval hypergraph in 𝒪(N+|G|)\mathcal{O}\bigl{(}N+|G|\bigr{)} time, respectively, where |G||G| is the size of the computed graph.

Acknowledgements

We would like to thank Feodor F. Dragan and Rachel Walker for stimulating discussions.

References

  • [1] Ausiello, G., D’Atri, A., Moscarini, M.: Chordality properties on graphs and minimal conceptual connections in semantic data models. Journal of Computer and System Sciences 33 (2), 179–202, 1986.
  • [2] Bandelt, H.-J., Mulder, H.M., Distance-hereditary graphs. Journal of Combinatorial Theory, Series B 41, 182–208, 1986.
  • [3] Beeri, C., Fagin, R., Maier, D., Yannakakis, M.: On the Desirability of Acyclic Database Schemes. In: Journal of the ACM 30, 479–513, 1983.
  • [4] Berge, C.: Hypergraphs: Combinatorics of Finite Sets. Elsevier Publishing Co., North-Holland, 1989.
  • [5] Berry, A., Simonet, G.: Computing the atom graph of a graph and the union join graph of a hypergraph. CoRR abs/1607.02911, 2016.
  • [6] Borassi, M., Crescenzi, P., Habib, M.: Into the Square: On the Complexity of Some Quadratic-time Solvable Problems. Electronic Notes in Theoretical Computer Science 322, 51–67, 2016.
  • [7] Brandstädt, A., Dragan, F.F.: Tree-Structured Graphs. In Thulasiraman, K., Arumugam, S., Brandstädt, A., Nishizeki, T. (Eds.): Handbook of Graph Theory, Combinatorial Optimization, and Algorithms, 751–826, CRC Press, 2015.
  • [8] Brandstädt, A., Dragan, F.F., Chepoi, V., Voloshin, V.I.: Dually Chordal Graphs. SIAM Journal on Discrete Mathematics 11 (3), 437–455, 1998.
  • [9] Damiand, G., Habib, M., Paul, C., A simple paradigm for graph recognition: application to cographs and distance hereditary graphs. Theoretical Computer Science 263 (1-2), 99–111, 2001.
  • [10] D’Atri, A., Moscarini, M.: Distance-hereditary graphs, Steiner trees, and connected domination. SIAM Journal of Computing 17 (3), 521–538, 1988.
  • [11] D’Atri, A., Moscarini, M.: On hypergraph acyclicity and graph chordality. Information Processing Letters 29, 271–274, 1988.
  • [12] Dourisboure, Y.: Compact Routing Schemes for Generalised Chordal Graphs. Journal of Graph Algorithms and Applications 9 (2), 277–297, 2005.
  • [13] Dourisboure, Y., Dragan, F.F., Gavoille, C., Yan, C.: Spanners for bounded tree-length graphs. Theoretical Computer Science 383 (1), 34–44, 2007.
  • [14] Dragan, F.F., Köhler, E.: An Approximation Algorithm for the Tree t-Spanner Problem on Unweighted Graphs via Generalized Chordal Graphs. Algorithmica 69 (4), 884–905, 2014.
  • [15] Elmasry, A.: Computing the subset partial order for dense families of sets. Information Processing Letters 109, 1082–1086, 2009.
  • [16] Fagin, R.: Degrees of Acyclicity for hypergraphs and relational database schemes. Journal of the ACM 30, 514–550, 1983.
  • [17] Galinier, P., Habib, M., Paul, C.: Chordal Graphs and Their Clique Graphs. WG 1995, Lecture Notes in Computer Science 1017, 358–371, 1995.
  • [18] Gavril, F.: The intersection graphs of subtrees in trees are exactly the chordal graphs. Journal of Combinatorial Theory, Series B 16 (1), 47–56, 1974.
  • [19] Habib, M., McConnell, R., Paul, C., Viennot, L.: Lex-BFS and partition refinement, with applications to transitive orientation, interval graph recognition and consecutive ones testing. Theoretical Computer Science 234 (1–2), 59–84, 2000.
  • [20] Habib, M., Stacho, J.: Reduced clique graphs of chordal graphs. European Journal of Combinatorics 33 (5), 712–735, 2012.
  • [21] Kaba, B., Pinet, N., Lelandais, G., and Berry, B.: Clustering gene expression data using graph separators. In Silico Biology 7 (0031), 2007.
  • [22] Kumar, T.V.V., Shridhar, A., Ghoshal, A.: Computing full disjunction using COJO. Information Technology and Management 10 (1), 3–20, 2009.
  • [23] Leimer, H.-G.: Optimal decomposition by clique separators. Discrete Mathematics 113 (1–3), 99–123, 1993.
  • [24] Paige, R., Tarjan, R.E.: Three Partition Refinement Algorithms. SIAM Journal of Computing 16 (6), 973–989, 1987.
  • [25] Pritchard, p.: Opportunistic algorithms for eliminating supersets. ActaInformatica 28, 733–754, 1991.
  • [26] Pritchard, P.: On Computing the Subset Graph of a Collection of Sets. Journal of Algorithms 33 (2), 187–203, 1999.
  • [27] Tarjan, R.E., Yannakakis, M.: Simple Linear-Time Algorithms to Test Chordality of Graphs, Test Acyclicity of Hypergraphs, and Selectively Reduce Acyclic Hypergraphs. SIAM Journal of Computing 13 (3), 566–579, 1984.
  • [28] Uehara, R., Uno, Y.: Laminar structure of ptolemaic graphs with applications. Discrete Applied Mathematics 157, 1533–1543, 2009.