图的团数

发布于 2024-09-04 20:33:14 字数 203 浏览 3 评论 0原文

我想知道一种快速算法来仅查找具有大约 100 个顶点的图的团数(而不实际找到团)。

我正在尝试解决以下问题。 http://uva.onlinejudge.org/external/1/193.html

I would like to know a fast algorithm to find only the clique number(without actually finding the clique) of a graph with about 100 vertices.

I am trying to solve the following problem.
http://uva.onlinejudge.org/external/1/193.html

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

潦草背影 2024-09-11 20:33:14

这是 NP 完全的,没有比实际找到最大团并计算其顶点更好的了。来自维基百科

派系问题包括:

  • 解决测试图是否包含大于N的团的决策问题

这些问题都很困难:派系决策问题是 NP 完全问题(卡普的 21 个 NP 完全问题之一),

如果您可以在 P 中找到派系数,则决策问题可以在 P 中解答(您只需计算派系数并进行比较与N)。

由于决策问题是NP-Complete,因此找到一般图的派系数必然是NP-Hard

This is NP-complete, and you can't do it much better than actually finding the maximum clique and counting its vertices. From Wikipedia:

Clique problems include:

  • solving the decision problem of testing whether a graph contains a clique larger than N

These problems are all hard: the clique decision problem is NP-complete (one of Karp's 21 NP-complete problems),

If you can find the clique number in P, then the decision problem is answerable in P (you simply compute the clique number and compare it with N).

Since the decision problem is NP-Complete, finding the clique number of a general graph must be NP-Hard.

迷离° 2024-09-11 20:33:14

正如其他人已经说过的,这可能真的很难。

但就像许多理论上的难题一样,只要有好的算法和合适的数据,在实践中它可以很快。如果您实现类似 Bron-Kerbosch 的方法来查找派系,同时跟踪迄今为止发现的最大派系规模,那么您可以从无结果的搜索树中回溯。

例如,如果您发现一个有 20 个节点的派系,并且您的网络有大量度数小于 20 的节点,您可以立即排除这些节点,不再考虑。另一方面,如果度分布更均匀,那么这可能与找到所有派系一样慢。

As already stated by others, this is probably really hard.

But like many theoretically hard problems, it can be pretty fast in practice with a good algorithm and suitable data. If you implement something like Bron-Kerbosch for finding cliques, while keeping track of the largest clique size you've found so far, then you can backtrack out of fruitless search trees.

For example, if you find a clique with 20 nodes in it, and your network has a large number of nodes with degree less than 20, you can immediately rule out those nodes from further consideration. On the other hand, if the degree distribution is more uniform, then this might be as slow as finding all the cliques.

甜妞爱困 2024-09-11 20:33:14

尽管问题是 NP 难题,但对于当今最快的最大团精确求解器(对于任何配置)来说,您提到的图的大小不是任何问题。

如果您准备好实现代码,那么我建议您阅读与算法系列 MCQ、MCR 和 MCS 以及系列 BBMC、BBMCL 和 BBMCX 有关的论文。一个有趣的起点是 Prosser [Prosser 12] 的比较调查。它包括对这些算法的 Java 实现的解释。

Although the problem is NP-hard, the size of graph you mention is not any problem for today´s fastest maximum clique exact solvers (for any configuration).

If you are ready to implement the code then I recommend you read the papers connected with the family of algorithms MCQ, MCR and MCS, as well as the family BBMC, BBMCL and BBMCX. An interesting starting point is the comparison survey by Prosser [Prosser 12]. It includes explanation for a Java implementation of these algorithms.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文