Implement Exact Equal Shares with add-opt rule and enhance logging#70
Open
yonatang8675 wants to merge 8 commits into
Open
Implement Exact Equal Shares with add-opt rule and enhance logging#70yonatang8675 wants to merge 8 commits into
yonatang8675 wants to merge 8 commits into
Conversation
Visual point-and-click election builder, plain-language step-by-step results with a log viewer, a sample-by-size generator, and an about page. Wraps pabutools.rules.ees_addopt without changing the algorithm.
Member
|
Hello, thank you for your submission. I will soon look at it in more details. For now at least, can you please only include the code for ees and the tests? Your experiments and your examples do not need to be included in the package. |
Simon-Rey
reviewed
Jun 10, 2026
| Since: 2026-04 | ||
| """ | ||
|
|
||
| import pytest |
Member
There was a problem hiding this comment.
The package uses unittest for the tests, can you please switch your code to it? :)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds an implementation of Exact Equal Shares (EES) and the add-opt completion procedure from Streamlining Equal Shares by Kraiczy, Robinson, and Elkind.
The new rule implementation lives in
pabutools.rules.ees_addoptand includes:exact_equal_shares, implementing EES for uniform utilitiesEESAllocationDetails, storing per-voter payments for an EES runget_leftover_budgets, computing each voter's remaining budgetget_leximax_payment, computing leximax payment vectorsgreedy_project_change, implementing GreedyProjectChangeadd_opt, computing the minimum per-voter budget increase certifying instabilityees_add_opt_completion, completing EES by iteratively increasing the virtual budget via add-optThe public rule exports are also updated so the main EES/add-opt API can be imported from
pabutools.rules.What Changed
EES/add-opt implementation
Adds
pabutools/rules/ees_addopt.py, including:BudgetAllocationobjectsPublic API
Updates
pabutools/rules/__init__.pyto export:exact_equal_sharesgreedy_project_changeadd_optEESAllocationDetailsTests
Adds
tests/rules/test_ees_addopt.pywith coverage for: