Module sp_npos_elections::balancing
source · Expand description
Balancing algorithm implementation.
Given a committee A and an edge weight vector w, a balanced solution is one that
- it maximizes the sum of member supports, i.e
Argmax { sum(support(c)) }. for allcinA. - it minimizes the sum of supports squared, i.e
Argmin { sum(support(c).pow(2)) }for allcinA.
See balance for more information.
Functions
- Balance the weight distribution of a given
votersat mostiterationstimes, or up until the point where the biggest difference created per iteration of all stakes istolerance. If this is called withtolerance = 0, then exactlyiterationsrounds will be executed, except if no change has been made (difference = 0).toleranceanditerationsare part of theBalancingConfigstruct.