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.
