Skip to content

Commit e84d0ea

Browse files
committed
Use a descriptive name instead of i
1 parent a7a7a44 commit e84d0ea

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎greedy_methods/greedy_set_cover.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ def greedy_set_cover(
6767
while elements_to_take:
6868
# forget the subsets that cover nothing new, so we never divide by 0
6969
not_chosen_subsets = {
70-
i for i in not_chosen_subsets if subsets[i] & elements_to_take
70+
index for index in not_chosen_subsets if subsets[index] & elements_to_take
7171
}
7272
index = min(
7373
not_chosen_subsets,
74-
key=lambda i: costs[i] / len(subsets[i] & elements_to_take),
74+
key=lambda index: costs[index] / len(subsets[index] & elements_to_take),
7575
)
7676
not_chosen_subsets.remove(index)
7777
chosen_subsets_indexes.add(index)

0 commit comments

Comments
 (0)