English

Global Predecessor Indexing: Avoiding Binary Search in Weighted Job Scheduling

Data Structures and Algorithms 2025-10-27 v2

Abstract

We present an improved solution to the Weighted Job Scheduling (WJS) problem. While the classical dynamic programming (DP) solution for nn jobs runs in O(nlog(n))O(n \log(n)) time due to comparison-based sorting and per-job binary search, we eliminate the binary search bottleneck. In its place, we introduce a novel multi-phase preprocessing technique called \emph{Global Predecessor Indexing (GPI)}, which computes the latest non-overlapping job (i.e., the predecessor) for all jobs via a two-pointer linear-time pass after sorting. This yields a time complexity of O(S(n)+n)O(S(n) + n) where S(n)S(n) is the time to sort all jobs. GPI enables direct use in the classical DP recurrence. When combined with linear-time sorting, GPI yields a complete O(n)O(n) solution. Even with comparison-based sorting, GPI significantly outperforms the classical solution in practice by avoiding repeated binary searches in favor of the more cache-efficient extra sort and two-pointer pass.

Keywords

Cite

@article{arxiv.2506.22922,
  title  = {Global Predecessor Indexing: Avoiding Binary Search in Weighted Job Scheduling},
  author = {Amit Joshi},
  journal= {arXiv preprint arXiv:2506.22922},
  year   = {2025}
}

Comments

6 pages, 9 figures including tables. Short theoretical and practical paper on improved dynamic programming for weighted job scheduling with linear-time preprocessing

R2 v1 2026-07-01T03:37:54.833Z