Algorithm Search⌘K

Definitionadvanced

Hypertree width

Also called generalized hypertree width.

A width measure of the hypergraph of a query; conjunctive queries of bounded hypertree width can be evaluated in polynomial time.

Hypertree width measures how far a hypergraph is from being acyclic. It is defined by a hypertree decomposition, a tree decomposition whose bags are each covered by a few edges of the hypergraph, and the width is the largest number of covering edges at one node. Gottlob, Leone and Scarcello (2002) defined it. The acyclic hypergraphs are exactly those of hypertree width 1. For each fixed kk, one can decide in polynomial time whether the width is at most kk and find a decomposition, and a conjunctive query whose hypergraph has width at most kk can be evaluated in polynomial time. Generalized hypertree width drops one condition of the definition. It can only be smaller, but deciding it is NP-complete already for width 2.

Definition

Let H=(V,E)H = (V, E) be a hypergraph. For a set λ⊆E\lambda \subseteq E of edges write ⋃λ\bigcup \lambda for the set of vertices of its edges.

Definition (Gottlob, Leone and Scarcello 2002). A hypertree decomposition of HH is a triple (T,χ,λ)(T, \chi, \lambda), where TT is a rooted tree and each node pp of TT has a bag χ(p)⊆V\chi(p) \subseteq V and a set of edges λ(p)⊆E\lambda(p) \subseteq E, such that:

  1. for each edge e∈Ee \in E there is a node pp with e⊆χ(p)e \subseteq \chi(p);
  2. for each vertex v∈Vv \in V the set {p:v∈χ(p)}\{ p : v \in \chi(p) \} induces a connected subtree of TT;
  3. for each node pp, χ(p)⊆⋃λ(p)\chi(p) \subseteq \bigcup \lambda(p);
  4. for each node pp, ⋃λ(p)∩χ(Tp)⊆χ(p)\bigcup \lambda(p) \cap \chi(T_p) \subseteq \chi(p), where χ(Tp)\chi(T_p) is the union of the bags in the subtree of TT rooted at pp.

Conditions 1 and 2 say that (T,χ)(T, \chi) is a tree decomposition of HH. Condition 3 says that the edges of λ(p)\lambda(p) cover the bag. Condition 4 is the special condition: a vertex of a covering edge that is left out of the bag must not come back lower in the tree. The width of the decomposition is max⁡p∣λ(p)∣\max_p |\lambda(p)|. The hypertree width hw(H)\mathrm{hw}(H) is the smallest width of a hypertree decomposition of HH.

Generalized hypertree width. A generalized hypertree decomposition has to meet only conditions 1, 2 and 3. Its smallest width is the generalized hypertree width ghw(H)\mathrm{ghw}(H). It is a different measure, so the alias on this page names a close relative, not the same number. Each hypertree decomposition is a generalized one, so ghw(H)≤hw(H)\mathrm{ghw}(H) \le \mathrm{hw}(H). Adler, Gottlob and Grohe (2007) showed that hypertree width agrees, up to a constant factor, with several other hypergraph invariants.

Facts.

  • Width 1 (theorem). hw(H)=1\mathrm{hw}(H) = 1 if and only if HH is acyclic and has at least one edge (Gottlob, Leone and Scarcello). A join tree, with χ(p)=ep\chi(p) = e_p and λ(p)={ep}\lambda(p) = \{e_p\}, is a hypertree decomposition of width 1.
  • Recognition (theorem). For each fixed kk, deciding hw(H)≤k\mathrm{hw}(H) \le k and computing a decomposition of width at most kk takes polynomial time. The problem is in the class LOGCFL (Gottlob, Leone and Scarcello).
  • Generalized width is hard (theorem). Deciding ghw(H)≤3\mathrm{ghw}(H) \le 3 is NP-complete (Gottlob, Miklos and Schwentick 2009), and so is deciding ghw(H)≤2\mathrm{ghw}(H) \le 2 (Fischl, Gottlob and Pichler 2018). So without the special condition the test for a fixed small width is already NP-hard.
  • Evaluation (theorem). Let QQ be a conjunctive query whose hypergraph has a hypertree decomposition of width kk, and let each relation of the database have at most NN tuples. At each node pp, join the at most kk relations of λ(p)\lambda(p) and project on χ(p)\chi(p), which gives at most NkN^k tuples. The new relations form an acyclic query along TT, and the Yannakakis algorithm finishes. The time is polynomial in NkN^k, the size of the query and the size of the output. This is combined complexity, and the same holds for generalized decompositions once one is given.

