我有一个15M(百万)DAG(有向无环图 - 实际上是指向超立方体)的集合,我想从中删除同构.这个的常见算法是什么?每个图都相当小,一个维数为N的混合立方体,其中N为3到6(现在),得到64个节点的图,每个节点为N = 6的情况.
使用networkx和python,我实现了它,这适用于300k(千)的小集合就好(几天后运行).
def isIsomorphicDuplicate(hcL, hc):
"""checks if hc is an isomorphism of any of the hc's in hcL
Returns True if hcL contains an isomorphism of hc
Returns False if it is not found"""
#for each cube in hcL, check if hc could be isomorphic
#if it could be isomorphic, then check if it is
#if it is isomorphic, then return True
#if all comparisons have been made already, then it is not an isomorphism and …Run Code Online (Sandbox Code Playgroud)