コード例 #1
0
def directed_adjacency_matrix(filename):
    with open(filename, 'r') as file:
        data = file.read()

        adj_matrix = parse_matrix(data)
        return Graph.from_adjacency_matrix(adj_matrix, is_directed=True)
コード例 #2
0
def adjacency_matrix(filename):
    with open(filename, 'r') as file:
        data = file.read()

        adj_matrix = parse_matrix(data)
        return Graph.from_adjacency_matrix(adj_matrix)