简体   繁体   English

建立建筑物室内图以实现路径寻找的有效方法?

[英]Efficient way to build an indoor graph of a building to implement path finding?


Lets say, my data set is a shopping mall. 可以说,我的数据集是一个购物中心。
I have to build a graph for it. 我必须为它构建一个图表。 Whenever asked, I have to generate a path (shortest path) from one shop to another. 每当被问到,我必须从一个商店到另一个商店生成一条路径(最短路径)。
Now my question is, 现在我的问题是,

  1. Is it efficient to build a graph of the whole building and generate the path? 构建整个建筑的图形并生成路径是否有效?

  2. Or build a graph (something like a subgraph) between only the 2 nodes and all its connectors (edges) when a user needs to find the path? 或者,当用户需要查找路径时,仅在2个节点及其所有连接器(边缘)之间构建图形(类似子图)?

I have to implement this for a mobile application where all the data is loaded from a server. 我必须为移动应用程序实现这一点,其中所有数据都是从服务器加载的。
My current code builds the whole graph. 我当前的代码构建了整个图形。 But I want to use this as a library for future use. 但是我想将它用作未来使用的库。
If it is only for the current building, then it works fine. 如果它仅适用于当前建筑物,那么它可以正常工作。
But assuming that in the future another type of data set is used which is way too big that the current one, then which one of these methods is more efficient? 但假设将来会使用另一种类型的数据集,这种数据集太大而不是当前的数据集,那么这些方法中的哪一种更有效?
These are the only 2 ways I can think of implementing it. 这是我能想到实现它的两种方法。 If there is any other solution then that would be highly appreciated! 如果有任何其他解决方案,那将非常感谢!

Secondly, I am using Dijkstra's Algorithm for path finding, is that suitable for this kind of a case? 其次,我使用Dijkstra的算法进行路径寻找,是否适合这种情况?

Any help would be highly appreciated, 任何帮助将受到高度赞赏,

Thanks. 谢谢。

  1. Is it efficient to build a graph of the whole building and generate the path? 构建整个建筑的图形并生成路径是否有效?
  2. Or build a graph (something like a subgraph) between only the 2 nodes and all its connectors (edges) when a user needs to find the path? 或者,当用户需要查找路径时,仅在2个节点及其所有连接器(边缘)之间构建图形(类似子图)?

If the graph is known a priori, the most efficient solution, in regards to query times, will be to generate the whole graph and preprocess it. 如果图是先验已知的,则关于查询时间的最有效解决方案是生成整个图并对其进行预处理。 Then, you will query the contracted graph and have a very fast query time. 然后,您将查询合同图并具有非常快的查询时间。 Look for example at Contraction hierarchies , since it is one of the most widely used techniques. Contraction层次结构中查找示例,因为它是最广泛使用的技术之一。 Otherwise, when the graph has to be built in runtime, I think it is what you mean with your second point, you could use A* or bidirectional Dijkstra. 否则,当图形必须在运行时构建时,我认为这就是你的第二点,你可以使用A *或双向Dijkstra。 In the first one I guess the best heuristic you can come up is the straight line distance, so probably not very helpful. 在第一个我认为你可以提出的最好的启发式是直线距离,所以可能不是很有帮助。

Secondly, I am using Dijkstra's Algorithm for path finding, is that suitable for this kind of a case? 其次,我使用Dijkstra的算法进行路径寻找,是否适合这种情况?

Yes it is, but I would always use bidirectional Dijkstra, it's not difficult to implement and, generally, a great improvement in time requirements over unidirectional Djikstra. 是的,但是我总是使用双向Dijkstra,实现并不困难,并且通常比单向Djikstra的时间要求有很大改进。 Some related questions in SO: 1 , 2 在SO一些相关的问题: 12

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

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