News for hackers. Stuff that matters.
Re:An Interactive Explanation of Quadtrees by jandrewrogers on Tuesday February 14, 2023 @07:51PM (#34798530)
Quadtrees have the distinction of being the simplest space decomposition data structures that also manifest every pathology and difficulty of said data structures. It is a great data structure to study for this reason.

While they work well in some applications, many people opt for one of two algorithm selection strategies as an alternative. First, select a more narrowly tailored algorithm that fits their application domain and requirements but avoiding many of the pathologies, giving up some generality but retaining the simplicity. R-trees are arguably an example of this (albeit a bit more complex). Second is to use more exotic and complex space decomposition algorithms that are significantly more difficult to implement in practical systems but retain at least as much generality while mitigating or eliminating most pathological cases.

A quadtree isn't a local maxima in the algorithm phase space in the same way a b+tree is.

Re:An Interactive Explanation of Quadtrees by heisjustsosmart on Saturday February 18, 2023 @01:35PM (#34849630)
What pathology and difficulty?

"Second is to use more exotic and complex space decomposition algorithms"

these being what

What is this: "algorithm phase space"

Re:An Interactive Explanation of Quadtrees by jandrewrogers on Sunday February 19, 2023 @05:54PM (#34862731)
Quadtrees have exceptional scalability but also notorious issues with space complexity and selectivity for some common data models.

Space complexity is unbounded space for non-scalar types, hence why r-trees are used in practice for things like polygons. They have poor search selectivity as a function of index size for many data models, quasi-monotonic data like time-series being an extreme case. In alternative algorithms that try to preserve scalability, these issues are handled via a combination compressing out non-selective branches of the index, for which there are many techniques in literature with various tradeoffs when applied to space decomposition, and by embedding the data model into a higher dimensionality index of a similar type, allowing the algorithm to be selective on additional properties of the data not for the purpose of search but to cause the data to organize in such a way that it is more resistant to manifesting selectivity and space complexity issues.

There are hundreds of described spatial indexing algorithms in literature that tackle the selectivity and space complexity issues in various ways, often by sacrificing the natural scalability of quadtrees in various ways. The space of possible algorithm designs with interesting tradeoffs is very large but bounded. Hanan Samet's canonical text on the algorithm design space weighs in at over a thousand pages and still doesn't cover the full scope of notable algorithm design clusters in public literature.