Table of Contents
Fetching ...

Linear Programs with Conjunctive Database Queries

Florent Capelli, Nicolas Crosetti, Joachim Niehren, Jan Ramon

TL;DR

This work defines LP(CQ_Sigma), a language for linear programs whose constraints and objectives are determined by the answers to conjunctive queries over a database. It develops a two‑phase solving strategy: first unfolding universal quantifiers to obtain $LP_{clos}(CQ_\Sigma)$, then constructing a factorized interpretation via hypertree decompositions to dramatically reduce the number of LP variables while preserving the optimum. The authors prove correctness by establishing a weightings correspondence and show data‑ and combined‑complexity results that depend on fractional hypertree width and AGM bounds, with efficient solutions for tractable fragments. They also extend the framework to open weight expressions, existential quantification, and provide a detailed complexity analysis, plus applications to differential privacy and graph pattern s‑measures. Empirical case studies illustrate significant practical gains from the factorized approach, suggesting wide applicability in database‑with‑optimization settings and potential integration with database engines for scalable optimization over query answers.

Abstract

In this paper, we study the problem of optimizing a linear program whose variables are the answers to a conjunctive query. For this we propose the language LP(CQ) for specifying linear programs whose constraints and objective functions depend on the answer sets of conjunctive queries. We contribute an efficient algorithm for solving programs in a fragment of LP(CQ). The natural approach constructs a linear program having as many variables as there are elements in the answer set of the queries. Our approach constructs a linear program having the same optimal value but fewer variables. This is done by exploiting the structure of the conjunctive queries using generalized hypertree decompositions of small width to factorize elements of the answer set together. We illustrate the various applications of LP(CQ) programs on three examples: optimizing deliveries of resources, minimizing noise for differential privacy, and computing the s-measure of patterns in graphs as needed for data mining.

Linear Programs with Conjunctive Database Queries

TL;DR

This work defines LP(CQ_Sigma), a language for linear programs whose constraints and objectives are determined by the answers to conjunctive queries over a database. It develops a two‑phase solving strategy: first unfolding universal quantifiers to obtain , then constructing a factorized interpretation via hypertree decompositions to dramatically reduce the number of LP variables while preserving the optimum. The authors prove correctness by establishing a weightings correspondence and show data‑ and combined‑complexity results that depend on fractional hypertree width and AGM bounds, with efficient solutions for tractable fragments. They also extend the framework to open weight expressions, existential quantification, and provide a detailed complexity analysis, plus applications to differential privacy and graph pattern s‑measures. Empirical case studies illustrate significant practical gains from the factorized approach, suggesting wide applicability in database‑with‑optimization settings and potential integration with database engines for scalable optimization over query answers.

Abstract

In this paper, we study the problem of optimizing a linear program whose variables are the answers to a conjunctive query. For this we propose the language LP(CQ) for specifying linear programs whose constraints and objective functions depend on the answer sets of conjunctive queries. We contribute an efficient algorithm for solving programs in a fragment of LP(CQ). The natural approach constructs a linear program having as many variables as there are elements in the answer set of the queries. Our approach constructs a linear program having the same optimal value but fewer variables. This is done by exploiting the structure of the conjunctive queries using generalized hypertree decompositions of small width to factorize elements of the answer set together. We illustrate the various applications of LP(CQ) programs on three examples: optimizing deliveries of resources, minimizing noise for differential privacy, and computing the s-measure of patterns in graphs as needed for data mining.
Paper Structure (52 sections, 31 theorems, 99 equations, 11 figures)

This paper contains 52 sections, 31 theorems, 99 equations, 11 figures.

Key Result

Lemma 2.4

Given a tree decomposition $T=(\mathcal{V},\mathcal{E},\mathcal{B})$ of a quantifier free conjunctive query $Q\in\mathit{CQ}_\Sigma$ of width $k$ and a database $\mathbb{D}\in\mathit{db}_\Sigma$, one can compute the collection of bag projections $({ \llbracket Q \rrbracket^\mathbb{D}}_{\mid {\mathca

Figures (11)

  • Figure 1: A $\mathit{LP(\mathit{CQ}_\Sigma)}$ program for the resource delivery optimization where $Q=\mathit{dlr}(\mathbf{x})$ and $\mathbf{x}= (f', w', b', o')$.
  • Figure 2: The set of linear programs $\mathit{L}\textsc{p}$ with variables $\xi \in \Xi$ and constants $r\in \mathbb{R}$.
  • Figure 3: Semantics of linear expressions, constraints and programs.
  • Figure 4: The set of conjunctive queries $\mathit{CQ}_\Sigma$ with signature $\Sigma=((\mathcal{R}^{(n)})_{n\in\mathbb{N}},\mathcal{C})$ where $x\in\mathcal{X}$, $c\in \mathcal{C}$, and $R\in\mathcal{R}^{(n)}$.
  • Figure 5: The answer set of a conjunctive query $Q\in\mathit{CQ}_\Sigma$ on a database $\mathbb{D}\in\mathit{db}_\Sigma$ for a set of variables $X\supseteq \mathit{fv}(Q)$.
  • ...and 6 more figures

Theorems & Definitions (58)

  • Definition 2.1
  • Definition 2.2: Hypertree width of quantifier free conjunctive queries
  • Definition 2.3
  • Lemma 2.4
  • Definition 2.5
  • Lemma 2.6: Lemma of 13.1.2 of kloks1994treewidth
  • Definition 3.1
  • Theorem 3.2
  • proof
  • Theorem 3.3
  • ...and 48 more