def add_edge(self, edge):
    assert isinstance(edge, Edge)
    key = edge.get_id()
    assert (key not in self.all_edges), ('key %d for edge already present' % key)
    self.all_edges[key] = edge
def add_edge(self, edge):
    assert isinstance(edge, Edge)
    key = edge.get_id()
    assert (key not in self.all_edges), ('key %d for edge already present' % key)
    self.all_edges[key] = edge