Examples and non-examples

  • Acyclic hypergraphs. The path ABAB, BCBC, CDCD has width 1, from its join tree.
  • The triangle. The edges e1=ABe_1 = AB, e2=BCe_2 = BC, e3=CAe_3 = CA are cyclic, so the width is at least 2. One node with χ={A,B,C}\chi = \{A, B, C\} and λ={e1,e2}\lambda = \{e_1, e_2\} is a hypertree decomposition of width 2. So hw=2\mathrm{hw} = 2.
  • Cycles. Let CnC_n, for n≥3n \ge 3, have the vertices v1,…,vnv_1, \ldots, v_n and the edges ei={vi,vi+1}e_i = \{v_i, v_{i+1}\}, with vn+1=v1v_{n+1} = v_1. Take a path of nodes p2,…,pn−1p_2, \ldots, p_{n-1}, with
    χ(pi)={v1,vi,vi+1},λ(pi)={ei,en},\chi(p_i) = \{v_1, v_i, v_{i+1}\}, \qquad \lambda(p_i) = \{e_i, e_n\},
    rooted at pn−1p_{n-1}. Each edge lies in a bag: e1e_1 in χ(p2)\chi(p_2), eie_i in χ(pi)\chi(p_i), and en={vn,v1}e_n = \{v_n, v_1\} in χ(pn−1)\chi(p_{n-1}). Vertex v1v_1 is in all bags, and viv_i is in χ(pi−1)\chi(p_{i-1}) and χ(pi)\chi(p_i) only. The covering edges add only vnv_n outside the bag, and vnv_n is only in the root bag, so condition 4 holds. So hw(Cn)=2\mathrm{hw}(C_n) = 2 for every nn, while the cycle is not acyclic.
  • One big edge. A hypergraph with the single edge VV has width 1 for every size of VV. Its primal graph is a complete graph, of treewidth ∣V∣−1|V| - 1. So hypertree width can be much smaller than treewidth.
  • Treewidth bounds generalized width. If every vertex is in some edge, then ghw(H)≤tw(H)+1\mathrm{ghw}(H) \le \mathrm{tw}(H) + 1, where tw\mathrm{tw} is the treewidth of the primal graph. Take a tree decomposition of the primal graph with bags of at most tw+1\mathrm{tw} + 1 vertices, and cover each vertex of a bag by one edge that contains it. Each edge of HH is a clique of the primal graph, so some bag contains it.
  • Unbounded width: grids. For a graph, read as a hypergraph with binary edges, each edge covers 2 vertices, so a bag of bb vertices needs at least b/2b / 2 edges. Hence ghw≥(tw+1)/2\mathrm{ghw} \ge (\mathrm{tw} + 1) / 2, and an n×nn \times n grid, of treewidth nn, has unbounded width as nn grows.
  • Fractional hypertree width. Replace the number of covering edges by the weight of a fractional edge cover of the bag. This gives fractional hypertree width, which is at most the generalized hypertree width and can be much smaller.
  • Treewidth. For graphs, read as hypergraphs with binary edges, the bounds above give (tw+1)/2≤ghw≤tw+1(\mathrm{tw} + 1) / 2 \le \mathrm{ghw} \le \mathrm{tw} + 1, so treewidth and generalized hypertree width are within a factor of 2 of each other. For hypergraphs with large edges they can be far apart, as the single edge shows.
  • Acyclicity and GYO. Width 1 is acyclicity, tested by the GYO reduction.
  • Constraint satisfaction. A constraint satisfaction problem whose constraint hypergraph has bounded hypertree width is solvable in polynomial time by the same method as query evaluation.

References

  1. Georg Gottlob, Nicola Leone and Francesco Scarcello, Hypertree decompositions and tractable queries, Journal of Computer and System Sciences 64(3), 579 to 627 (2002), the definition of hypertree decompositions and hypertree width, width 1 for exactly the acyclic hypergraphs, and the polynomial test and evaluation for fixed width
  2. Georg Gottlob, Zoltan Miklos and Thomas Schwentick, Generalized hypertree decompositions, NP-hardness and tractable variants, Journal of the ACM 56(6), article 30 (2009), deciding whether the generalized hypertree width is at most 3 is NP-complete
  3. Wolfgang Fischl, Georg Gottlob and Reinhard Pichler, General and fractional hypertree decompositions, hard and easy cases, Proceedings of the 37th ACM Symposium on Principles of Database Systems (PODS), 17 to 32 (2018), deciding whether the generalized hypertree width is at most 2 is NP-complete
  4. Isolde Adler, Georg Gottlob and Martin Grohe, Hypertree width and related hypergraph invariants, European Journal of Combinatorics 28(8), 2167 to 2181 (2007), hypertree width is equal, up to a constant factor, to several other hypergraph invariants

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/6RYT0Z/text.yaml