# Indexing Range Maximum-Sum Segment Queries with Offsets

Preprint · Seungbum Jo, Dominik Köppl

- Archive id: arxiv:2607.18739
- Published: 2026-07-21
- DOI: https://doi.org/10.4230/lipics.swat.2026.23
- arXiv: https://arxiv.org/abs/2607.18739
- Source URL: https://arxiv.org/abs/2607.18739
- PDF: https://arxiv.org/pdf/2607.18739
- Provenance: arxiv

## Abstract

Given an array of $n$ real numbers, the maximum segment sum (MSS) problem is to find a contiguous subarray that has the largest sum. While the MSS problem can be solved optimally with Kadane's algorithm in $O(n)$ time, the study of its indexing version spawned new extensions such as (a) retrieving the MSS after subtracting a query offset parameter for all array entries or (b) retrieving the MSS for arbitrary query ranges. We here study the combination of both problems (a) and (b), which requires retrieving the MSS for arbitrary query ranges after subtracting a query offset parameter for all array entries. For that, we present an index whose query time is only slower than the best known for (a) by a factor of $O(\\log n)$. In detail, our index uses $O(n \\log n)$ space, supports queries in $O(\\log^2 n)$ time, and can be constructed in $O(n \\log^3 n)$ time. More generally, for every integer $d$ with $1\\le d\\le\\lceil\\log\_2 n\\rceil$, we give an $O(dn)$-space index with $O(dn^{1/d}\\log n)$ query time; in particular, for every fixed $\\varepsilon\>0$, we obtain linear space and $O(n^\\varepsilon\\log n)$ query time. As side results, we obtain the same time-space trade-off in terms of the number of runs of a run-length encoded input, deduce a solution for (a) that works in run-length compressed space and time, and prove a tight $Θ(n^{2/3})$ bound on the number of non-compatible offsets for binary arrays. Finally, we give supportive lower bounds for our query problem, showing that there is only a polylogarithmic gap of improvement left.

_Abstract reproduced under CC0-1.0 (arXiv descriptive metadata)._

---
Space Kitty Archive · https://space-kitty.com · API: https://space-kitty.com/api/v1 · MCP: https://space-kitty.com/mcp · Premium: $0.20/request via x402 (Base Sepolia (testnet)). Metadata: arXiv (CC0), OpenAlex (CC0), Europe PMC (CC BY/CC0 works), ClinicalTrials.gov.
