Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maxgfr/condorcet-winner
A simple condorcet vote algorithm implementation in typescript
https://github.com/maxgfr/condorcet-winner
condorcet condorcet-vote condorcet-voting condorcet-voting-algorithms condorcet-winner node typescript vote
Last synced: about 2 months ago
JSON representation
A simple condorcet vote algorithm implementation in typescript
- Host: GitHub
- URL: https://github.com/maxgfr/condorcet-winner
- Owner: maxgfr
- License: mit
- Created: 2022-12-16T16:45:32.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T19:30:08.000Z (about 2 months ago)
- Last Synced: 2024-10-29T21:37:54.135Z (about 2 months ago)
- Topics: condorcet, condorcet-vote, condorcet-voting, condorcet-voting-algorithms, condorcet-winner, node, typescript, vote
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/condorcet-winner
- Size: 1.57 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# condorcet-winner
This library is a TypeScript implementation of the [Condorcet method](https://en.wikipedia.org/wiki/Condorcet_method) for determining the winner of a [Condorcet paradox](https://en.wikipedia.org/wiki/Condorcet_paradox) election.
## Installation
```bash
yarn add condorcet-winner
```## Usage
```typescript
import { condorcetWinner } from 'condorcet-winner';const winner = condorcetWinner(
['A', 'B', 'C'],
[
['A', 'B', 'C'],
['B', 'A', 'C'],
['C', 'A', 'B'],
],
);console.log(winner); // 'A'
```