Skip to content

SchulzePR bug with ties #15

@itamaro

Description

@itamaro

It seems SchulzePR is misbehaving, at least with the ballot input I have "engineered":

Python 2.7.4 (default, Apr 19 2013, 18:28:01) 
[GCC 4.7.3] on linux2
>>> from pyvotecore.schulze_pr import SchulzePR
>>> b=[{'count': 1, 'ballot': [[1, 2, 3, 4], [0]]},
       {'count': 1, 'ballot': [[3], [0, 1, 2, 4]]},
       {'count': 1, 'ballot': [[0], [1, 2, 3, 4]]}]
>>> SchulzePR(b, ballot_notation="grouping").as_dict()
{'tie_breaker': [4, 0, 3, 1, 2],
 'candidates': set([0, 1, 2, 3, 4]),
 'order': [3, 0, 4, 1, 2],
 'rounds': [{'winner': 3},
            {'winner': 0},
            {'winner': 4},
            {'winner': 1, 'tied_winners': set([1, 2])},
            {'winner': 2}]}

The anomaly, as I see it, lies in the fact that in the ballot the candidates 1, 2 and 4 are always in the same group, so essentially they must be also grouped together in the results. But in the output you can see that for some reason candidate 4 is above candidates 1 and 2 that are tied.

Am I missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions