[EM] Schulze STV bugs and updated results (was: Re: Preliminary Droop-fit proportionality results)
Toby Pereira
tdp201b at yahoo.co.uk
Wed Jun 17 16:20:27 PDT 2026
Thanks to Kristofer for doing this extra work to sort out the error and apologies to Etjon for the result it caused!
Toby
On Wednesday, 17 June 2026 at 22:03:13 BST, Etjon Basha <etjonbasha at gmail.com> wrote:
Boo!
On Thu, 18 June 2026, 12:28 am Kristofer Munsterhjelm, <km-elmet at munsterhjelm.no> wrote:
On 2026-06-02 23:11, Toby Pereira wrote:
> I see yes, thanks. In that case, Schulze STV seems to do pretty
> terribly, not just a bit worse than other STV methods. And looking at
> your whole list, considerably worse than things like (Bloc) Borda! It's
> definitely not broken in your simulation?
I added some tests to Schulze STV and found an election where quadelect
would return the wrong outcome.
The bug appears to have been caused by undefined behavior in Schulze's
own code, where a line does something that has no clear order of
execution, and different compilers resolve the ambiguity differently. I
tested Schulze's prog01 compiled with a modern gcc and got the same bug.
After fixing the bug, I tested the example elections referenced in
"Implementing the Schulze STV Method"[1], table 2, and the Schulze STV
code used by my simulator now gives the correct outcome - i.e. the ones
listed in the paper - for all of them.
I then ran my multiwinner simulations and got much better results.
Sorry, Etjon :-)
Droop spatial proportionality:
Two seats, 10 candidates, 14400 elections:
Name Droop goodness-of-fit VSE
Meek/Warren 0.7932
Harmonic (S-L) 0.9254
Schulze STV 0.9997
Three seats:
Warren 0.8712
Meek 0.8713
Harmonic (S-L) 0.8925
Schulze STV 0.9992
Four seats:
Harmonic (S-L) 0.8880
Warren 0.9184
Meek 0.9185
Schulze STV 0.9954
Five seats:
Harmonic (S-L) 0.8809
Warren 0.9426
Meek 0.9428
Schulze STV 0.9874
Six seats:
Harmonic (S-L) 0.8779
Meek 0.9598
Warren 0.9598
Schulze STV 0.9758
Nine seats:
Harmonic (S-L) 0.9450
Schulze STV 0.9497
Meek 0.9979
Warren 0.9980
The quantile fits for two out of ten are (288k elections):
Name Prop. quantile Goodness-of-fit VSE
Schulze STV 0.3377 0.9961
Harmonic (S-L) 0.3498 0.9223
Meek/Warren 0.3344 0.8090
and for the 2-of-4 CFC-Kemeny comparison (5760 elections):
Name Prop. quantile Goodness-of-fit VSE
Harmonic (S-L) 0.3317 0.9414
Meek/Warren 0.3321 0.9602
Schulze STV 0.3345 0.9989
CFC-Kemeny 0.2493 0.9998
as well as 2-of-5 (7200 elections):
Name Prop. quantile Goodness-of-fit VSE
Meek/Warren 0.3346 0.9208
Harmonic (S-L) 0.3383 0.9294
CFC-Kemeny 0.2441 0.9967
Schulze STV 0.3371 0.9967
So Schulze STV seems to be pretty good, but its margin over other
methods shrinks as seats/candidates ratio increases, to the point where
Meek and Warren beats it with nine seats.
Perhaps this has something to do with how Schulze STV's main calculation
is on sets that differ by one candidate, that it then uses widest path
to extrapolate; if there are more winners, such paths may have more
steps. But I don't know for sure.
I also found a few crash-inducing memory access bugs in Schulze's
implementation, but the code is difficult enough to understand that I'm
unsure how to fix them. I'll probably give more details in another post.
-km
[1]
https://sites.math.duke.edu/~bray/Courses/49s/Additional%20Reading/Schulze/Schulze3/schulze3.pdf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.electorama.com/pipermail/election-methods-electorama.com/attachments/20260617/d54dfef4/attachment.htm>
More information about the Election-Methods
mailing list