3 ms·
This problem came up for me when writing a tool to help an author index his work. He wanted to be able to enter reference ranges for a term and then combine, in
by simpaticoder 2y ago
This problem came up for me when writing a tool to help an author index his work. He wanted to be able to enter reference ranges for a term and then combine, including disjoint ones, into a single entry. (There was also a roman numeral problem irrelevant here).
This has also come up for me in two dimensions when dealing with overlapping rectangles. For some reason the complexity of it surprised me both times. Sadly computing these cases is a straight-forward slog in 1-D; you can however reuse the solution for higher dimensions in a nice way.
- mikhailfranco 2y agoMost spatial databases use the R-Tree or one of its variants: https://en.wikipedia.org/wiki/R-tree https://en.wikipedia.org/wiki/R-tree e.g. PostGIS has GiST-RTree: https://postgis.net/docs/manual-3.2/using_postgis_dbmanagement.html#build-indexes https://postgis.net/docs/manual-3.2/using_postgis_dbmanageme...