Open DrSam opened 1 year ago
Hello @DrSam Thanks a lot for the messages, and for building something a product with smarter voting systems!
I think I'm almost done implementing it (see https://github.com/lzear/votes/pull/80).
Note that I added an excludeTies
parameter to Minimax and MinimaxTD. With this parameter true
, it matches your expectation (see test on Example 2) by making the system more decisive (less ties) but also less monotonous (see monotonicity criterion).
The current state of the PR does not include "5. Remove the winner and repeat the process to find each successive place (2nd, 3rd, etc)". This will probably come in a future PR adding tie-breaking functionalities to every voting systems of the library.
When #80 is merged and the next version is released, you should be able to use it this way:
const minimaxTD = new MinimaxTD({
candidates: ['A', 'B', 'C', 'D'],
array: [
[0, 50, 68, 99],
[50, 0, 70, 60],
[32, 30, 0, 55],
[1, 40, 45, 0],
],
// else, A and B will be tied because their worst duel is between themselves (0)
excludeTies: true,
// See: https://en.wikipedia.org/wiki/Minimax_Condorcet_method#Variants_of_the_pairwise_score
variant: MinimaxVariant.Margins, // default value
})
const results = minimaxTD.scores()
// -> { A: 36, B: 20, C: -1, D: -1, }
// Note that C and D are still tied. Fixing this will be in a later release
I will need a bit of time to think about how to implement this, but it should be doable. I'll try to give a clearer answer within this month.
I am extremely happy to see people interested in using this library. I think I must warn you that it's been only maintained by me, so I cannot guarantee that it is bug-free. If you or your employees can provide some help with testing, it would be greatly appreciated 😁
We will test it! Thanks so much for your great work. It is truly important!
Hi Izear Thanks for your great work here. We are using your repo in our app Forby.io and we would like to add 2 algorithms based on some research we came across:
Minimax-TD
https://drive.google.com/file/d/1ZvId-tdOLb4vWp0pm5XZaBK2FkqkXLXh/view?usp=share_link
And Score Voting: https://en.wikipedia.org/wiki/Score_voting Just adds up the scores. We are using +5 to -5 as our options.
Are you interested in adding these? I am willing to hire someone to develop these. Thanks, Sam@Forby.io