The problem of constructing optimal factoring automata arises in the context of unification factoring for the efficient execution of logic programs. Given an ordered set of $n$ strings of length $m$, the problem is to construct a trie-like tree structure of minimum size in which the leaves in left-to-right order represent the input strings in the given order. Contrary to standard tries, the order in which the characters of a string are encountered can be different on different root-to-leaf paths. Dawson et al. [ACM Trans. Program. Lang. Syst. 18(5):528--563, 1996] gave an algorithm that solves the problem in time $O(n^2 m (n+m))$. In this paper, we present an improved algorithm with running-time $O(n^2m)$.
翻译:最优析取自动机构造问题源于逻辑程序高效执行中的析取因子化统一(unification factoring)。给定一组按序排列的$n$个长度为$m$的字符串,该问题旨在构造一种规模最小的字典树状结构,其中从左到右的叶子节点按给定顺序对应输入字符串。与标准字典树不同,该结构中同一字符串的字符在不同根到叶路径上可遵循不同访问顺序。Dawson等人[ACM Trans. Program. Lang. Syst. 18(5):528--563, 1996]提出了时间复杂度为$O(n^2 m (n+m))的求解算法。本文给出了一种改进算法,其运行时间降至$O(n^2m)$。