图同构算法

发布于 2024-12-15 18:44:55 字数 202 浏览 1 评论 0原文

可能的重复:
图同构

是否有任何众所周知的图同构启发法。如果有人知道,请让我知道任何好的且易于理解的图同构算法。

Possible Duplicate:
Graph Isomorphism

Is there any good known heuristics for graph isomorphism. If some knows it please let me know also any good and easy to understand algorithm for graph isomorphism.

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

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

发布评论

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

评论(1

指尖上的星空 2024-12-22 18:44:55

检查不具有病态统一结构的图之间的同构性的简单但有效的方法是选取节点不变量,计算所有节点的不变量值,然后对实际同构执行(深度优先)搜索仅每个配对节点具有相同的节点不变量值。节点不变量的想法是,它是一个对象(通常是数字或数字序列),以完全独立于图的表示的方式计算节点;即在选择表示形式时它是不变的。

例如,节点具有的邻居数量是不变的,但程序迭代节点邻居的顺序并不取决于表示(数据结构)。

通常,节点不变量是迭代计算的,例如这个简单的不变量 I[n],其中 n 是节点,I[n] 是无符号 32 位整数:

for every node in graph:
  I[node] = count_neighbors(node)
for i = 0 .. N: # N is a constant, number of iterations
  for every node in graph:
    I'[node] = (I[node] << 13 | I[node] >> 19) ^ 0xff00ff00
    for every node' in neighbors(node):
      I'[node] += I[node']
  for every node in graph:
    I[node] = I'[node]

这些类型的不变量实际上以非均匀方式区分大多数节点图表,使搜索阶段在实践中变得更快。

The simple but efficient way for checking isomorphism between graphs that do not have pathologically uniform structure is to pick up a node invariant, calculate the value of the invariants for all the nodes, and then perform a (depth-first) search for the actual isomorphism only every pairing up nodes that have the same value for the node invariant. The idea of the node invariant that it's an object (usually number or sequence of numbers) that is calculated for nodes in a fashion that is totally independent of the representation of the graph; i.e. it's invariant under choosing a representation form.

For example, the number of neighbors a node has is an invariant, but the order in which your program iterates the neighbors of a node is not as that depends on representation (data structures).

Typically node invariants are calculated iteratively, e.g. this simple invariant I[n] where n is a node and I[n] is unsigned 32-bit integer:

for every node in graph:
  I[node] = count_neighbors(node)
for i = 0 .. N: # N is a constant, number of iterations
  for every node in graph:
    I'[node] = (I[node] << 13 | I[node] >> 19) ^ 0xff00ff00
    for every node' in neighbors(node):
      I'[node] += I[node']
  for every node in graph:
    I[node] = I'[node]

These types of invariants in practice distinguish most of the nodes from each other in non-uniform graphs, making the search phase quick in practice.

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