voting-tools / pref_voting

pref_voting is a Python package that can be used to study and run elections with different preferential voting methods (graded voting methods and cardinal voting methods are also included for comparison).
https://pref-voting.readthedocs.io/
MIT License
11 stars 4 forks source link

Faster implementation of Kendall tau distances #62

Closed DominikPeters closed 7 months ago

DominikPeters commented 7 months ago

One can speed up the computation (by about 10x) of KT distances by using the definition of itertools.combinations which respects the ordering of the iterator it is passed. See https://gist.github.com/DominikPeters/92abecfc7c1ee0396ef7b0d42c3c7685

epacuit commented 7 months ago

Great! Thanks.