简体   繁体   English

如何使用邻接矩阵检查两个图的同构?

[英]How to check for isomorphism of two graphs using adjacency matrix?

Is there any way to check for the isomorphism of two graphs using the adjacency matrix in a simple way?有没有办法以简单的方式使用邻接矩阵检查两个图的同构?

If it is, then please let me know...如果是的话,请告诉我...

No polynomial-time algorithm is known for this problem, though many instances can be solved quickly in practice using a tool like nauty .没有已知的多项式时间算法可以解决这个问题,尽管在实践中可以使用类似nauty的工具快速解决许多实例。

If they are isomorph only the labeling is different.如果它们是同构的,则只有标签不同。

So sorting the rows of the matrix (and accordingly reorder he columns also(if you swap rows, you also need to swap the columns)) should lead to two exact equal matrices, if the graphs are isomorph.因此,如果图形是同构的,则对矩阵的行进行排序(并相应地对列进行重新排序(如果交换行,还需要交换列))应该导致两个完全相等的矩阵。


If you compare a lot of not isomorph graphs, you should make some quick-checks first.如果你比较了很多非同构图,你应该先做一些快速检查。 Like:喜欢:

  • they need to have the same number of entries in both matrices他们需要在两个矩阵中具有相同数量的条目
  • same number of rows for the same number of entries in both matrices两个矩阵中相同数量的条目的相同行数

This way you can fail early (much cheaper than the sorting)这样你可以提前失败(比排序便宜得多)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM