Skip to main content
×
×
Home
  • Print publication year: 2016
  • Online publication date: September 2016

10 - Grids

Summary

A two-dimensional grid is a matrix of c columns and r rows, where each cell may or may not contain a point. We call n the total number of points in the grid. In the basic case, points have no associated data. We will also consider the case of weighted points, where the points have an associated integer priority (or weight) in the range [1, u].

Grids arise naturally in applications related to geographic information systems (GIS), computational geometry, and multidimensional data in general, but also as internal components of other data structures that are not related to geometry. We have already seen applications in Chapter 9 (the adjacency matrix), where graph edges (v, u) were modeled essentially as points on a grid of size |V| × |V|.

In this chapter we focus on a more geometric interpretation of grids, where queries refer to the points lying on a two-dimensional range of the grid. We consider the following queries on a grid G:

count(G, x 1 , x 2 , y 1 , y 2): returns the number of points lying on the rectangle [x 1 , x 2] × [y 1 , y 2] of G, that is, within the column range [x 1 , x 2] and at the same time within the row range [y 1 , y 2].

report(G, x 1 , x 2 , y 1 , y 2): reports the (x, y) coordinates of all the points lying on the range [x 1 , x 2] × [y 1 , y 2] of G.

top(G, x 1 , x 2 , y 1 , y 2 ,m): reports m points (x, y) with highest priority in the range [x 1 , x 2] × [y 1 , y 2] of G, for the case of weighted points.

Algorithms to solve related problems, like determining whether a rectangular area is empty, or reporting points in some specific coordinate order, will be derived as modifications of these three queries. Although much less ample than the complex queries that may arise in computational geometry applications, the basic queries on axis-aligned areas cover the needs of a large number of applications and are amenable to efficient solutions.

Recommend this book

Email your librarian or administrator to recommend adding this book to your organisation's collection.

Compact Data Structures
  • Online ISBN: 9781316588284
  • Book DOI: https://doi.org/10.1017/CBO9781316588284
