Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Schulze method
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Implementation == The only difficult step in implementing the Schulze method is computing the strongest path strengths. However, this is a well-known problem in graph theory sometimes called the [[widest path problem]]. One simple way to compute the strengths, therefore, is a variant of the [[Floyd–Warshall algorithm]]. The following [[pseudocode]] illustrates the algorithm.<syntaxhighlight line="" lang="text"> # Input: d[i,j], the number of voters who prefer candidate i to candidate j. # Output: p[i,j], the strength of the strongest path from candidate i to candidate j. for i from 1 to C for j from 1 to C if i ≠ j then if d[i,j] > d[j,i] then p[i,j] := d[i,j] else p[i,j] := 0 for i from 1 to C for j from 1 to C if i ≠ j then for k from 1 to C if i ≠ k and j ≠ k then p[j,k] := max (p[j,k], min (p[j,i], p[i,k])) </syntaxhighlight>This algorithm is [[P (complexity)|efficient]] and has [[Time complexity|running time]] [[Big O notation|O(''C''<sup>3</sup>)]] where ''C'' is the number of candidates.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)