In 1971, Knuth gave an $O(n^2)$-time algorithm for the classic problem of finding an optimal binary search tree. Knuth's algorithm works only for search trees based on 3-way comparisons, while most modern computers support only 2-way comparisons (e.g., $<, \le, =, \ge$, and $>$). Until this paper, the problem of finding an optimal search tree using 2-way comparisons remained open -- poly-time algorithms were known only for restricted variants. We solve the general case, giving (i) an $O(n^4)$-time algorithm and (ii) an $O(n \log n)$-time additive-3 approximation algorithm. Also, for finding optimal binary split trees, we (iii) obtain a linear speedup and (iv) prove some previous work incorrect.
翻译:1971年,Knuth给出了用于寻找最佳二进制搜索树这一典型问题的O(n ⁇ 2)美元时间算法。Knuth的算法仅用于基于三向比较的搜索树,而大多数现代计算机只支持双向比较(例如$ <,\le,=,\ge美元,=,\ge美元,和$>美元)。在本文件之前,利用双向比较寻找最佳搜索树的问题仍然开放 -- 多时算法只为限量变量所为。我们解决了一般案例,提供了(一) $(n ⁇ 4) 美元的时间算法和(二) $(n\log n) 美元-时间添加-3近似算法。此外,为了找到最佳双向分立树,我们(三) 获得线性加速,以及(四) 证明以前的一些工作不正确。