Fill from root committee

This commit is contained in:
danielsanchezq 2023-06-30 09:14:47 +02:00
parent ab8c76588c
commit 6475ae66d4

View File

@ -36,9 +36,8 @@ class CarnotTree:
for n in range(0, number_of_committees)
]
# refill committees with extra nodes,
# we fill the leafs first as they are the least important
if remainder != 0:
cycling_committees = itertools.cycle(reversed(committees))
cycling_committees = itertools.cycle(committees)
for node in nodes[-remainder:]:
next(cycling_committees).add(node)
committees = [frozenset(s) for s in committees]