JUNG 中的树图(用于最短路径算法)
在询问有关最短路径算法的一些一般建议后(2D 路径点寻路:从 curLocation 到 targetLocation 的 WP 组合),然后询问更具体的实现(适用于 500 多个航点/节点的最短路径算法(例如 Dijkstra 算法)?)我决定使用 JUNG 库(http://jung.sf.net/)。
我现在的目标是通过使用点列表(大小约为 1000)中的任意点组合来获得从 A 点到 B 点的最短路径,其中每个点都直接连接到 x 距离内的所有点。< /strong>
为此,我需要设置一个树形图。我相信这是树形图实现的列表: http://jung.sourceforge.net/doc/api/edu/uci/ics/jung/graph/class-use/Hypergraph.html# edu.uci.ics.jung.algorithms.shortestpath
这是正确的吗?现在,所有这些实现都将自身限制为稀疏树图,但我必须创建一个相当密集的树图。
那么,我应该在 JUNG 中使用什么树图来实现我的目标?
After asking some general advice on shortest path algorithms (2D waypoint pathfinding: combinations of WPs to go from curLocation to targetLocation) and then asking about a more specific implementation (Shortest path algorithm (eg. Dijkstra's) for 500+ waypoints/nodes?) I have decided to use the JUNG library (http://jung.sf.net/).
My goal is now to get the shortest path from point A to point B by using any combination of points from a list of points (size ~1000) where each point is directly connected to all points that are within x distance.
For this, I need to setup a tree map. I believe that this is a list of tree map implementations: http://jung.sourceforge.net/doc/api/edu/uci/ics/jung/graph/class-use/Hypergraph.html#edu.uci.ics.jung.algorithms.shortestpath
Is that correct? Now, all these implementations limit themselves to sparse tree maps, yet I have to create a rather dense tree map.
So, what tree map should I use in JUNG to accomplish my goal?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为你的主要目标可以通过 JUNG 实现,但恕我直言,你需要过滤给定的“x”距离(我的意思是所有可能的节点到节点组合)。但是,除了下面给出的示例之外,我没有使用 JUNG 的最短路径算法的经验。
JUNG Framework 2.x GUI 示例使用来自 BFSDistanceLabeler 的最短路径算法,该算法需要通用的Hypergraph。它应用基于 BFS 距离的计算,而不是基于边缘权重的距离计算。不过,它是一种广度优先搜索(BFS)算法。
可以参考jung-samples-2.0.1.jar包edu.uci.ics.jung.samples下的源代码ShortestPathDemo.class strong>
我能找到的其他 JUNG 最短路径算法的最佳参考可以在这里找到 (PDF):
www.grotto-networking.com/JUNG/JUNG2-Tutorial.pdf
I think your main goal is achievable with JUNG but IMHO, you need to filter for your given "x" distance (I mean all possible node-to-node combinations). However, I have no experience in using JUNG's shortest path algorithms except in the example it gives below.
JUNG Framework 2.x GUI example uses a shortest-path algorithm from BFSDistanceLabeler that requires a generic Hypergraph. It applies a BFS distance-based calculation rather than edge weight-based distance calculation. It is a Breadth-first search (BFS) algorithm, though.
You can refer to the source code ShortestPathDemo.class under package edu.uci.ics.jung.samples in jung-samples-2.0.1.jar
The best reference I can find for other JUNG's shortest path algorithms can be found here (PDF):
www.grotto-networking.com/JUNG/JUNG2-Tutorial.pdf