查找图中所有完整的子图
是否有已知的算法或方法来查找图中的所有完整子图?我有一个无向、未加权的图,我需要找到其中的所有子图,其中子图中的每个节点都连接到子图中的每个其他节点。
有现成的算法吗?
Is there a known algorithm or method to find all complete sub-graphs within a graph? I have an undirected, unweighted graph and I need to find all subgraphs within it where each node in the subgraph is connected to each other node in the subgraph.
Is there an existing algorithm for this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这被称为派系问题;这很困难,而且一般来说是 NP 完全的,是的,有很多算法可以做到这一点。
如果图具有额外的属性(例如,它是二分图),那么问题就会变得相当容易,并且可以在多项式时间内解决,但否则它就非常困难,并且仅对于小图才能完全解决。
来自维基百科
另请参阅
This is known as the clique problem; it's hard and is in NP-complete in general, and yes there are many algorithms to do this.
If the graph has additional properties (e.g. it's bipartite), then the problem becomes considerably easier and is solvable in polynomial time, but otherwise it's very hard, and is completely solvable only for small graphs.
From Wikipedia
See also
在大小为 n 的图中找到 k 顶点子图的问题很复杂
因为有
n^k
个子图需要检查,并且每个子图都有k^2
条边。您所要求的,查找图中的所有子图是一个 NP 完全问题,并在上面列出的 Bron-Kerbosch 算法中进行了解释。
Well the problem of finding a k-vertex subgraph in a graph of size n is of complexity
Since there are
n^k
subgraphs to check and each of them havek^2
edges.What you are asking for, finding all subgraphs in a graph is a NP-complete problem and is explained in the Bron-Kerbosch algorithm listed above.