コード例 #1
0
def list2CG(l):
    """ convert list of edge presences/absences (0,1) to a compressed
    graph (CG) representation
    """
    n = scipy.sqrt(len(l))
    l = scipy.reshape(map(int, l), [n, n])
    G = bfu.adj2graph(l)
    return G
コード例 #2
0
ファイル: graphkit.py プロジェクト: sergeyplis/gunfolds
def list2CG(l):
    """ convert list of edge presences/absences (0,1) to a compressed
    graph (CG) representation
    """
    n = scipy.sqrt(len(l))
    l = scipy.reshape(map(int, l), [n, n])
    G = bfu.adj2graph(l)
    return G
コード例 #3
0
def fullG(n):
    A = [[1 for j in range(n)] for i in range(n)]
    return bfu.adj2graph(np.asarray(A))
コード例 #4
0
def emptyG(n):
    A = [[0 for j in range(n)] for i in range(n)]
    return bfu.adj2graph(np.asarray(A))
コード例 #5
0
ファイル: graphkit.py プロジェクト: sergeyplis/gunfolds
def fullG(n):
    A = [[1 for j in range(n)] for i in range(n)]
    return bfu.adj2graph(np.asarray(A))
コード例 #6
0
ファイル: graphkit.py プロジェクト: sergeyplis/gunfolds
def emptyG(n):
    A = [[0 for j in range(n)] for i in range(n)]
    return bfu.adj2graph(np.asarray(A))