The following program runs for a (very) long time:
from abcvoting.preferences import Profile
from abcvoting import abcrules
profile = Profile(num_cand=10)
profile.add_voter({0, 1, 2,3,4,5,6,7,8,9})
committeesize = 10
abcrules.compute_seqpav(profile, committeesize, resolute=False)
The problem is that with resolute=False all possible permutations of candidates are considered, to see if another committee can be found. This problem occurs in the implementation of all sequential rules.
The solution is to recognize that all candidates are equivalent and can be replaced with each other.
That is, all candidates are replaced by a placeholder (say A) and we store that the ballot consists of 10 copies of A. Only when outputting committees, we resolve the placeholders and replace them with all possible combinations of candidates (in case of the example, there is only one possibility).
Challenge: correctly use multi-sets instead of sets in all sequential algorithms.
The following program runs for a (very) long time:
The problem is that with
resolute=Falseall possible permutations of candidates are considered, to see if another committee can be found. This problem occurs in the implementation of all sequential rules.The solution is to recognize that all candidates are equivalent and can be replaced with each other.
That is, all candidates are replaced by a placeholder (say A) and we store that the ballot consists of 10 copies of A. Only when outputting committees, we resolve the placeholders and replace them with all possible combinations of candidates (in case of the example, there is only one possibility).
Challenge: correctly use multi-sets instead of sets in all sequential algorithms.