Module fair

Source
Expand description

Contains FairElection plugin models, which rank entities using a fair weight, where each entity’s weight is derived from a list of contributors and their individual contributions.

In this model:

  • Each entity is represented as (entity, fair_weight).
  • The fair_weight itself is a collection of (contributor, contribution) pairs.
  • The plugin aggregates or evaluates these individual contributions according to its algorithm to produce a ranked output.

§Characteristics

  • Requires a list of entities with their fair weights as input.
  • Each fair weight preserves the granularity of individual contributions, unlike flat weights.
  • Produces a sorted list of entities, taking into account the distribution and magnitude of contributions.
  • Ideal for scenarios where fairness or proportional representation matters, rather than just total aggregated value.

§Example Flow

  1. Prepare a list of entities with their fair weights: [(entity1, [(c1, v1), (c2, v2)]), ...].
  2. Pass this list to a FairElection plugin model.
  3. The model computes a ranking based on the individual contributions within each fair weight and outputs entities in order.

Structs§

BalancedModel
The BalancedFair model evaluates candidates by combining both the total backing and the average backing per backer. This approach balances candidates who have a few very large backers versus those with many smaller backers.
MaxMinLoadModel
The Max-Min Load Fair model ranks candidates to achieve a fair distribution of influence among all backers. It selects candidates sequentially to minimize the maximum load any backer bears, ensuring no single backer is disproportionately overrepresented.
PhragmenModel
The Phragmen model ranks candidates based on fair distribution of voter/backer load. Each candidate has (Backer, Backed) pairs representing support, and the algorithm selects candidates sequentially to minimize the maximum load among all backers.
PhragmenModelConfig
Configuration for the PhragmenModel plugin model
ThresholdFairModel
Filters candidates whose total backing is below a configurable threshold.
ThresholdFairModelConfig
Defines the configuration for ThresholdFairModel election plugin.
TopDownFairModel
The TopDownFair model evaluates candidates based on the aggregate support they receive from external backers.