You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -364,190 +364,248 @@ You can add or extend the selected and rejected sets dynamically:
364
364
Rules
365
365
-----
366
366
367
-
Rules are used to determine selections based on a profile. They all take a `max_size_selection` argument that indicates
368
-
the maximum number of alternatives that can be selected. Since ballots can indicate disapproval, rules need not select
369
-
exactly the desired number of alternatives.
367
+
Rules determine which alternatives are selected based on the preferences of voters expressed in a trichotomous profile
368
+
(approvals, neutral, disapprovals). All rules take a ``max_size_selection`` argument, indicating the maximum number of
369
+
alternatives that can be selected. Since ballots can include disapproval, rules are not required to select exactly that
370
+
number.
370
371
371
-
We try to always offer the possibility to ask for resolute or irresolute outcomes, via the `resoluteness` argument.
372
-
The tie breaking rule to use can typically be specified via the `tie_breaking`
373
-
argument (not all the rules support that). See the :py:mod:`~trivoting.tiebreaking` module for more information.
374
-
Initial selection can usually be passed to the rules via the `initial` argument. The rule then completes the initial
375
-
selection.
372
+
Most rules support the following common options:
376
373
377
-
Thiele Methods
378
-
^^^^^^^^^^^^^^
374
+
- ``resoluteness``: whether to return a single selection (``True``, default) or all tied optimal selections (``False``).
375
+
- ``tie_breaking``: tie-breaking rule, typically a function from the :py:mod:`~trivoting.tiebreaking` module.
376
+
- ``initial_selection``: a partially fixed selection, allowing some alternatives to be pre-selected or rejected.
379
377
380
-
The :py:func:`~trivoting.rules.thiele.thiele_method` function implements a general scheme to compute the outcome of a Thiele method
381
-
using Integer Linear Programming (ILP).
378
+
Thiele Rules
379
+
^^^^^^^^^^^^
382
380
383
-
As usual, you need to pass a trichotomous profile (implementing the :py:class:`~trivoting.election.trichotomous_profile.AbstractTrichotomousProfile` interface)
384
-
and specify the maximum number of alternatives to select. You also need an additional `ild_builder_class` argument
385
-
that takes a subclass of the abstract class :py:class:`~trivoting.rules.thiele.ThieleILPBuilder`.
381
+
We provide two implementations for Thiele rules: exact via ILP sovlers and sequential approximations.
386
382
387
-
.. code-block:: python
383
+
A Thiele rule is described via subclasses of the :py:class:`~trivoting.rules.thiele.ThieleScore` class.
384
+
The following scoring functions are currently available:
385
+
386
+
- :py:class:`~trivoting.rules.thiele.PAVScoreKraiczy2025`: PAV rule combining approvals and implicit support from disapprovals of unselected options.
387
+
- :py:class:`~trivoting.rules.thiele.PAVScoreTalmonPaige2021`: PAV with negative contributions for disapproved but selected alternatives.
388
+
- :py:class:`~trivoting.rules.thiele.PAVScoreHervouin2025`: PAV variant combining approval satisfaction and mitigation of disapproval.
389
+
- :py:class:`~trivoting.rules.thiele.ApprovalThieleScore`: Simplified Thiele rule maximizing total approvals.
390
+
- :py:class:`~trivoting.rules.thiele.NetSupportThieleScore`: Thiele rule maximizing net support (approvals minus disapprovals).
388
391
389
-
from trivoting.rules import thiele_method, PAVILPKraiczy2025
The :py:func:`~trivoting.rules.thiele.thiele_method` function implements a general Thiele rule scheme using an Integer
396
+
Linear Programming (ILP) solver.
392
397
393
-
print(result)
398
+
You must provide:
394
399
395
-
By default, the function returns a single optimal selection (resolute). To retrieve all optimal selections (if multiple exist), set `resoluteness=False`.
400
+
- a trichotomous profile (implementing :py:class:`~trivoting.election.trichotomous_profile.AbstractTrichotomousProfile`),
401
+
- a ``max_size_selection``, and
402
+
- a subclass of :py:class:`~trivoting.rules.thiele.ThieleScore` via the argument ``thiele_score_class``.
These rules also support tie breaking mechanisms and resoluteness.
444
460
461
+
Max Net Support Rule
462
+
^^^^^^^^^^^^^^^^^^^^
445
463
446
-
By default, the function returns a single optimal selection (resolute). To retrieve all optimal selections (if multiple exist), set `resoluteness=False`.
464
+
The :py:func:`~trivoting.rules.max_net_support.max_net_support` rule returns selectionsm aximising the total net support,
465
+
that is, the sum over all voters of the number of approved and selected alternatives minus the number of disapproved and selected ones.
The :py:func:~`trivoting.rules.chamberlin_courant.chamberlin_courant` function implements the Chamberlin–Courant rule for trichotomous preferences.
553
+
It computes selections that maximizes the number of covered voters, that is, voters who have strictly more approved and selected alternatives than disapproved and selected ones.
554
+
555
+
The outcome of the rule is computed through an ILP solver.
0 commit comments