Southwest Tree: A Low-Memory Data Structure for Partial Accumulations by Non-Commutative Invertible Operations
Nicholas J. C. Papadopoulos
TL;DR
The paper addresses partial accumulation with updates under non-commutative invertible operations and introduces the Southwest Tree, an in-place data structure that uses phantom nodes to enable traversal without extra memory. It defines node values by $A[i] = A[i - 2^{h_i - 1}] + A[i - 1] + I[i]$ and supports $O(\log_2 N)$ time for both update and accumulate, while storing $N$ elements and modifying the input array in place. The key contributions are a complete in-place structure with phantom nodes, a bottom-up building process, and detailed algorithms for $\text{accumulate}$ and $\text{update}$ that preserve operand order for non-commutative operations, plus a complexity comparison showing memory advantages over the Segment Tree. The work has practical impact for memory-constrained applications requiring fast partial sums with non-commutative composition, broadening the toolkit beyond Fenwick Trees and Segment Trees. $O(\log_2 N)$ time, $O(N)$ space, in-place updates, and support for non-commutative invertible operations collectively position the Southwest Tree as a memory-efficient alternative to traditional structures in relevant workflows.
Abstract
The task of accumulating a portion of a list of values, whose values may be updated at any time, is widely used throughout various applications in computer science. While it is trivial to accomplish this task without any constraints, trivial solutions often sacrifice time complexity in either accumulating or updating the values, one being constant time and the other being linear. To even out the complexity, two well-known data structures have been used to accomplish this task, namely the Segment Tree and the Binary Indexed Tree, which are able to carry out both tasks in O(log_2 N) time for a list of N elements. However, the Segment Tree suffers from requiring auxiliary memory to contain additional values, while the Binary Indexed Tree is unable to handle non-commutative accumulation operations. Here, we present a data structure, called the Southwest Tree, that accomplishes these tasks for non-commutative, invertible accumulation operations in O(log_2 N) time and uses no additional memory to store the structure apart from the initial input array.
