Given a weighted, ordered query set $Q$ and a partition of $Q$ into classes, we study the problem of computing a minimum-cost decision tree that, given any query $q$ in $Q$, uses equality tests and less-than comparisons to determine the class to which $q$ belongs. Such a tree can be much smaller than a lookup table, and much faster and smaller than a conventional search tree. We give the first polynomial-time algorithm for the problem. The algorithm extends naturally to the setting where each query has multiple allowed classes.
翻译:给定一个带权重的有序查询集$Q$及其划分为多个类别的问题,我们研究如何构建最小代价决策树,使得对于$Q$中的任意查询$q$,该树能够通过等式测试与小于比较确定$q$所属的类别。这种决策树的规模远小于查找表,且比传统搜索树更快、更紧凑。我们提出了该问题的首个多项式时间算法。该算法可自然扩展至每个查询允许同时属于多个类别的情形。