Skip to main content Accessibility help
×
Hostname: page-component-848d4c4894-75dct Total loading time: 0 Render date: 2024-05-17T08:28:08.852Z Has data issue: false hasContentIssue false

10 - Grids

Published online by Cambridge University Press:  05 September 2016

Gonzalo Navarro
Affiliation:
Universidad de Chile
Get access

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, x1, x2, y1, y2): returns the number of points lying on the rectangle [x1, x2] × [y1, y2] of G, that is, within the column range [x1, x2] and at the same time within the row range [y1, y2].

report(G, x1, x2, y1, y2): reports the (x, y) coordinates of all the points lying on the range [x1, x2] × [y1, y2] of G.

top(G, x1, x2, y1, y2,m): reports m points (x, y) with highest priority in the range [x1, x2] × [y1, y2] 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.

Type
Chapter
Information
Compact Data Structures
A Practical Approach
, pp. 347 - 394
Publisher: Cambridge University Press
Print publication year: 2016

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

References

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.Google Scholar
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.Google Scholar
Barbay, J., Claude, F., and Navarro, G. (2013). Compact binary relation representations with rich functionality. Information and Computation, 232, 19–37.Google Scholar
Bentley, J. L. (1975). Multidimensional binary search trees used for associative searching. Communications of the ACM, 18(9), 509–517.Google Scholar
Bentley, J. L. (1979). Decomposable searching problems. Information Processing Letters, 8(5), 244–251.Google Scholar
Bentley, J. L. (1980). Multidimensional divide-and-conquer. Communications of the ACM, 23(4), 214–229.Google Scholar
Bille, P. and Gortz, I. L. (2014). Substring range reporting. Algorithmica, 69(2), 384–396.Google Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
Brisaboa, N. R., Ladra, S., and Navarro, G. (2014). Compact representation of Web graphs with extended functionality. Information Systems, 39(1), 152–174.Google Scholar
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.Google Scholar
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.Google Scholar
Chazelle, B. (1988). A functional approach to data structures and its use in multidimensional searching. SIAM Journal on Computing, 17(3), 427–462.Google Scholar
Claude, F. and Navarro, G. (2010). Self-indexed grammar-based compression. Fundamenta Informaticae, 111(3), 313–337.Google Scholar
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.Google Scholar
Claude, F., Navarro, G., and Ordónez, A. (2015). The wavelet matrix: An efficient wavelet tree for large alphabets. Information Systems, 47, 15–32.Google Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
Finkel, R. A. and Bentley, J. L. (1974). Quad Trees: A data structure for retrieval on composite keys. Acta Informatica, 4, 1–9.Google Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
Kim, K., Cha, S.K., and Kwon, K. (2001).Optimizing multidimensional index trees formainmemory access. ACM SIGMOD Record, 30(2), 139–150.Google Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
Mäkinen, V. and Navarro, G. (2007). Rank and select revisited and extended. Theoretical Computer Science, 387(3), 332–347.Google Scholar
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.Google Scholar
Navarro, G. (2014). Wavelet trees for all. Journal of Discrete Algorithms, 25, 2–20.Google Scholar
Navarro, G., Nekrich, Y., and Russo, L. M. S. (2013). Space-efficient data-analysis queries on grids. Theoretical Computer Science, 482, 60–72.Google Scholar
Nekrich, Y. and Navarro, G. (2012). Sorted range reporting. In Proc. 13th Scandinavian Symposium on Algorithmic Theory (SWAT), LNCS 7357, pages 271–282.Google Scholar
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.Google Scholar
Overmars, M. H. (1988). Efficient data structures for range searching on a grid. Journal of Algorithms, 9(2), 254–275.Google Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
Willard, D. (1985). New data structures for orthogonal range queries. SIAM Journal on Computing, 14(1), 232–253.Google Scholar
Wise, D. S. and Franco, J. (1990). Costs of quadtree representation of nondense matrices. Journal of Parallel and Distributed Computing, 9(3), 282–296.Google Scholar
Zhou, G. (2016). Two-dimensional range successor in optimal time and almost linear space. Information Processing Letters, 116(2), 171–174.Google Scholar

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

  • Grids
  • Gonzalo Navarro, Universidad de Chile
  • Book: Compact Data Structures
  • Online publication: 05 September 2016
  • Chapter DOI: https://doi.org/10.1017/CBO9781316588284.011
Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

  • Grids
  • Gonzalo Navarro, Universidad de Chile
  • Book: Compact Data Structures
  • Online publication: 05 September 2016
  • Chapter DOI: https://doi.org/10.1017/CBO9781316588284.011
Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

  • Grids
  • Gonzalo Navarro, Universidad de Chile
  • Book: Compact Data Structures
  • Online publication: 05 September 2016
  • Chapter DOI: https://doi.org/10.1017/CBO9781316588284.011
Available formats
×