图中的子图

发布于 2024-10-24 02:45:53 字数 82 浏览 9 评论 0原文

我有一个主图和另一个小图,假设小图可以在主图中作为具有一定相似度的子图重复(不一定是相同的小图) 有什么好的算法(或 Java 库)可以找到它们?

I have a main graph and another small graph, suppose that the small graph could be repeated in the main graph as a subgraph with a degree of similarity(not necessarily the same small graph)
What's a good algorithm (or Java library) to find them all?

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

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

发布评论

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

评论(1

狼性发作 2024-10-31 02:45:53

我认为您正在尝试解决已知为 NP 完全的 子图同构问题。这意味着,可能没有快速算法可以满足您的需求。您对相似性(而不仅仅是同构)的要求只会增加另一种复杂性。

维基百科页面讨论了乌尔曼算法,该算法可以在多项式时间内(快速)针对某些类别的图解决此问题,您可以尝试一下。

I think you are trying to solve the Subgraph Isomorphism Problem which is known to be NP-complete. That means, there is likely no fast algorithm to do what you need. Your requirement of similarity (and not only isomorphism) only adds another complexity.

The Wikipedia page talks about Ulmann's algorithm that solves this problem in polynomial time (fast) for certain classes of graphs, you might give it a try.

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