maxgfr / condorcet-winner

A simple condorcet vote algorithm implementation in typescript

Home Page:https://www.npmjs.com/package/condorcet-winner

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

condorcet-winner

This library is a TypeScript implementation of the Condorcet method for determining the winner of a Condorcet paradox election.

Installation

yarn add condorcet-winner

Usage

import { condorcetWinner } from 'condorcet-winner';

const winner = condorcetWinner(
  ['A', 'B', 'C'],
  [
    ['A', 'B', 'C'],
    ['B', 'A', 'C'],
    ['C', 'A', 'B'],
  ],
);

console.log(winner); // 'A'

About

A simple condorcet vote algorithm implementation in typescript

https://www.npmjs.com/package/condorcet-winner

License:MIT License


Languages

Language:TypeScript 89.8%Language:JavaScript 10.2%