图论:找到乔丹中心?
我试图找到一组顶点,使它们与加权图上其他顶点的距离最小。根据粗略的维基百科搜索,我认为这被称为乔丹中心。有哪些好的算法可以找到它?
现在,我的计划是获取从给定顶点发出的每个分支的权重列表。权重相对差异最小的顶点将是中心顶点。还有其他想法吗?
我正在使用 Java,但有用的答案不一定需要特定于 Java。
I'm trying to find the set of vertices that minimizes their distance to other vertices on a weighted graph. Based on a cursory wikipedia search, I think that this is called the Jordan Center. What are some good algorithms for finding it?
Right now, my plan is to get a list of the weight for each branch emanating from a given vertex. The vertices whose weights have the smallest relative difference will be the central ones. Any other ideas?
I'm using Java, but helpful answers don't necessarily need to be Java specific.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我首先使用 Dijkstra 算法(必须为每个顶点运行)来计算最短所有顶点对之间的距离 - 还有一些更有效的算法,例如 Floyd-Warshall。然后,对于每个顶点 V,您必须找到 Vm - 从 Dijkstra 算法返回的数据中到任何其他顶点的最大距离。那么,具有最小 Vm 的顶点就是图中心的顶点。伪代码:
}
I woluld first use Dijkstra algorithm (it has to be run for each verticle) for computng shortest distances between all pairs of verticles - there are also some more efficient algorithms for that like Floyd-Warshall. Then for each verticle V you have to find Vm - the largest distance to any other verticles amongs the data retuirned form Dijkstra algorithm. Then, the verticles with the smallest Vm are the one in the graph center. Pseudocode:
}
本硕士论文提出了三种图中心问题的算法:图中心问题的分布式算法。
Three algorithms for graph center problem are presented in this MSc thesis: A distributed algorithm for the graph center problem.
从 JGraphT 1.1.0 版本开始,您只需使用 GraphMeasurer.getGraphCenter() 方法即可。底层代码使用最短路径方法。用户可以根据图的某些特征(例如稀疏/密集/...)选择使用哪种方法。
Starting from JGraphT version 1.1.0, you can simply use the method
GraphMeasurer.getGraphCenter()
. The underlying code uses a shortest path method. The user can choose which method to use, depending on some characteristics of the graph (e.g. sparse/dense/...).