Please enter your name
Please enter a valid email address
Who would you like to send this to *
×
Agarwal, P. K. and Erickson, J. (1999). Geometric range searching and its relatives. In Advances in Discrete and Computational Geometry, volume 223 of Contemporary Mathematics, pages 1–56. AMS Press.
Alstrup, S., Brodal, G., and Rauhe, T. (2000). New data structures for orthogonal range searching. In Proc. 41st IEEE Symposium on Foundations of Computer Science (FOCS), pages 198–207.
Amir, A., Keselman, D., Landau, G. M., Lewenstein, M., Lewenstein, N., and Rodeh, M. (2000). Text indexing and dictionary matching with one error. Journal of Algorithms, 37(2), 309–325.
Barbay, J., Claude, F., and Navarro, G. (2013). Compact binary relation representations with rich functionality. Information and Computation, 232, 19–37.
Bentley, J. L. (1975). Multidimensional binary search trees used for associative searching. Communications of the ACM, 18(9), 509–517.
Bentley, J. L. (1979). Decomposable searching problems. Information Processing Letters, 8(5), 244–251.
Bentley, J. L. (1980). Multidimensional divide-and-conquer. Communications of the ACM, 23(4), 214–229.
Bille, P. and Gortz, I. L. (2014). Substring range reporting. Algorithmica, 69(2), 384–396.
Biswas, S., Ku, T.-H., Shah, R., and Thankachan, S. V. (2013). Position-restricted substring searching over small alphabets. In Proc. 20th International Symposium on String Processing and Information Retrieval (SPIRE), LNCS 8214, pages 29–36.
Bose, P., He, M., Maheshwari, A., and Morin, P. (2009). Succinct orthogonal range search structures on a grid with applications to text indexing. In Proc. 11th International Symposium on Algorithms and Data Structures (WADS), LNCS 5664, pages 98–109.
Brisaboa, N. R., Luaces, M., Navarro, G., and Seco, D. (2013). Space-efficient representations of rectangle datasets supporting orthogonal range querying. Information Systems, 35(5), 635–655.
Brisaboa, N. R., Ladra, S., and Navarro, G. (2014). Compact representation of Web graphs with extended functionality. Information Systems, 39(1), 152–174.
Brisaboa, N. R., de Bernardo, G., Konow, R., Navarro, G., and Seco, D. (2016). Aggregated 2D range queries on clustered points. Information Systems, 60, 34–49.
Chan, T. M., Larsen, K. G., and Pătraşcu, M. (2011). Orthogonal range searching on the RAM, revisited. In Proc. 27th ACM Symposium on Computational Geometry (SoCG), pages 1–10.
Chazelle, B. (1988). A functional approach to data structures and its use in multidimensional searching. SIAM Journal on Computing, 17(3), 427–462.
Claude, F. and Navarro, G. (2010). Self-indexed grammar-based compression. Fundamenta Informaticae, 111(3), 313–337.
Claude, F. and Navarro, G. (2012). Improved grammar-based compressed indexes. In Proc. 19th International Symposium on String Processing and Information Retrieval (SPIRE), LNCS 7608, pages 180–192.
Claude, F., Navarro, G., and Ordónez, A. (2015). The wavelet matrix: An efficient wavelet tree for large alphabets. Information Systems, 47, 15–32.
de Berg, M., Cheong, O., van Kreveld, M., and Overmars, M. (2008). Computational Geometry: Algorithms and Applications. Springer-Verlag, 3rd edition.
de Bernardo, G., Brisaboa, N. R., Caro, D., and Rodríguez, M. A. (2013a). Compact data structures for temporal graphs. In Proc. 23rd Data Compression Conference (DCC), page 477.
de Bernardo, G., Álvarez-García, S., Brisaboa, N. R., Navarro, G., and Pedreira, O. (2013b). Compact querieable representations of raster data. In Proc. 20th International Symposium on String Processing and Information Retrieval (SPIRE), LNCS 8214, pages 96–108.
Ferragina, P., Muthukrishnan, S., and de Berg, M. (1999). Multi-method dispatching: A geometric approach with applications to string matching problems. In Proc. 31st Annual ACM Symposium on Theory of Computing (STOC), pages 483–491.
Finkel, R. A. and Bentley, J. L. (1974). Quad Trees: A data structure for retrieval on composite keys. Acta Informatica, 4, 1–9.
Gabow, H. N., Bentley, J. L., and Tarjan, R. E. (1984). Scaling and related techniques for geometry problems. In Proc. 16th ACM Symposium on Theory of Computing (STOC), pages 135–143.
Gagie, T., Navarro, G., and Puglisi, S. J. (2012). New algorithms on wavelet trees and applications to information retrieval. Theoretical Computer Science, 426-427, 25–41.
Gagie, T., González-Nova, J., Ladra, S., Navarro, G., and Seco, D. (2015). Faster compressed quadtrees. In Proc. 25th Data Compression Conference (DCC), pages 93–102.
Guttman, A. (1984). R-trees: A dynamic index structure for spatial searching. In Proc. ACM International Conference on Management of Data (SIGMOD), pages 47–57.
Hon, W.-K., Shah, R., Thankachan, S. V., and Vitter, J. S. (2012). On position restricted substring searching in succinct space. Journal of Discrete Algorithms, 17, 109–114.
Hunter, G. M. and Steiglitz, K. (1979). Operations on images using quad trees. IEEE Transactions on Pattern Analysis and Machine Intelligence, 1(2), 145–153.
Jájá, J., Mortensen, C. W., and Shi, Q. (2004). Space-efficient and fast algorithms for multidimensional dominance reporting and counting. In Proc. 15th International Symposium on Algorithms and Computation (ISAAC), pages 558–568.
Kim, K., Cha, S.K., and Kwon, K. (2001).Optimizing multidimensional index trees formainmemory access. ACM SIGMOD Record, 30(2), 139–150.
Klinger, A. (1971). Patterns and search statistics. In OptimizingMethods in Statistics, pages 303–337. Academic Press.
Lee, D. T. and Wong, C. K. (1977). Worst-case analysis for region and partial region searches in multidimensional binary search trees and balanced quad trees. Acta Informatica, 9, 23–29.
Lee, D. T. and Wong, C. K. (1980). Quintary trees: A file structure for multidimensional database systems. ACM Transactions on Database Systems, 5(3), 339–353.
Lewenstein, M. (2013). Orthogonal range searching for text indexing. In Space-Efficient Data Structures, Streams, and Algorithms – Papers in Honor of J. Ian Munro on the Occasion of His 66th Birthday, LNCS 8066, pages 267–302. Springer.
Lueker, G. S. (1978). A data structure for orthogonal range queries. In Proc. 19th Annual Symposium on Foundations of Computer Science (FOCS), pages 28–34.
Mäkinen, V. and Navarro, G. (2007). Rank and select revisited and extended. Theoretical Computer Science, 387(3), 332–347.
Manolopoulos, Y., Nanopoulos, A., Papadopoulos, A.N., and Theodoridis, Y. (2005). R-Trees: Theory and Applications. Springer-Verlag.
McCreight, E. M. (1985). Priority search trees. SIAM Journal on Computing, 14(2), 257–276.
Navarro, G. (2014). Wavelet trees for all. Journal of Discrete Algorithms, 25, 2–20.
Navarro, G., Nekrich, Y., and Russo, L. M. S. (2013). Space-efficient data-analysis queries on grids. Theoretical Computer Science, 482, 60–72.
Nekrich, Y. and Navarro, G. (2012). Sorted range reporting. In Proc. 13th Scandinavian Symposium on Algorithmic Theory (SWAT), LNCS 7357, pages 271–282.
Okajima, Y. and Maruyama, K. (2015). Faster linear-space orthogonal range searching in arbitrary dimensions. In Proc. 17thWorkshop on Algorithm Engineering and Experiments (ALENEX), pages 82–93.
Overmars, M. H. (1988). Efficient data structures for range searching on a grid. Journal of Algorithms, 9(2), 254–275.
Pătraşcu, M. (2007). Lower bounds for 2-dimensional range counting. In Proc. 39th Annual ACM Symposium on Theory of Computing (STOC), pages 40–46.
Pătraşcu, M. and Thorup, M. (2006). Time-space trade-offs for predecessor search. In Proc. 38th Annual ACM Symposium on Theory of Computing (STOC), pages 232–240.
Preparata, F. P. and Shamos, M. I. (1985). Computational Geometry: An Introduction. Springer.
Samet, H. (1984). The quadtree and related hierarchical data structures. ACM Computing Surveys, 16(2), 187–260.
Samet, H. (2006). Foundations of Multidimensional and Metric Data Structures. Morgan Kaufmann.
Sankaranarayanan, J., Samet, H., and Alborzi, H. (2009). Path oracles for spatial networks. Proceedings of the VLDB Endowment, 2(1), 1210–1221.
Willard, D. (1985). New data structures for orthogonal range queries. SIAM Journal on Computing, 14(1), 232–253.
Wise, D. S. and Franco, J. (1990). Costs of quadtree representation of nondense matrices. Journal of Parallel and Distributed Computing, 9(3), 282–296.
Zhou, G. (2016). Two-dimensional range successor in optimal time and almost linear space. Information Processing Letters, 116(2), 171–174.