The subgraph isomorphism problem and its generalizations such as conjunctive queries, where some nodes are projected, are among the most fundamental problems in graph algorithms and database theory. In this paper, we study the listing and enumeration variants of these problems and present two main results. (1) We present the first algorithms for enumerating projected trees with polynomial preprocessing time ($\widetilde{O}(n^{17.42})$) and polylogarithmic delay ($\mathrm{polylog}(n)$). Prior to this work, all algorithms in the literature required time $Ω(n^{Ω(k)} + t)$ or $t \cdot n^{Ω(1)}$ to list all copies of a $k$-node tree with projections, where $t$ is the number of solutions. Our result generalizes to arbitrary projected hypergraphs, achieving enumeration in preprocessing time $\widetilde{O}(m^{17.42 \cdot \mathrm{subw}(H)})$ and polylogarithmic delay, where $\mathrm{subw}(H)$ is the submodular width of the pattern hypergraph $H$. We heavily rely on fast (rectangular and output-sensitive) matrix multiplication, which we complement by fine-grained lower bounds indicating that any algorithm beating time $Ω(n^{Ω(k)} + t)$ must rely on fast matrix multiplication. (2) As our second main result, we present a generic enumeration-to-listing reduction, establishing that listing and enumeration are equivalent under natural assumptions. For (colored) subgraph isomorphism, our reduction transforms any listing algorithm running in time $O(f(n,m) + t \cdot g(n,m))$ into an enumeration algorithm with preprocessing time $O((f(n,m)+g(n,m)+m) \log^2 n)$ and delay $O(g(n,m))$. We utilize this equivalence as a tool for proving our first main result, and we expect that our generic reduction will find many future applications.
翻译:子图同构问题及其推广(如投影节点的合取查询)是图算法和数据库理论中最基础的问题之一。本文研究这些问题的列表与枚举变体,并提出两项主要成果。(1)我们首次提出在多项式预处理时间($\widetilde{O}(n^{17.42})$)和多对数延迟($\mathrm{polylog}(n)$)内枚举投影树的算法。此前文献中所有算法均需时间$Ω(n^{Ω(k)} + t)$或$t \cdot n^{Ω(1)}$来列出$k$节点投影树的所有副本($t$为解的数量)。我们的结果推广至任意投影超图,在预处理时间$\widetilde{O}(m^{17.42 \cdot \mathrm{subw}(H)})$和多对数延迟内实现枚举,其中$\mathrm{subw}(H)$是模式超图$H$的子模宽度。我们深度依赖快速(矩形且输出敏感的)矩阵乘法,并通过细粒度下界表明:任何优于$Ω(n^{Ω(k)} + t)$的算法必须依托快速矩阵乘法。(2)作为第二项主要成果,我们提出通用枚举到列表归约方法,证明在自然假设下列表与枚举等价。对于(着色)子图同构,该归约可将任何运行时间为$O(f(n,m) + t \cdot g(n,m))$的列表算法转化为预处理时间$O((f(n,m)+g(n,m)+m) \log^2 n)$、延迟$O(g(n,m))$的枚举算法。我们利用该等价性作为证明第一项主要成果的工具,并预期该通用归约未来将有广泛应用。