Abstract: The Maximizing Range Sum (MaxRS) query plays a pivotal role in computational geometry and location-aware applications. This query aims to optimally place a rectangle within a set of weighted objects to maximize the total weight of the objects it covers. Current algorithms for MaxRS queries, both exact and approximate, largely depend on the SweepLine algorithm. However, with its \(O(n\log n)\) time complexity for \(n\) objects, this algorithm becomes inefficient for contemporary applications that handle large datasets. This paper introduces an innovative method to resolve the MaxRS query in \(O(n)\) time. We first reformulate the MaxRS query as a rectangles stabbing problem. Acknowledging the presence of noise in data collected by real-world devices, we circumvent the SweepLine algorithm. Instead, we efficiently tackle the rectangles stabbing problem by optimizing space-time trade-offs. Furthermore, we expand our algorithm to address two more complex scenarios: the dynamic MaxRS (DMaxRS) query, which accounts for the varying locations of objects over time, and the MaxRS query on trajectory data (MaxRST), where each object is represented by a sequence of points, not just a singular point. Our experimental results demonstrate that our algorithms significantly outperform existing state-of-the-art methods in terms of efficiency, while maintaining reasonable memory usage and delivering satisfactory results.
Loading