Download the PHP package julien-boudry/condorcet without Composer

On this page you can find all versions of the php package julien-boudry/condorcet. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package condorcet

Condorcet

Open in GitHub Codespaces

Packagist Docker Pulls Packagist Download GitHub contributors

Codacy Badge GitHub code size in bytes Codacy Badge Build Status

Main Author: Julien Boudry
License: say hello if you like or use this code!
Contribute: Contribute File
Donation: bc1q3jllk3qd9fjvvuqy07tawkv7t6h7qjf55fc2gh or Github Sponsor Page
You can also offer me a bottle of good wine.

Condorcet PHP

Presentation | Documentation Book | Tests

Condorcet manages the stages of an electoral process (configuration, votes ingestion & manipulation, integrity) and calculates the results. It offers natively the implementation of more than 20 voting methods compatible with preferential voting ballots, including Condorcet methods, Alternative Voting, STV, and many others. => Supported Voting Methods

Two different ways to use Condorcet:

Both approaches can handle up to hundreds of millions of votes (or more) on modest hardware. Although using it as a library will allow more configuration and control over this advanced usage.

Summary

Project State and Specifications

Releases Notes

Version PHP Requirements State Support
4.7 8.3 Stable support provided
4.6 8.2 Old Stable support provided
3.x 8.1 Old Stable not any support
2.2 7.4 Old Stable support requiring some bait
2.0 7.1 Old Stable not any support
1.0 5.6 Old Stable not any support
0.9x 5.5 Old Stable ❌ ℹ Since v0.90, you should consider then it's a new project (api, engine).
0.14 5.5 Old Stable ready for the museum

All versions require Json and Mbstring extensions (or polyfill). Pdo-Sqlite is recommended if you need to activate the default provided driver for bigs elections (hundred of thousands of votes or more)

Supported Voting Methods

Support both single-winner methods (with or without the Condorcet criterion) and proportional methods.

Complete list of natively implemented methods, their options (variants), and implementation choices

Single-Winner Methods provided natively

Single Winner returns a full ranking of all candidates, even though they are generally more designed to designate only one.

Deterministic

Condorcet / Borda (+ Nauru variant) / Copeland / Dodgson (2 Approximations) / FTPT / Instant-runoff (alternative vote) / Kemeny–Young / Minimax (+ variants) / Ranked Pairs (+ variants) / Schulze (+ variants)

Lotteries

Random Ballot / Random Candidates

Proportional Methods provided natively

Designed for electing assembly, return a full ranking of elected candidates.

Single Transferable Vote (STV) / Comparison of Pairs of Outcomes by the Single Transferable Vote (CPO-STV) / Highest Averages Methods (Sainte-Laguë, Jefferson/D'Hondt, and variants) / Largest Remainder Methods (with different quotas)

Add your own voting method as a module

Condorcet is designed to be easily extensible with new algorithms (they don't need to share the same namespace).

Main features

Condorcet PHP is not designed for high performance. But can handle virtually unlimited voting without limit or degrading performance, it's a linear and predictable scheme.
And has no certification or proven implementation that would guarantee a very high level of reliability. However, there are many written tests for each voting method and feature. This ensures an excellent level of confidence in the results.


Use Condorcet as a command line application

Install as a command line application

Can be installed natively from source (with composer), from PHAR file, from Docker image (build or pull).

Condorcet as a command line application, installation instructions

Condorcet Book - Command Line

Use Condorcet as a PHP Library

Install / Autoloading

Namespace is used.

Can be installed as you prefer with: Composer / Natively provided autoloader / Any PSR-4 compatible autoloader.

Condorcet as a PHP library, installation instruction

Library Manual

Visit the Documentation Book

Living and learning examples, giving an overview but not exhaustive of the possibilities of the library.

Class & API References

The precise documentation of methods can be found in the form of Markdown in the "Documentation" folder for each release.

Class & API References

PHP Library - Examples

Overview

With Html output basics examples

Specifics examples

Performance & Coding style considerations

Coding standards:

The code is very close to the respect of PSR-12 (lacks only the naming of methods) when it is not unnecessarily authoritarian or conservative and follows some additional rules. Code is checked and fixed with CS-Fixer custom rules through Laravel Pint.

Performance:

But essentially because some voting methods are slow by design and others (like Schulze) are very fast. Have a look on methods benchmarks.

Kemeny-Youg case:

1 000 randoms votes. Memory consumption comes from votes more than combinations.

Massive election case:

Extending PHP memory_limit allows you to manage hundreds of thousands of votes, but it can be a bit slower than outsourcing this data (PHP doesn't like that) and it's not extensive to infinity.

If you need to manage an election with more than 50 000 votes. You should consider externalizing your data, Condorcet provides a simple PDO driver to store data outside RAM between processing steps, this driver stores it into a classical relational database system, and it supports hundreds of millions of votes (or more). A very simple example with Sqlite is provided and very easy to activate.

You can also develop your homemade datastore driver (to store into NoSQL... all your fantasy), the modular architecture allows you to link it easily.

Have a look at the documentation book

Benchmark on a modern machine (linux - x64 - php 8.1 - cli).

Roadmap for further releases

Related projects / They use Condorcet

See the list of known projects, add yours!


All versions of condorcet with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-json Version *
ext-mbstring Version *
symfony/console Version ^7.0
symfony/yaml Version ^7.0
brick/math Version ^0.12
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package julien-boudry/condorcet contains the following files

Loading the files please wait ....