On 2024-08-27 00:17, Rob Lanphier via Election-software wrote:
Hi folks,
How might one algorithmically go about generating a 2D placement of affinity groups when one only has ranking information? I've been considering writing something that does this for quite some time, ever since I manually generated this chart of the 2009 mayoral election in Burlington: https://electowiki.org/wiki/File:Burlington2009election-infosheet.png https://electowiki.org/wiki/File:Burlington2009election-infosheet.png
More recently, a discussion broke out on the Center for Election Science's Discord server on this topic. In particular, we started discussing what it would take to generate Yee diagrams from election results. There weren't answers there; there were just more questions.
I have some ideas for how to do it (by a vaguely Monte-Carlo-ish evaluation, iterating over placement of candidates and voter affinity groups), but I haven't yet figured out a reasonably simple algorithm.
I'm going to set this task aside for now, but if others have ideas, I'd love to see them.
What comes most immediately to mind would be to use Kendall tau distances as the distances between voters, and then use a dimensionality reduction algorithm to create coordinates from the pairwise distances between every voter.
You could use something like a serial version of https://en.wikipedia.org/wiki/Vivaldi_coordinates, in essence a spring-based system that starts with some random assignment of coordinates then updates pairs to be a little more proportional to their distance each iteration.
There may be better ones, but I'm not sure what the subject of reconstructing coordinates from distances is called.
-km