We present an output-sensitive algorithm for evaluating an acyclic Conjunctive Regular Path Query (CRPQ). Its complexity is written in terms of the input size, the output size, and a well-known parameter of the query that is called the "free-connex fractional hypertree width". Our algorithm improves upon the complexity of the recently introduced output-sensitive algorithm for acyclic CRPQs. More notably, the complexity of our algorithm for a given acyclic CRPQ Q matches the best known output-sensitive complexity for the "corresponding" conjunctive query (CQ), that is the CQ that has the same structure as the CRPQ Q except that each RPQ is replaced with a binary atom (or a join of two binary atoms). This implies that it is not possible to improve upon our complexity for acyclic CRPQs without improving the state-of-the-art on output-sensitive evaluation for acyclic CQs. Our result is surprising because RPQs, and by extension CRPQs, are equivalent to recursive Datalog programs, which are generally poorly understood from a complexity standpoint. Yet, our result implies that the recursion aspect of acyclic CRPQs does not add any extra complexity on top of the corresponding (non-recursive) CQs, at least as far as output-sensitive analysis is concerned.
翻译:我们提出了一种用于评估无环合取正则路径查询(CRPQ)的输出敏感算法。其复杂度由输入规模、输出规模以及查询中一个称为"自由连接分数超树宽度"的已知参数共同决定。该算法改进了近期提出的无环CRPQ输出敏感算法的复杂度。更值得注意的是,对于给定的无环CRPQ查询Q,我们算法的复杂度与"对应"合取查询(CQ)的最佳已知输出敏感复杂度相匹配——该CQ与CRPQ查询Q具有相同结构,仅将每个RPQ替换为二元原子(或两个二元原子的连接)。这意味着若不改进无环CQ输出敏感评估的现有技术水平,就不可能进一步提升无环CRPQ的复杂度边界。这一结果令人惊讶,因为RPQ及其扩展形式CRPQ等价于递归Datalog程序,而递归程序在复杂度层面通常难以处理。然而,我们的结果表明:至少就输出敏感分析而言,无环CRPQ的递归特性并未在对应(非递归)CQ的基础上引入额外的复杂度负担。