Query minimisation is a classical problem in database theory and the width of a formula, defined as the maximum number of free variables over all subformulae, is a central measure for query evaluation. We study width minimisation for a subclass of quantified conjunctive queries (QCQs), namely self-join-free QCQs. For this subclass, we show that rewriting optimality coincides with semantic optimality: given a query $φ$, the minimum-width query obtainable from $φ$ by applying natural and established rewriting rules has minimum width among all first-order formulae logically equivalent to $φ$. As a consequence, the width of a self-join-free QCQ can be optimised by a logical-equivalence-preserving rewriting algorithm.
Panagiotis Aivasiliotis, Hubie Chen, Andreas Göbel, Matthias Lanzinger, Marc Roth, Markus Schneider
原文摘要
The Weisfeiler--Leman (WL) algorithm is one of the most influential heuristics for the graph isomorphism problem. The expressive power of WL has been extensively studied in the contexts of descriptive complexity, logics, graph neural networks, and the theory of homomorphism indistinguishabily. Notably, two graphs are indistinguishable by the $k$-dimensional WL algorithm if and only if they are indistinguishable by homomorphism-counts from graphs of treewidth at most $k$. An intrinsic question is to find a natural version of the WL algorithm for relational structures of higher arity admitting an equivalent characterisation via homomorphism indistinguishability along bounded generalised hypertree width (GHW). Scheidt and Schweikardt solved this for $k=1$ by defining the RCR algorithm and showing indistinguishability from $α$-acyclic structures. In this work, we resolve this for all $k\ge1$: we develop a $k$-dimensional version of RCR ($k$-RCR for short) and show that two structures $\mathcal A$ and $\mathcal B$ are indistinguishable by $k$-RCR if and only if they have the same number of homomorphisms from all structures $\mathcal C$ of generalised hypertreewidth at most $k$. Furthermore, we show that on a structure $\mathcal A$ over a fixed signature, with $\mathsf{ghw}(\mathcal{A})\leq k$, $k$-RCR runs in $O(\|\mathcal A\|^k\cdot\log(\|\mathcal A\|))$, where $\|\mathcal A\|$ is the number of all tuples that appear in the relations of $\mathcal A$.