We study the complexity of approximating the number of answers to a small query $\varphi$ in a large database $\mathcal{D}$. We establish an exhaustive classification into tractable and intractable cases if $\varphi$ is a conjunctive query with disequalities and negations: $\bullet$ If there is a constant bound on the arity of $\varphi$, and if the randomised Exponential Time Hypothesis (rETH) holds, then the problem has a fixed-parameter tractable approximation scheme (FPTRAS) if and only if the treewidth of $\varphi$ is bounded. $\bullet$ If the arity is unbounded and we allow disequalities only, then the problem has an FPTRAS if and only if the adaptive width of $\varphi$ (a width measure strictly more general than treewidth) is bounded; the lower bound relies on the rETH as well. Additionally we show that our results cannot be strengthened to achieve a fully polynomial randomised approximation scheme (FPRAS): We observe that, unless $\mathrm{NP} =\mathrm{RP}$, there is no FPRAS even if the treewidth (and the adaptive width) is $1$. However, if there are neither disequalities nor negations, we prove the existence of an FPRAS for queries of bounded fractional hypertreewidth, strictly generalising the recently established FPRAS for conjunctive queries with bounded hypertreewidth due to Arenas, Croquevielle, Jayaram and Riveros (STOC 2021).
翻译:我们研究了在大规模数据库$\mathcal{D}$中近似计数小查询$\varphi$答案数量的复杂性。针对带有不等约束和否定的合取查询$\varphi$,我们建立了可解和不可解情况的穷尽分类:
$\bullet$ 如果$\varphi$的元数有常数上界,且随机指数时间假说(rETH)成立,则当且仅当$\varphi$的树宽有界时,该问题存在固定参数可跟踪近似方案(FPTRAS)。
$\bullet$ 若元数无界且仅允许不等约束,则当且仅当$\varphi$的自适应宽度(一种比树宽更泛化的宽度度量)有界时,该问题存在FPTRAS;下界同样依赖于rETH。
此外,我们证明这些结果无法增强为完全多项式随机近似方案(FPRAS):观察到除非$\mathrm{NP} =\mathrm{RP}$,即使树宽(及自适应宽度)为$1$,也不存在FPRAS。然而,当查询中不含不等约束和否定时,我们证明了对于有界分数超树宽的查询存在FPRAS,这严格推广了Arenas、Croquevielle、Jayaram和Riveros(STOC 2021)近期建立的关于有界超树宽合取查询的FPRAS结果。