potentialpaper

Segment-Based Dynamic Programming for Optimal Binary Search Trees: A Sub-Cubic Algorithm with Hierarchical Weight Partitioning

TAPON KUMER RAY, Rajkumar Yesuraj

ICLR 2026 submission

Edit this page

Or clone it with git

The page gets its repository with its first edit, so start in the web editor.

Or let your agent set it up

It checks and sets up everything: signing in, git, the clone, credentials and an SSH key.

Abstract. Constructing optimal binary search trees under two-way comparisons is significantly more challenging than in the classical three-way model: two-way comparisons induce complex “punctured intervals” in the Dynamic Programming (DP) state space, potentially resulting in exponential sub-problem growth. In particular, the state-of-the-art algorithm for two-way comparisons runs in O\left(n^4\right) time, which becomes infeasible for large datasets with millions of keys. The proposed work presents a novel O\left(n^2\log{n^2}\right) time algorithm for constructing optimal search trees with two-way comparisons, improving on the current best O\left(n^4\right) complexity. The approach introduces Hierarchical Weight Partitioning (HWP), a segment-based dynamic programming framework that partitions the weight space into hierarchical segments, enabling efficient pruning of equivalent sub-problems while preserving optimality. The algorithm leverages a multi-level segment tree data structure with adaptive threshold selection to achieve logarithmic improvements in both time and space complexity for practical instances. Experimental evaluation on synthetic and real-world datasets demonstrates 3 to 8 times speedups with up to 60% memory reduction compared to existing methods. Our work provides the first sub-cubic solution for this fundamental problem. These results impact new possibilities for efficient inference in AI systems that rely on search structures (e.g., decision-tree models or data indexes).

Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.

Claim this paper
How does this paper connect to your work? Write how you built on it, compared with it or reproduced it, or add a summary, a critique or errata.
Or make it interactive:
Start writing

add · history

No versions are recorded yet: its preprint, the venues it went to and what they decided, the camera-ready. Missing a version?

We don't know of a submission of this paper to a venue with open reviews. Missing a submission?

Loading the discussion…