def normalize_digraph(A):
    Dl = np.sum(A, 0)
    num_node = A.shape[0]
    Dn = np.zeros((num_node, num_node))
    for i in range(num_node):
        if (Dl[i] > 0):
            Dn[(i, i)] = (Dl[i] ** (- 1))
    AD = np.dot(A, Dn)
    return AD
def normalize_digraph(A):
    Dl = np.sum(A, 0)
    num_node = A.shape[0]
    Dn = np.zeros((num_node, num_node))
    for i in range(num_node):
        if (Dl[i] > 0):
            Dn[(i, i)] = (Dl[i] ** (- 1))
    AD = np.dot(A, Dn)
    return AD