diff --git a/2020/sketch_2020_08_08a/graph.py b/2020/sketch_2020_08_08a/graph.py index 2c14981b..b566b314 100644 --- a/2020/sketch_2020_08_08a/graph.py +++ b/2020/sketch_2020_08_08a/graph.py @@ -289,8 +289,8 @@ class Graph(object): graph.add_vertex(v) if random(1) < connect_rate: if allow_loops: - names = list(vertices) + pool = list(vertices) else: - names = list(vertices - set(v)) - graph.add_edge({v, choice(names)}) + pool = list(vertices - set((v,))) + graph.add_edge({v, choice(pool)}) return graph