Sam-Izdat / govote

voting system implementations for polling and prefential voting in golang
MIT License
26 stars 6 forks source link

Schulze method seems to give erroneous results when parallelized #5

Open Sam-Izdat opened 5 years ago

Sam-Izdat commented 5 years ago

@WIZARDISHUNGRY - I reverted schulze.go to its previous state before your commit, because I was getting erroneous poll results. I'm afraid I don't have time to investigate at the moment. The test on the main README gave the following output when parallelized:

[Memphis] [{Memphis 3} {Nashville 2} {Chattanooga 1} {Knoxville 0}]

The expected output is :

[Nashville] [{Nashville 3} {Chattanooga 2} {Knoxville 1} {Memphis 0}]

At a cursory glance, I don't know if this is maybe a race condition or a more trivial bug. Let me know if you figure out and I'll add the feature back. Thanks.

wizardishungry commented 5 years ago

how embarrassing; let me think about this 😞