I’ve created a github for the ternary plots/voting stuff I’m currently working on in-case anyone wants to take a look at it. It’s the same code I used to make both these apportionment algorithm and single winner voting method visualizers:

When making both the apportionment algorithm and single winner voting method visualizers I hand coded the methods for the three specific types of votes I used for the ternary plots I used in the temp folder but doing that for more complicated methods can be a very error prone process and that code isn’t very generic so I decided to create a voting method library for all the methods for any combination of voters and candidates, so that’s what I have been working on. I plan to add a lot of methods over time so I’ve spent a lot of time planning out how I want to organize all the methods into various components and abstract classes to make adding new methods in the future a lot easier. Though it’s still a work in progress (most of the files are blank and are just placeholders for different methods that I might add in the future so when designing the architecture of the voting method library I can have a general idea of what types of voting methods I need to accommodate).

Because I’ve spent so much time on this voting method library I would love for it to be able to be used for future projects. The next thing I’m planning on working on after I create ternary plots for both multi-winner sequential and optimal voting methods is to create an automatic criterion checker. Does anybody have any suggestions for what else this library can be used for in the future?

1 Like

This is cool… that’s a lot of files. It would be great to see some of its output. (it produces images, right?)

If you ever decide to put it on the web and give it a REST or JsonP API so it can talk to Codepens and other JS apps, I’m sure I could help with that.

1 Like

I linked to many of the images I created with it (these images were just created with ternaryPlot.cpp and the files in the utilities folder and temp folder, everything else hasn’t been tested yet and is still a work in progress):

I’ve never put code on the web before and the only part of that sentence I understood was the ‘put it on the web’ part, so if I ever decide to do that in the future, I’ll need the help so I’ll be sure to ask you for it.

Ha cool. Well, I’d just like to figure out a way to make the stuff useful to other people. In the perfect world the code would run in browsers, but if you’re doing really processor intensive stuff, well, you can’t really beat C++. It looks like you’ve put a lot of work into it… did you have a grand plan for it when you started or anything? Just curious.

Sorry I missed the images first time around… interesting. And colorful. I’m kind of color obsessed. (don’t get me going on color theory)

I’ll have to look into it further to see if I understand what they mean.

1 Like

Yup. Making diagrams for multi-winner methods was my end goal when I started and I’m still working on doing that. Though there are a lot of multi-winner methods I want to test which is why I’ve spent so so much time creating the reusable abstract classes and components so as much code as possible that would be shared between different multi-winner methods can be reused.

And the second (here’s the first) time around, but that’s okay.

Then you might want to read up on ternary plots (which are a special case of barycentric coordinates) first:

Here’s a more digestible YouTube video explaining what they are:

And in-case you’re not familiar with the term apportionment algorithms, those are the things that decide how many seats each party gets in party list elections (some of which can also be used for MMP elections as well), or in deciding how many representatives each state gets to send to Washington DC. Even things as simple as apportionment methods have generated much theoretical discussion. You can read up more on that here, here, and here.

Apportionment algorithms in it of themselves are pretty insignificant in the grand scheme of things, however for different cardinal multi-winner voting methods that reduce to one of them when voters vote on party lines, which apportionment algorithm a multi-winner method reduces to has implications on what criteria it can and cannot pass which is why they are often brought up during theoretical discussions about multi-winner methods.