def __init__(self, graph: DirectedGraph):
        self.matrix = []
        for i in range(len(graph.get_nodes())):
            self.matrix.append([0 for j in range(len(graph.get_edges()))])

        for edge_idx, edge in enumerate(graph.get_edges()):
            nodes_ids = edge.get_nodes_ids()
            self.matrix[nodes_ids[0].get_id()][edge_idx] = -1
            self.matrix[nodes_ids[1].get_id()][edge_idx] = 1
    def __init__(self, graph: DirectedGraph) -> None:
        self.list = {key: [] for key in range(len(graph.get_nodes()))}

        for edge in graph.get_edges():
            nodes = edge.get_nodes_ids()
            self.list[nodes[0].get_id()].append(nodes[1].get_id())