User:BenBE/Schulze method: Difference between revisions

From Rosetta Code
Content added Content deleted
(First try for the task)
 
mNo edit summary
Line 1: Line 1:
{{task}}The Debian developer team has long been thinking of establishing a new team of people that should review community feedback and forward sensible suggestions to the developers so they would get less infeasable requests and more tasks they really should do to further their goals.
{{task}}The Debian developer team has long been thinking of establishing a new team of people that should review community feedback and forward sensible suggestions to the developers so they would get less infeasable requests and more tasks they really should do to further their goals.


As there were many more developers willing to listen to the community and communicate the good ideas to their fellow workmates the developers decided on doing an election as it usually is helt when electing people for posts to fill. And so they announced they are going to have an alection according to the following procedure [http://www.debian.org/vote/2003/vote_0002 Debian voting procedure]:
As there were many more developers willing to listen to the community and communicate the good ideas to their fellow workmates the developers decided on doing an election as it usually is helt when electing people for posts to fill. And so they announced they are going to have an alection following the usual [http://www.debian.org/vote/2003/vote_0002 Debian voting procedure]:


# Each voter's ballot ranks the options being voted on. Not all options need be ranked. Ranked options are considered preferred to all unranked options. Voters may rank options equally. Unranked options are considered to be ranked equally with one another. [...]
# Each voter's ballot ranks the options being voted on. Not all options need be ranked. Ranked options are considered preferred to all unranked options. Voters may rank options equally. Unranked options are considered to be ranked equally with one another. [...]

Revision as of 01:16, 23 July 2011

Task
BenBE/Schulze method
You are encouraged to solve this task according to the task description, using any language you may know.

The Debian developer team has long been thinking of establishing a new team of people that should review community feedback and forward sensible suggestions to the developers so they would get less infeasable requests and more tasks they really should do to further their goals.

As there were many more developers willing to listen to the community and communicate the good ideas to their fellow workmates the developers decided on doing an election as it usually is helt when electing people for posts to fill. And so they announced they are going to have an alection following the usual Debian voting procedure:

  1. Each voter's ballot ranks the options being voted on. Not all options need be ranked. Ranked options are considered preferred to all unranked options. Voters may rank options equally. Unranked options are considered to be ranked equally with one another. [...]
  2. [...]
  3. Any (non-default) option which does not defeat the default option by its required majority ratio is dropped from consideration.
    1. Given two options A and B, V(A,B) is the number of voters who prefer option A over option B.
    2. An option A defeats the default option D by a majority ratio N, if V(A,D) is strictly greater than N * V(D,A).
    3. If a supermajority of S:1 is required for A, its majority ratio is S; otherwise, its majority ratio is 1.
  4. From the list of undropped options, we generate a list of pairwise defeats.
    1. An option A defeats an option B, if V(A,B) is strictly greater than V(B,A).
  5. From the list of [undropped] pairwise defeats, we generate a set of transitive defeats.
    1. An option A transitively defeats an option C if A defeats C or if there is some other option B where A defeats B AND B transitively defeats C.
  6. We construct the Schwartz set from the set of transitive defeats.
    1. An option A is in the Schwartz set if for all options B, either A transitively defeats B, or B does not transitively defeat A.
  7. If there are defeats between options in the Schwartz set, we drop the weakest such defeats from the list of pairwise defeats, and return to step 5.
    1. A defeat (A,X) is weaker than a defeat (B,Y) if V(A,X) is less than V(B,Y). Also, (A,X) is weaker than (B,Y) if V(A,X) is equal to V(B,Y) and V(X,A) is greater than V(Y,B).
    2. A weakest defeat is a defeat that has no other defeat weaker than it. There may be more than one such defeat.
  8. If there are no defeats within the Schwartz set, then the winner is chosen from the options in the Schwartz set. If there is only one such option, it is the winner. If there are multiple options, the elector with the casting vote chooses which of those options wins.

Unfortunately noone of the management had any time to spare for counting the ballots for the poor developers after the election as they had just too many candidates, a much to big community and too much own work on their desks. Also they wanted to get the winning team quickly. So they were looking to automatically get the ranking given all the (digitized) ballots or accumulated rankings (i.e. number of ballots with a given variant of ranking).


Examples: