On Conditional Branches in Optimal Search Trees
Michael B. Baer
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.
Create a lesson
Related papers
FoldPipe: Bounded Remote Streaming of Native Molecular Shards with Asynchronous Prefetch
Dhiren Mukesh Khatri
TOPIQ: Statistical Error Propagation for Quantity-of-Interest Prediction under Lossy Compression
Youyuan Liu, Bo Jiang, Taolue Yang et al.
Launch-Bound and Substitutable: Why Three Inference Optimizations Fail to Pay Off in Mixture-of-Experts Models
Gokulakannan Sakthivel, Jerry Wu, Amogh Rajendra et al.
Direct-Operable SIMD Bit-Slicing: A Framework for Memory-Efficient Predicate Evaluation
Arunkumar Mathiyazhagan
When Structure is Silent: Opportunities for Algorithmic Dispatch in Linear Algebra
Emmanuel Lujan, Alan Edelman
Portable to Efficient: Auto-Tuning Hardware-Agnostic GPU Kernels in Julia
Floris-Jan Willemsen, Evelyne Ringoot, Alan Edelman