We describe a data structure for submatrix maximum queries in Monge matrices or partial Monge matrices, where a query seeks the maximum element in a contiguous submatrix of the given matrix. The structure, for an n × n Monge matrix, takes O(nlog n) space and O(nlogn) preprocessing time, and answers queries in O(log²n) time. For partial Monge matrices, the space grows by α(n), the preprocessing ... [Show full abstract] grows by α(n)logn (α(n) is the inverse Ackermann function), and the query remains O(log²n). Our design exploits an interpretation of the column maxima in a Monge (partial Monge, respectively) matrix as an upper envelope of pseudo-lines (pseudo-segments, respectively).
We give two applications: (1) For a planar set of n points in an axis-parallel rectangle B, we build a data structure, in O(nα(n)log⁴n) time and O(nα(n)log³n) space, that returns, for a query point p, the largest-area empty axis-parallel rectangle contained in B and containing p, in O(log⁴n) time. This improves substantially the nearly quadratic storage and preprocessing obtained by Augustine et al. . (2) Given an n-node arbitrarily weighted planar digraph, with possibly negative edge weights, we build, in O(nlog²n/log logn) time, a linear-size data structure that supports edge-weight updates and graph-distance queries between arbitrary pairs of nodes in O(n2/3log5/3n) time per operation. This improves a previous algorithm of Fakcharoenphol and Rao . Our data structure has already been applied in a recent maximum flow algorithm for planar graphs in Borradaile et al. .