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: over 1 year 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 (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-01T15:29:10.000Z (over 1 year ago)
- Last Synced: 2025-04-01T16:46:06.119Z (over 1 year 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: 2.32 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'
```