消除图形的对称性
我有一个算法问题,其中我导出了许多状态之间的转移矩阵。下一步是对其求幂,但它非常大,所以我需要对其进行一些缩减。具体来说,它包含很多对称性。下面是一些关于通过简单观察可以消除多少个节点的示例。
我的问题是是否有一种算法可以有效消除有向图中的对称性,类似于我在下面手动完成的方式。
在所有情况下,所有节点的初始向量具有相同的值。
在第一个示例中,我们看到 b
、c
、d
和 e
都从 a 接收值
并且彼此之一。因此它们总是包含相同的值,我们可以合并它们。
在此示例中,我们很快发现,从 a、<代码>b、<代码>c和<代码>d。同样对于它们各自的侧节点来说,它附加到哪个内部节点并不重要。因此我们可以将图减少到只有两种状态。
更新: 有些人很合理,不太确定“状态转移”是什么意思矩阵”。这里的想法是,您可以将组合问题拆分为递归中每个 n
的多个状态类型。然后,矩阵会告诉您如何从 n-1
到 n
。
通常你只对其中一个状态的值感兴趣,但你也需要计算其他状态,这样你总是可以进入下一个级别。然而,在某些情况下,多个状态是对称的,这意味着它们始终具有相同的值。显然,计算所有这些是相当浪费的,因此我们希望缩小图,直到所有节点都是“唯一”的。
下面是示例 1 中简化图的传输矩阵的示例。
[S_a(n)] [1 1 1] [S_a(n-1)]
[S_f(n)] = [1 0 0]*[S_f(n-1)]
[S_B(n)] [4 0 1] [S_B(n-1)]
如有任何建议或论文参考,我们将不胜感激。
I have an algorithmic problem in which I have derived a transfer matrix between a lot of states. The next step is to exponentiate it, but it is very large, so I need to do some reductions on it. Specifically it contains a lot of symmetry. Below are some examples on how many nodes can be eliminated by simple observations.
My question is whether there is an algorithm to efficiently eliminate symmetry in digraphs, similarly to the way I've done it manually below.
In all cases the initial vector has the same value for all nodes.
In the first example we see that b
, c
, d
and e
all receive values from a
and one of each other. Hence they will always contain an identical value, and we can merge them.
In this example we quickly spot, that the graph is identical from the point of view of a
, b
, c
and d
. Also for their respective sidenodes, it doesn't matter to which inner node it is attached. Hence we can reduce the graph down to only two states.
Update: Some people were reasonable enough not quite sure what was meant by "State transfer matrix". The idea here is, that you can split a combinatorial problem up into a number of state types for each n
in your recurrence. The matrix then tell you how to get from n-1
to n
.
Usually you are only interested about the value of one of your states, but you need to calculate the others as well, so you can always get to the next level. In some cases however, multiple states are symmetrical, meaning they will always have the same value. Obviously it's quite a waste to calculate all of these, so we want to reduce the graph until all nodes are "unique".
Below is an example of the transfer matrix for the reduced graph in example 1.
[S_a(n)] [1 1 1] [S_a(n-1)]
[S_f(n)] = [1 0 0]*[S_f(n-1)]
[S_B(n)] [4 0 1] [S_B(n-1)]
Any suggestions or references to papers are appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
布伦丹·麦凯的 nauty ( http://cs.anu.edu.au/~bdm/nauty/ )是我所知道的计算图自同构的最好工具。计算图的整个自同构组可能成本太高,但您也许可以重用 McKay 的论文“实用图同构”(从 nauty 页面链接)中描述的一些算法。
Brendan McKay's nauty ( http://cs.anu.edu.au/~bdm/nauty/) is the best tool I know of for computing automorphisms of graphs. It may be too expensive to compute the whole automorphism group of your graph, but you might be able to reuse some of the algorithms described in McKay's paper "Practical Graph Isomorphism" (linked from the nauty page).
如果其他人感兴趣的话,我将根据 userOVER9000 建议添加一个额外的答案。
以下是通过
dreadnaut
工具在示例 2 上使用nauty
的示例。请注意,它建议连接示例 2 中的节点
0:3
(即a:d
)和4:7
(即e:h< /代码>。
nauty
算法没有详细记录,但作者将其描述为指数最坏情况,n^2
平均值。I'll just add an extra answer building on what userOVER9000 suggested, if anybody else are interested.
The below is an example of using
nauty
on Example 2, through thedreadnaut
tool.Notice it suggests joining nodes
0:3
which area:d
in Example 2 and4:7
which aree:h
.The
nauty
algorithm is not well documented, but the authors describe it as exponential worst case,n^2
average.计算对称性似乎是一个二阶问题。在第二张图中只取 a、b、c 和 d,就必须表达对称性
及其所有排列,或类似的排列。考虑添加第二个子图 a'、b'、c'、d'。同样,我们有对称性,但参数化不同。
对于计算人员(而不是数学人员)来说,我们可以这样表达问题吗?
?
Computing symmetries seems to be a bit of a second order problem. Taking just a,b,c and d in your second graph, the symmetry would have to be expressed
and all its permutations, or some such. Consider a second subgraph a', b', c', d' added to it. Again, we have the symmetries, but parameterised differently.
For computing people (rather than math people), could we express the problem like so?
?