NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

pref_voting: The Preferential Voting Tools package for Python

Wesley H. Holliday, Eric PacuitJ. Open Source Softw 2025 · DBLP

Abstract

The study of voting theory has increasingly shifted toward computational social choice (COMSOC), requiring robust software tools for simulating elections and analyzing voting rules. pref_voting is a comprehensive Python library designed to address the fragmentation in the current software landscape. It provides a unified framework for representing diverse election types, implementing dozens of voting methods, and programmatically verifying mathematical axioms of fairness and stability.

Introduction

Voting theory aggregates individual preferences into collective decisions. As researchers move toward COMSOC, they rely on computer-assisted techniques to analyze the complexity of voting rules and their susceptibility to strategic manipulation. Prior to pref_voting, tools were often specialized for specific data formats or voting types (e.g., approval-based selection), lacking a cohesive pipeline from data representation to axiomatic analysis. pref_voting fills this gap by offering a single environment for the entire research workflow.

Core Functionality and Methods

The package is built on several pillars that support the full lifecycle of social choice research:

Diverse Election Representations

pref_voting supports a wide array of voter inputs beyond simple linear rankings. These include:

  • ProfileWithTies: For rankings where voters may be indifferent between candidates.
  • GradeProfile and UtilityProfile: For cardinal voting systems.
  • SpatialProfile: For modeling voters and candidates in a multi-dimensional ideological space.
  • Graph-based Representations: MajorityGraph and MarginGraph are provided for analyzing Condorcet-style methods, which focus on pairwise comparisons.

Transformation and Decision Procedures

The library includes algorithms to convert between data types, such as deriving utility profiles from spatial data or using linear programming to reconstruct minimal voter profiles from margin graphs. It implements dozens of voting rules, including positional scoring rules (e.g., Borda count), iterative methods, and weighted tournament solutions.

Axiomatic Testing

A standout feature is the Axiom class, which treats mathematical properties as executable code. This allows researchers to programmatically check if a voting method satisfies properties like monotonicity or independence of clones. The find_all_violations method enables the identification and visualization of specific edge cases where a rule fails, turning abstract theory into empirical metrics.

Data Integration and Ecosystem

pref_voting acts as a "glue" layer within the COMSOC ecosystem. It interfaces with:

  • PrefLib.org: Via preflibtools for real-world preference data.
  • ABIF: Supporting the Adaptive Binary Internal Format.
  • Synthetic Generation: Integrating with prefsampling to generate profiles based on models like Impartial Culture (IC) or Impartial Analogous Culture (IAC).

Research Impact and Future Work

The package has already demonstrated its utility in the research community, powering the Stable Voting website and supporting recent publications in the field. By quantifying the frequency of axiom violations across millions of simulated elections, it provides a level of empirical rigor previously difficult to achieve. Future development aims to expand the library of implemented methods and optimize the performance of computationally intensive margin-based algorithms.

Summary updated

BibTeX
@article{holliday2025pref,
  author = {Wesley H. Holliday and Eric Pacuit},
  title = {{pref\_voting: The Preferential Voting Tools package for Python}},
  journal = {J. Open Source Softw.},
  year = {2025},
  doi = {10.21105/joss.07020},
}
Figure