def __init__(self, vertices = Vertices(), edges = Edges()): self.vertices = vertices self.edges = edges self.adjacency = {} for v in vertices: self.adjacency[v] = Neighbors.get(v, edges)
def __init__(self, graph): self.alist = {} for v in graph.vertices: self.alist[v] = Neighbors.get(v, graph.edges)