Data structure for fast line queries?

I know that I can use KD-Tree to store points and quickly iterate over a part close to another given point. I am wondering if there is something similar for strings.

Given the set of L lines in 3D (which will be stored in this data structure) and another “query line” q, I would like to quickly iterate over all lines in L that are “fairly close” to q. The distance I plan to use is the minimum Euclidean distance between two points u and v, where u is some point on the first line and v is some point on the second line. Calculating this distance is not a problem (there is a good trick involving cross-product).

Perhaps you have a good idea or know where to look for documents, descriptions, etc.

TIA, p.

+3
source share
2 answers

Another option — and most commonly used for spatial indexing on disk database systems — is R-Tree . This is a bit more difficult to implement than KD-Tree, but is generally considered faster and has no problems with line and polygon indices.

+4
source

You can also use KD-Trees.

KD-, , . , . , , .

, 100% - KD-Tree. , . , . "" , () (, ).

+3

Source: https://habr.com/ru/post/1718914/


All Articles