Finding Smallest Witnesses for Conjunctive Queries
Xiao Hu, Stavros Sintos
TL;DR
This work studies the smallest witness problem (SWP) for conjunctive queries without self-joins, establishing a precise dichotomy: exact SWP is solvable in polynomial time if the query has the head-cluster property, and is NP-hard otherwise. It then analyzes approximability, showing that CQ instances with head-domination admit constant-factor approximations, while those without head-domination resist any poly-time (1−o(1)) log N approximation unless P = NP; several CQ subclasses (star, line) have refined results, including a Greedy/Density-based approach for certain structures and a DSF-based reduction for line CQs. The paper also connects SWP to free-connex/non-free-connex CQ classifications, leverages reductions from set cover to prove hardness, and presents baseline, greedy, and problem-specific approximation algorithms, clarifying where gaps remain. Overall, the results map a rich landscape of tractability, approximation, and hardness for SWP, with practical implications for query rewriting, debugging, and robust data analytics.
Abstract
A witness is a sub-database that preserves the query results of the original database but of much smaller size. It has wide applications in query rewriting and debugging, query explanation, IoT analytics, multi-layer network routing, etc. In this paper, we study the smallest witness problem (SWP) for the class of conjunctive queries (CQs) without self-joins. We first establish the dichotomy that SWP for a CQ can be computed in polynomial time if and only if it has {\em head-cluster property}, unless $\texttt{P} = \texttt{NP}$. We next turn to the approximated version by relaxing the size of a witness from being minimum. We surprisingly find that the {\em head-domination} property - that has been identified for the deletion propagation problem \cite{kimelfeld2012maximizing} - can also precisely capture the hardness of the approximated smallest witness problem. In polynomial time, SWP for any CQ with head-domination property can be approximated within a constant factor, while SWP for any CQ without such a property cannot be approximated within a logarithmic factor, unless $\texttt{P} = \texttt{NP}$. We further explore efficient approximation algorithms for CQs without head-domination property: (1) we show a trivial algorithm which achieves a polynomially large approximation ratio for general CQs; (2) for any CQ with only one non-output attribute, such as star CQs, we show a greedy algorithm with a logarithmic approximation ratio; (3) for line CQs, which contain at least two non-output attributes, we relate SWP problem to the directed steiner forest problem, whose algorithms can be applied to line CQs directly. Meanwhile, we establish a much higher lower bound, exponentially larger than the logarithmic lower bound obtained above. It remains open to close the gap between the lower and upper bound of the approximated SWP for CQs without head-domination property.
