Skip to content

Commit 7761416

Browse files
authored
Less clutter
1 parent 4da4fb1 commit 7761416

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

Diff for: graphs/karger.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,7 @@ def partition_graph(graph: Dict[str, List[str]]) -> Set[Tuple[str, str]]:
6060
for neighbor in uv_neighbors:
6161
graph_copy[neighbor].append(uv)
6262

63-
contracted_nodes[uv] = {
64-
contracted_node
65-
for contracted_node in contracted_nodes[u].union(contracted_nodes[v])
66-
}
63+
contracted_nodes[uv] = {node for node in contracted_nodes[u].union(contracted_nodes[v])}
6764

6865
# Remove nodes u and v.
6966
del graph_copy[u]

0 commit comments

Comments
 (0)