Simple Python code for processing our wedding party's Google Form responses and producing a color assignment. This is a simple variation of rank choice voting.
- Add output from Google Form to directory as
input.csv
. - Run
./01_Preprocess.py
to createsuit.csv
anddress.csv
frominput.csv
. - Run
./02_Assign.py INPUT
to processINPUT
, a preprocessed file, and produce an assignment. Here,INPUT
is eithersuit.csv
ordress.csv
. - Run
./03_Minimize.py
to run./02_Assign.py suit.csv
and./02_Assign.py dress.csv
each 100 times and output the observed assignment(s) with minimum cost (i.e., smallest sum of ranking).
Participants order each color from 1
to 9
. 1
represents their first choice, 9
represents their last choice. The Google Form ensures every color must have a ranking and no two colors can have the same ranking.
The suits and dresses will be processed separately.
For suits (or dresses) the following steps are followed:
- Look at everyone's #1 color choice.
- If anyone is alone in picking a particular color as their #1, they get it assigned. (That color and person are removed from future iterations.)
- For any color where two or more people picked it as their #1, the algorithm randomly (uniformly) selects one person to get that color. (That color and person are removed from future iterations.)
- Repeat for everyone's #2 choice, #3 choice, etc.