예제 #1
0
def full_isomorphism(xgr1, xgr2):
    """ full graph isomorphism
    """
    assert xgr1 == explicit(xgr1) and xgr2 == explicit(xgr2)
    nxg1 = _networkx.from_graph(xgr1)
    nxg2 = _networkx.from_graph(xgr2)
    iso_dct = _networkx.isomorphism(nxg1, nxg2)
    return iso_dct
예제 #2
0
def full_isomorphism(gra1, gra2):
    """ full graph isomorphism
    """
    assert gra1 == explicit(gra1) and gra2 == explicit(gra2)
    nxg1 = _networkx.from_graph(gra1)
    nxg2 = _networkx.from_graph(gra2)
    iso_dct = _networkx.isomorphism(nxg1, nxg2)
    return iso_dct
예제 #3
0
def backbone_isomorphism(xgr1, xgr2):
    """ graph backbone isomorphism

    for implicit graphs, this is the relabeling of `xgr1` to produce `xgr2`
    for other graphs, it gives the correspondences between backbone atoms
    """
    xgr1 = implicit(xgr1)
    xgr2 = implicit(xgr2)
    nxg1 = _networkx.from_graph(xgr1)
    nxg2 = _networkx.from_graph(xgr2)
    iso_dct = _networkx.isomorphism(nxg1, nxg2)
    return iso_dct
예제 #4
0
파일: _graph.py 프로젝트: sjklipp/autochem
def _isomorphism(gra1, gra2, igraph=False):
    """
    """
    if igraph:
        igr1 = _igraph.from_graph(gra1)
        igr2 = _igraph.from_graph(gra2)
        iso_dcts = _igraph.isomorphisms(igr1, igr2)
        iso_dct = iso_dcts[0] if iso_dcts else None
    else:
        nxg1 = _networkx.from_graph(gra1)
        nxg2 = _networkx.from_graph(gra2)
        iso_dct = _networkx.isomorphism(nxg1, nxg2)
    return iso_dct
예제 #5
0
파일: _graph.py 프로젝트: sjklipp/autochem
def full_isomorphism(gra1, gra2, igraph=False):
    """ full graph isomorphism
    """
    assert gra1 == explicit(gra1) and gra2 == explicit(gra2)
    if igraph:
        igr1 = _igraph.from_graph(gra1)
        igr2 = _igraph.from_graph(gra2)
        iso_dcts = _igraph.isomorphisms(igr1, igr2)
        iso_dct = iso_dcts[0] if iso_dcts else None
    else:
        nxg1 = _networkx.from_graph(gra1)
        nxg2 = _networkx.from_graph(gra2)
        iso_dct = _networkx.isomorphism(nxg1, nxg2)
    return iso_dct
예제 #6
0
def backbone_isomorphism(gra1, gra2, igraph=False):
    """ graph backbone isomorphism

    for implicit graphs, this is the relabeling of `gra1` to produce `gra2`
    for other graphs, it gives the correspondences between backbone atoms
    """
    gra1 = implicit(gra1)
    gra2 = implicit(gra2)
    if igraph:
        igr1 = _igraph.from_graph(gra1)
        igr2 = _igraph.from_graph(gra2)
        iso_dcts = _igraph.isomorphisms(igr1, igr2)
        iso_dct = iso_dcts[0] if iso_dcts else None
    else:
        nxg1 = _networkx.from_graph(gra1)
        nxg2 = _networkx.from_graph(gra2)
        iso_dct = _networkx.isomorphism(nxg1, nxg2)
    return iso_dct