Abstract
Packedness is a measure defined for curves as the ratio of maximum curve length inside any disk divided by its radius. Sparsification allows us to reduce the number of candidate disks for maximum packedness to a polynomial amount in terms of the number of vertices of the polygonal curve. This gives an exact algorithm for computing packedness. We prove that using a fat shape, such as a square, instead of a disk gives a constant factor approximation for packedness. Further sparsification using well-separated pair decomposition improves the time complexity at the cost of losing some accuracy. By adjusting the ratio of the separation factor and the size of the query, we improve the approximation factor of the existing algorithm for packedness using square queries. Our experiments show that uniform sampling works well for finding the average packedness of trajectories with almost constant speed. The empirical results confirm that the sparsification method approximates the maximum packedness for arbitrary polygonal curves. In big data models such as massively parallel computations, both sampling and sparsification are efficient and take a constant number of rounds. Most existing algorithms use line-sweeping which is sequential in nature. Also, we design two data-structures for computing the length of the curve inside a query shape: an exact data-structure for disks called hierarchical aggregated queries and an approximate data-structure for a given set of square queries. Using our modified segment tree, we achieve a near-linear time approximation algorithm.
Similar content being viewed by others
Availability of data and material
Publicly available.
References
GPS Trajectories. UCI Machine Learning Repository (2016)
Afshar, R., Goodrich, M.T., Matias, P., Osegueda, M.C.: Reconstructing biological and digital phylogenetic trees in parallel. In: 28th Annual European Symposium on Algorithms (ESA 2020). Schloss Dagstuhl-Leibniz-Zentrum für Informatik (2020)
Agarwal, P.K.: Partitioning arrangements of lines ii: applications. Discrete Comput. Geom. 5(6), 533–573 (1990)
Agarwal, P.K., Har-Peled, S., Varadarajan, K.R.: Approximating extent measures of points. J. ACM (JACM) 51(4), 606–635 (2004)
Agarwal, P.K., Katz, M.J., Sharir, M.: Computing depth orders for fat objects and related problems. Comput. Geom. 5(4), 187–206 (1995)
Aghamolaei, S., Baharifard, F., Ghodsi, M.: Geometric spanners in the MapReduce model. In International Computing and Combinatorics Conference, pp. 675–687. Springer, Berlin (2018)
Aghamolaei, S., Keikha, V., Ghodsi, M., Mohades, A.: Windowing queries using Minkowski sum and their extension to MapReduce. J. Supercomput. (2020)
Beame, P., Koutris, P., Suciu, D.: Communication steps for parallel query processing. J. ACM (JACM) 64(6), 1–58 (2017)
Bringmann, K., Künnemann, M.: Improved approximation for Fréchet distance on c-packed curves matching conditional lower bounds. In International Symposium on Algorithms and Computation, pp. 517–528. Springer, Berlin (2015)
Browning, E., Bolton, M., Owen, E., Shoji, A., Guilford, T., Freeman, R.: Predicting animal behaviour using deep learning: Gps data alone accurately predict diving in seabirds. Methods Ecol. Evol. (2017). https://doi.org/10.5061/dryad.t7ck5
Callahan, P.B.: Dealing with higher dimensions: the well-separated pair decomposition and its applications. Ph.D. thesis, Johns Hopkins University (1995)
Chen, D., Driemel, A., Guibas, L.J., Nguyen, A., Wenk, C.: Approximate map matching with respect to the Fréchet distance. In 2011 Proceedings of the Thirteenth Workshop on Algorithm Engineering and Experiments (ALENEX), pp. 75–83. SIAM (2011)
Cruz, M.O., Macedo, H., Guimaraes, A.: Grouping similar trajectories for carpooling purposes. In 2015 Brazilian Conference on Intelligent Systems (BRACIS), pp. 234–239. IEEE (2015)
De Berg, M., Van Kreveld, M., Overmars, M., Schwarzkopf, O.: Computational geometry. In Computational Geometry, pp. 1–17. Springer, Berlin (1997)
Driemel, A., Har-Peled, S.: Jaywalking your dog: computing the Fréchet distance with shortcuts. SIAM J. Comput. 42(5), 1830–1866 (2013)
Driemel, A., Har-Peled, S., Wenk, C.: Approximating the Fréchet distance for realistic curves in near linear time. Discrete Comput. Geom. 48(1), 94–127 (2012)
Driemel, A., Krivošija, A.: Probabilistic embeddings of the Fréchet distance. In International Workshop on Approximation and Online Algorithms, pp. 218–237. Springer, Berlin (2018)
Gerbessiotis, A.V.: An architecture independent study of parallel segment trees. J. Discrete Algorithms 4(1), 1–24 (2006)
Goodrich, M.T., Sitchinava, N., Zhang, Q.: Sorting, searching, and simulation in the MapReduce framework. In International Symposium on Algorithms and Computation, pp. 374–383. Springer, Berlin (2011)
Goodrich, M.T., Sitchinava, N., Zhang, Q., IT-Parken, A.: Sorting, searching, and simulation in the MapReduce framework. arXiv preprint arXiv:1101.1902 (2011)
Gudmundsson, J., van Kreveld, M., Staals, F.: Algorithms for hotspot computation on trajectory data. In Proceedings of the 21st ACM SIGSPATIAL International Conference on Advances in Geographic Information Systems, pp. 134–143 (2013)
Gudmundsson, J., Sha, Y., Wong, S.: Approximating the packedness of polygonal curves. In Cao, Y., Cheng, S.W., Li, M. (eds.) 31st International Symposium on Algorithms and Computation (ISAAC 2020), Leibniz International Proceedings in Informatics (LIPIcs), vol. 181, pp. 9:1–9:15. Schloss Dagstuhl–Leibniz-Zentrum für Informatik, Dagstuhl, Germany (2020). 10.4230/LIPIcs.ISAAC.2020.9. https://drops.dagstuhl.de/opus/volltexte/2020/13353
Gudmundsson, J., Smid, M.: Fast algorithms for approximate Fréchet matching queries in geometric trees. Comput. Geom. 48(6), 479–494 (2015)
Har-Peled, S., Raichel, B.: The Fréchet distance revisited and extended. ACM Trans. Algorithms (TALG) 10(1), 1–22 (2014)
Har-Peled, S., Zhou, T.: How packed is it, really? CoRR (2021). arXiv:2105.10776
Leighton, F.T.: Introduction to parallel algorithms and architectures: Arrays \(\cdot \) trees \(\cdot \) hypercubes. Elsevier, Amsterdam (2014)
Narasimhan, G., Smid, M.: Geometric Spanner Networks. Cambridge University Press, Cambridge (2007)
Parhami, B.: Introduction to Parallel Processing: Algorithms and Architectures. Springer Science and Business Media, Berlin (2006)
Williams, V.V., Williams, R.R.: Subcubic equivalences between path, matrix, and triangle problems. J. ACM (JACM) 65(5), 1–38 (2018)
Zheng, Y., Li, Q., Chen, Y., Xie, X., Ma, W.Y.: Understanding mobility based on gps data. In Proceedings of the 10th International Conference on Ubiquitous Computing, pp. 312–321 (2008)
Zheng, Y., Xie, X., Ma, W.Y., et al.: Geolife: a collaborative social networking service among user, location and trajectory. IEEE Data Eng. Bull. 33(2), 32–39 (2010)
Zheng, Y., Zhang, L., Xie, X., Ma, W.Y.: Mining interesting locations and travel sequences from gps trajectories. In Proceedings of the 18th International Conference on World Wide Web, pp. 791–800 (2009)
Funding
V. Keikha was Supported by the Czech Science Foundation, Grant No. GJ19-06792Y, and with institutional support RVO:67985807.
Author information
Authors and Affiliations
Contributions
Sepideh Aghamolaei, Vahideh Keikha, Mohammad Ghodsi, and Ali Mohades contributed to writing, review, and editing. Sepideh Aghamolaei contributed to implementation. Mohammad Ghodsi and Ali Mohades contributed to supervision.
Corresponding author
Ethics declarations
Conflict of interest
The authors declare that they have no conflict of interest.
Code availability
Publicly available at https://github.com/saghamolaei/Packedness.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
About this article
Cite this article
Aghamolaei, S., Keikha, V., Ghodsi, M. et al. Sampling and sparsification for approximating the packedness of trajectories and detecting gatherings. Int J Data Sci Anal 15, 201–216 (2023). https://doi.org/10.1007/s41060-021-00301-0
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s41060-021-00301-0