Abstract
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.
Most proofs from Sects. 3 and 4 are omitted. See [6] for full proofs.
M. Chrobak—Research partially supported by National Science Foundation grant CCF-2153723.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Anderson, R., Kannan, S., Karloff, H., Ladner, R.E.: Thresholds and optimal binary comparison search trees. J. Algorithms 44, 338–358 (2002). https://doi.org/10.1016/S0196-6774(02)00203-1
Chambers, C., Chen, W.: Efficient multiple and predicated dispatching. In: Proceedings of the 1999 ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages & Applications (OOPSLA 1999), Denver, Colorado, USA, 1–5 November 1999, pp. 238–255 (1999)
Chambers, C., Chen, W.: Efficient multiple and predicated dispatching. SIGPLAN Not. 34(10), 238–255 (1999). https://doi.org/10.1145/320385.320407
Chrobak, M., Golin, M., Munro, J.I., Young, N.E.: A simple algorithm for optimal search trees with two-way comparisons. ACM Trans. Algorithms 18(1), 2:1–2:11 (2021). https://doi.org/10.1145/3477910
Chrobak, M., Golin, M., Munro, J.I., Young, N.E.: On Huang and Wong’s algorithm for generalized binary split trees. Acta Informatica 59(6), 687–708 (2022). https://doi.org/10.1007/s00236-021-00411-z
Chrobak, M., Young, N.E.: Classification via two-way comparisons (2023). https://doi.org/10.48550/ARXIV.2302.09692
Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms, 4th edn. The MIT Press, Cambridge (2022)
Dagan, Y., Filmus, Y., Gabizon, A., Moran, S.: Twenty (simple) questions. In: Proceedings of the 49th Annual ACM SIGACT Symposium on Theory of Computing, STOC 2017, Montreal, QC, Canada, 19–23 June 2017, pp. 9–21 (2017). https://doi.org/10.1145/3055399.3055422
Gilbert, E., Moore, E.: Variable-length binary encodings. Bell Syst. Tech. J. 38(4), 933–967 (1959). https://doi.org/10.1002/j.1538-7305.1959.tb01583.x
Hester, J.H., Hirschberg, D.S., Huang, S.H., Wong, C.K.: Faster construction of optimal binary split trees. J. Algorithms 7, 412–424 (1986). https://doi.org/10.1016/0196-6774(86)90031-3
Huang, S.H.S., Wong, C.K.: Generalized binary split trees. Acta Informatica 21(1), 113–123 (1984). https://doi.org/10.1007/BF00289143
Huang, S.H.S., Wong, C.K.: Optimal binary split trees. J. Algorithms 5, 69–79 (1984). https://doi.org/10.1016/0196-6774(84)90041-5
Hyafil, L., Rivest, R.L.: Constructing optimal binary decision trees is NP-complete. Inf. Process. Lett. 5(1), 15–17 (1976). https://doi.org/10.1016/0020-0190(76)90095-8
Knuth, D.E.: Optimum binary search trees. Acta Informatica 1, 14–25 (1971). https://doi.org/10.1007/BF00264289
Knuth, D.E.: The Art of Computer Programming, Volume 3: Sorting and Searching, 2nd edn. Addison-Wesley Publishing Company, Redwood (1998)
Perl, Y.: Optimum split trees. J. Algorithms 5, 367–374 (1984). https://doi.org/10.1016/0196-6774(84)90017-8
Sheil, B.A.: Median split trees: a fast lookup technique for frequently occurring keys. Commun. ACM 21, 947–958 (1978). https://doi.org/10.1145/359642.359653
Spuler, D.: Optimal search trees using two-way key comparisons. Acta Informatica 31(8), 729–740 (1994). https://doi.org/10.1007/BF01178732
Spuler, D.A.: Optimal search trees using two-way key comparisons. Ph.D. thesis, James Cook University (1994)
Acknowledgements
Thanks to Mordecai Golin and Ian Munro for introducing us to the problem and for useful discussions.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Chrobak, M., Young, N.E. (2023). Classification via Two-Way Comparisons (Extended Abstract). In: Morin, P., Suri, S. (eds) Algorithms and Data Structures. WADS 2023. Lecture Notes in Computer Science, vol 14079. Springer, Cham. https://doi.org/10.1007/978-3-031-38906-1_19
Download citation
DOI: https://doi.org/10.1007/978-3-031-38906-1_19
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-38905-4
Online ISBN: 978-3-031-38906-1
eBook Packages: Computer ScienceComputer Science (R0)