vix.ing · top · new · best · stats · spec

On Conditional Branches in Optimal Search Trees

2006/04/06 by Michael B. Baer, Baer, Michael B.
Computer Science · #Algorithms and Data Compression #B.1.4 #C.0 #C.1.1 #D.3.4 #Data Structures and Algorithms (cs.DS) #E.1 #F.2.2 #FOS: Computer and information sciences #G.3 #H.3.3 #I.2.8 #Information Retrieval (cs.IR) #Machine Learning and Algorithms #Machine Learning and Data Classification #Performance (cs.PF) #cs.DS #cs.IR #cs.PF

paper · pdf · doi:10.48550/arxiv.cs/0604016

8 pages, 5 figures (with 10 illustrations total), 1 table; reformatted with some additional notes

openalex publication_date 2006/04/06 · arxiv created 2006/05/23 · arxiv updated 2009/12/01 · openalex created_date 2025/10/10 · openalex updated_date 2026/07/28

Abstract

Algorithms for efficiently finding optimal alphabetic decision trees -- such as the Hu-Tucker algorithm -- are well established and commonly used. However, such algorithms generally assume that the cost per decision is uniform and thus independent of the outcome of the decision. The few algorithms without this assumption instead use one cost if the decision outcome is ``less than'' and another cost otherwise. In practice, neither assumption is accurate for software optimized for today's microprocessors. Such software generally has one cost for the more likely decision outcome and a greater cost -- often far greater -- for the less likely decision outcome. This problem and generalizations thereof are thus applicable to hard coding static decision tree instances in software, e.g., for optimizing program bottlenecks or for compiling switch statements. An O(n3)-time O(n2)-space dynamic programming algorithm can solve this optimal binary decision tree problem, and this approach has many generalizations that optimize for the behavior of processors with predictive branch capabilities, both static and dynamic. Solutions to this formulation are often faster in practice than ``optimal'' decision trees as formulated in the literature. Different search paradigms can sometimes yield even better performance.

Related