Table of Contents
Fetching ...

Minimally Factorizing the Provenance of Self-join Free Conjunctive Queries

Neha Makhija, Wolfgang Gatterbauer

TL;DR

This work studies minFACT, the problem of finding minimal-size factorizations of provenance for self-join-free conjunctive queries, and proves the general decision version is NP-C while identifying substantial PTIME subclasses. It develops two unified algorithms—a 0-1 ILP encoding and a Max-Flow Min-Cut approach—that solve all known PTIME cases exactly and provide exact or approximate solutions for NP-C cases, respectively, by leveraging Variable Elimination Orders, VEO Factorization Forests, and Run-Prefix orderings. A linear programming relaxation with a rounding scheme yields a PTIME 1-to-|mveo|-approximation, and the LP solution often matches the ILP optimum in PTIME cases, enabling practicalExact and approximate inference across a broad spectrum of instances. The framework exposes deep connections to read-once factorizations, hierarchical dissociations, and resilience, yielding a robust toolkit for provenance minimization that can recover known tractable cases, handle NP-C instances exactly or approximately, and conjecture a broader PTIME regime for linear queries with potential practical impact on probabilistic inference and factorized representations.

Abstract

We consider the problem of finding the minimal-size factorization of the provenance of self-join-free conjunctive queries, i.e., we want to find a formula that minimizes the number of variable repetitions. This problem is equivalent to solving the fundamental Boolean formula factorization problem for the restricted setting of the provenance formulas of self-join free queries. While general Boolean formula minimization is $Σ^p_2$-complete, we show that the problem is NP-C in our case. Additionally, we identify a large category of queries that can be solved in PTIME, expanding beyond the previously known tractable cases of read-once formulas and hierarchical queries. We describe connections between factorizations, Variable Elimination Orders (VEOs), and minimal query plans. We leverage these insights to create an Integer Linear Program (ILP) that can solve the minimal factorization problem exactly. We also propose a Max-Flow Min-Cut (MFMC) based algorithm that gives an efficient approximate solution. Importantly, we show that both the Linear Programming (LP) relaxation of our ILP, and our MFMC-based algorithm are always correct for all currently known PTIME cases. Thus, we present two unified algorithms (ILP and MFMC) that can both recover all known PTIME cases in PTIME, yet also solve NP-complete cases either exactly (ILP) or approximately (MFMC), as desired.

Minimally Factorizing the Provenance of Self-join Free Conjunctive Queries

TL;DR

This work studies minFACT, the problem of finding minimal-size factorizations of provenance for self-join-free conjunctive queries, and proves the general decision version is NP-C while identifying substantial PTIME subclasses. It develops two unified algorithms—a 0-1 ILP encoding and a Max-Flow Min-Cut approach—that solve all known PTIME cases exactly and provide exact or approximate solutions for NP-C cases, respectively, by leveraging Variable Elimination Orders, VEO Factorization Forests, and Run-Prefix orderings. A linear programming relaxation with a rounding scheme yields a PTIME 1-to-|mveo|-approximation, and the LP solution often matches the ILP optimum in PTIME cases, enabling practicalExact and approximate inference across a broad spectrum of instances. The framework exposes deep connections to read-once factorizations, hierarchical dissociations, and resilience, yielding a robust toolkit for provenance minimization that can recover known tractable cases, handle NP-C instances exactly or approximately, and conjecture a broader PTIME regime for linear queries with potential practical impact on probabilistic inference and factorized representations.

Abstract

We consider the problem of finding the minimal-size factorization of the provenance of self-join-free conjunctive queries, i.e., we want to find a formula that minimizes the number of variable repetitions. This problem is equivalent to solving the fundamental Boolean formula factorization problem for the restricted setting of the provenance formulas of self-join free queries. While general Boolean formula minimization is -complete, we show that the problem is NP-C in our case. Additionally, we identify a large category of queries that can be solved in PTIME, expanding beyond the previously known tractable cases of read-once formulas and hierarchical queries. We describe connections between factorizations, Variable Elimination Orders (VEOs), and minimal query plans. We leverage these insights to create an Integer Linear Program (ILP) that can solve the minimal factorization problem exactly. We also propose a Max-Flow Min-Cut (MFMC) based algorithm that gives an efficient approximate solution. Importantly, we show that both the Linear Programming (LP) relaxation of our ILP, and our MFMC-based algorithm are always correct for all currently known PTIME cases. Thus, we present two unified algorithms (ILP and MFMC) that can both recover all known PTIME cases in PTIME, yet also solve NP-complete cases either exactly (ILP) or approximately (MFMC), as desired.

Paper Structure

This paper contains 61 sections, 34 theorems, 24 equations, 32 figures, 3 tables, 3 algorithms.

Key Result

theorem 1

There exist transformations from $\texttt{FT}$s to $\texttt{VEOFF}$s and back such that the transformations can recover the original $\texttt{FT}$ for at least one minimal size $\texttt{FT}$$\varphi'$ of any provenance formula $\varphi_p$.

Figures (32)

  • Figure 1: This paper gives hardness results, identifies $\textup{PTIME}\xspace$ cases, and gives exact and approximate algorithms for self-join-free conjunctive queries. We prove that the tractable queries for $\mathtt{minFACT}$ reside firmly between the tractable cases for probabilistic query evaluation ($\mathtt{PROB}$) = the hierarchical queries with one minimal query plan, and those for resilience ($\mathtt{RES}$) = queries without active triads. The open cases are linear queries with $\geq 3$ minimal query plans (though we know that $Q_{4}^\infty$ is in $\textup{PTIME}\xspace$), and linearizable queries with deactivated triads and without co-deactivated triads (though we know that the triangle unary query $Q^\triangle_U$ is in $\textup{PTIME}\xspace$).
  • Figure 2: \ref{['ex:prov', 'ex:fact']}: (a): Database instance with provenance tokens to the left of each tuple, e.g. $s_{12}$ for $S(1,2)$. (b): $\textup{Prov}(Q_{2}^\star, D)$ for $Q_{2}^\star {\,:\!\!-\,} R(x), S(x,y), T(y)$ represented as bipartite graph. $D$ denotes the database with the orange tuple ${\color{orange}s_{13}}$ and $D'$ denotes the database without it.
  • Figure 3: Representation of a factorization as a mapping of witnesses to $\texttt{VEO}$s for an example database under query $Q_{2}^\star$. \ref{['thm:factorizationveoff']} shows the correspondence of (a) via (b) to (c). \ref{['thm:minfacveo']} shows the correspondence of (c) via (d) to (e) for some minimal factorization tree.
  • Figure 4: ILP Formulation for $\mathtt{minFACT}$
  • Figure 5: \ref{['ex:3chain']}: $\mathtt{mveo}$ for 3-chain query $Q_{3}^\infty$.
  • ...and 27 more figures

Theorems & Definitions (104)

  • Example 1: Provenance
  • definition 1: $\mathtt{FACT}$
  • Example 2: $\mathtt{FACT}$
  • definition 2: Variable Elimination Order (VEO)
  • definition 3: VEO instance
  • Example 3: $\texttt{VEO}$ and $\texttt{VEO}$ instance
  • definition 4: VEO table prefix
  • Example 4: VEO table prefix and VEO table prefix instance
  • definition 5: VEO factorization forest (VEOFF)
  • Example 5: VEO Factorization Forest
  • ...and 94 more