Algorithm Search⌘K

Definitioncore

Acyclic hypergraph

Also called alpha-acyclic hypergraph, acyclic database schema.

A hypergraph whose edges can be arranged in a tree so that the edges that contain any vertex form a connected subtree.

An acyclic hypergraph is a hypergraph whose edges can be placed at the nodes of a tree so that, for each vertex, the edges that contain it form a connected part of the tree. Such a tree is a join tree. In databases the vertices are attributes or query variables and the edges are relation schemes or query atoms. Beeri, Fagin, Maier and Yannakakis (1983) showed that many good properties of a database schema are each equivalent to this one condition, and acyclic conjunctive queries can be evaluated in polynomial time by the Yannakakis algorithm. The GYO reduction tests the condition. The usual name in the theory is alpha-acyclic, since Fagin (1983) also defined the stronger beta, gamma and Berge forms.

Definition

A hypergraph H=(V,E)H = (V, E) has a finite set VV of vertices and a finite list E=(e1,…,em)E = (e_1, \ldots, e_m) of edges, each a subset of VV.

Definition (Beeri, Fagin, Maier and Yannakakis 1983). A join tree of HH is a tree TT on the nodes 1,…,m1, \ldots, m such that for each vertex x∈Vx \in V the set {i:x∈ei}\{ i : x \in e_i \} induces a connected subtree of TT. This is the running intersection property. HH is alpha-acyclic, or simply acyclic, if it has a join tree. A hypergraph with no edges is acyclic.

An equal way to state the running intersection property: for any two nodes ii and jj of TT, the set ei∩eje_i \cap e_j is contained in every edge on the path from ii to jj.

Equivalent conditions (Beeri, Fagin, Maier and Yannakakis 1983). For a hypergraph HH the following are equivalent, among others:

  1. HH has a join tree.
  2. The GYO reduction, which deletes vertices that are in one edge only and edges that are inside other edges, ends with at most one edge.
  3. HH is conformal and chordal. The primal graph of HH has the vertices of HH and an edge between two vertices that share an edge of HH. HH is chordal if the primal graph is a chordal graph, and conformal if each clique of the primal graph lies inside one edge of HH.
  4. HH has a full reducer: one program of semijoins that, on every database over the schema HH, deletes exactly the tuples that take part in no tuple of the full join.
  5. Each database over HH whose relations are pairwise consistent, so that each two relations agree on their common attributes, is globally consistent: each relation is the projection of the full join.

Tarjan and Yannakakis (1984) test acyclicity in linear time in the total size of the edges, with maximum cardinality search.

Degrees of acyclicity (Fagin 1983). Each degree below implies the next one, and none of the implications can be reversed.

  • Berge-acyclic: the bipartite incidence graph, with one node per vertex and one per edge, has no cycle. In particular, two edges share at most one vertex.
  • Gamma-acyclic: HH has no gamma-cycle, a kind of cycle that Fagin defined with a few extra conditions on the shared vertices.
  • Beta-acyclic: every set of edges of HH forms an alpha-acyclic hypergraph.
  • Alpha-acyclic: as above.

Examples and non-examples

  • A path. The edges ABAB, BCBC, CDCD form a join tree AB−BC−CDAB - BC - CD. The hypergraph is Berge-acyclic.
  • A star. The edges ABAB, ACAC, ADAD form a join tree with ABAB in the middle, or any other edge in the middle, since all of them share only AA.
  • A chain of relations with wider overlaps. The edges ABCABC, BCDBCD, CDECDE form the join tree ABC−BCD−CDEABC - BCD - CDE. Vertex CC is in all three, and the path is connected. The hypergraph is alpha-acyclic and beta-acyclic, but not Berge-acyclic, because ABCABC and BCDBCD share two vertices.
  • Non-example: the triangle. The edges ABAB, BCBC, CACA have no join tree. In any tree on the three nodes, one node, say ABAB, lies between the other two, and then CC, which is in BCBC and CACA, must be in ABAB. In condition 3, the primal graph is a triangle, a chordal graph, but the clique ABCABC is in no edge, so HH is not conformal.
  • Adding an edge can make a hypergraph acyclic. The edges ABAB, BCBC, CACA, ABCABC have the join tree with ABCABC in the middle and the other three edges as leaves. So the hypergraph is alpha-acyclic. It is not beta-acyclic, because the subset ABAB, BCBC, CACA is the triangle. Removing an edge from an alpha-acyclic hypergraph can make it cyclic.
  • Non-example: a cycle of four edges with a chord. The edges ABAB, BCBC, CDCD, DADA, ACAC are cyclic. The primal graph is chordal, but the clique ABCABC is in no edge. With the two edges ABCABC and ACDACD added, the hypergraph becomes acyclic.
  • Queries. Q(x,z): ⁣−R(x,y),S(y,z)Q(x, z) \mathbin{:\!-} R(x, y), S(y, z) is an acyclic query. The triangle query Q(): ⁣−R(x,y),S(y,z),T(z,x)Q() \mathbin{:\!-} R(x, y), S(y, z), T(z, x) is not.
  • Join tree and GYO. The GYO reduction builds a join tree when one exists. The order in which it deletes edges is a bottom-up order of the tree.
  • Yannakakis algorithm. For an acyclic conjunctive query, the Yannakakis algorithm runs semijoins along a join tree and then joins, in time polynomial in the input plus the output. See also acyclic join evaluation.
  • Hypertree width. Acyclic hypergraphs are exactly the hypergraphs of hypertree width 1 (Gottlob, Leone and Scarcello 2002). Hypertree width and fractional hypertree width measure how far a hypergraph is from acyclic.
  • Chordal graphs and junction trees. A graph is chordal if and only if the hypergraph of its maximal cliques is acyclic, and a join tree of that hypergraph is a clique tree, the junction tree of probabilistic inference.
  • Tree-structured CSPs. A constraint satisfaction problem whose constraint hypergraph is acyclic is solved by the same semijoin passes, which are directional arc consistency on the join tree.

References

  1. Catriel Beeri, Ronald Fagin, David Maier and Mihalis Yannakakis, On the desirability of acyclic database schemes, Journal of the ACM 30(3), 479 to 513 (1983), the equivalence of join trees, the Graham reduction, conformal and chordal hypergraphs, full reducers, and global consistency from pairwise consistency
  2. Ronald Fagin, Degrees of acyclicity for hypergraphs and relational database schemes, Journal of the ACM 30(3), 514 to 550 (1983), alpha, beta, gamma and Berge acyclicity and the strict chain between them
  3. Robert E. Tarjan and Mihalis Yannakakis, Simple linear-time algorithms to test chordality of graphs, test acyclicity of hypergraphs, and selectively reduce acyclic hypergraphs, SIAM Journal on Computing 13(3), 566 to 579 (1984), the linear-time test for alpha-acyclicity
  4. Georg Gottlob, Nicola Leone and Francesco Scarcello, Hypertree decompositions and tractable queries, Journal of Computer and System Sciences 64(3), 579 to 627 (2002), a hypergraph is acyclic if and only if its hypertree width is 1
  5. Serge Abiteboul, Richard Hull and Victor Vianu, Foundations of Databases, Addison-Wesley (1995), Chapter 6 (static analysis and optimization), the section on acyclic joins

Where this leads

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/12B9JK/text.yaml