Metadata-Version: 2.4
Name: optimal-voting
Version: 0.0.4
Summary: Functionality to optimize different classes of voting rules for user-defined goals.
Author-email: Ben Armstrong <research@benarmstrong.ca>
License: MIT License
        
        Copyright (c) [2025] [Ben Armstrong]
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Repository, https://github.com/beng341/optimal_voting
Keywords: social choice,voting,optimization,scoring rule
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.25.0
Requires-Dist: numpy>=1.26.4
Requires-Dist: pandas>=2.2.2
Requires-Dist: abcvoting>=2.10.0
Requires-Dist: pref-voting>=1.13.18
Requires-Dist: seaborn>=0.13.2
Requires-Dist: simanneal>=0.5.0
Dynamic: license-file

# Optimal Voting Package

This package allows the application of standard optimization techniques to voting rule design. Existing approaches of using neural networks to develop optimized voting rules have been critiqued due to their lack of interpretability. This package allows optimizing _interpretable_ classes of voting rule such as positional scoring rules where simply looking at the score vector provides intuition about the rule itself.

The package aims to support a wide range of existing and user-specifiable optimization targets, as well as several classes of voting rule.

Possible optimization targets:
- common utility functions (current): 
  - Utilitarian
  - Nash
  - Egalitarian/Rawlsian
  - Malfare
- measures of distortion
- axiom violation rate (https://arxiv.org/abs/2508.06454)
- ranking consistency (https://arxiv.org/abs/2508.17177)

Optimizable rule types:
- positional scoring rules (current)
- probabilistic positional scoring rules (soon)
- functions of (weighted) tournaments, i.e., C2 rules (soon)
- sequential rules, i.e., Instant-Runoff Voting (soon)
- sequential Thiele rules (eventual)
- Thiele rules (perhaps)

Optimization techniques:
- simulated annealing: due to ease-of-use across domains this is intended to be the primary optimization method
- gradient descent: partially implemented at the moment. Early experiments show that this results in outcomes of a similar quality to simulated annealing but requires more compute. The eventual goal is to support GD with Torch and Jax but annealing is likely to remain preferable.


Proper documentation will be developed as the package matures. A rough overview of package use is:

1. Generate preference profile(s) empirically or by sampling one or more distributions.
2. (Optional) generate utilities corresponding to the preference profiles.
3. Select an optimization target (i.e., egalitarian social welfare).
4. Send profiles, utilities, target to Optimal-Voting.
5. Optimal-Voting returns a positional scoring vector which maximizes egalitarian social welfare on the provided profiles. 


NOTE: At the moment, the package is in active development. Changes that break compatibilty should be expected.

If you are interested in using the package or have suggestions for possible features you are encouraged to reach out at BenArmstrong dot ca
