简体   繁体   English

存放最近的邻居

[英]Storing nearest neighbor

There are algorithms out there to find k nearest neighbors in many ways. 有很多算法可以找到k最近的邻居。 I am eventually will have to apply these, however in my case, I can code my program to add points one-by-one rather than add all the points altogether, then run a algorithm. 我最终将不得不应用这些,但是,在我的情况下,我可以对程序进行编码以逐个添加点,而不是完全添加所有点,然后运行算法。 Is this make the problem easier, so that maybe I could use a tree, and add each node to a neighborhood tree or something. 这会使问题变得更容易了,所以也许我可以使用一棵树,并将每个节点添加到邻域树之类的东西。 This seems like it would be faster than searching all the points linearly. 这似乎比线性搜索所有点要快。

And in my program points will be moving constantly, so I will be required to update neighbors, that's why I thought it is better to use a tree or another construct to update records, rather than calculate nearest neighbors in every movement of these points. 而且在我的程序中,点将不断移动,因此将要求我更新邻居,这就是为什么我认为最好使用树或其他构造来更新记录,而不是在这些点的每次移动中都计算最近的邻居。 Do you know of such data structure ? 您知道这样的数据结构吗?

Maybe a graph datastructure/database is most appropriate due to the structural similarity. 由于结构相似性,也许图形数据结构/数据库最合适。 Example: https://neo4j.com/graphgist/a7c915c8-a3d6-43b9-8127-1836fecc6e2f (I do not work for neo4j) 例如: https ://neo4j.com/graphgist/a7c915c8-a3d6-43b9-8127-1836fecc6e2f(我不适用于neo4j)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM