Instant Runoff Voting (IRV) is a fascinating way to run an election. The basic idea is that voters rank the candidates and the votes for the least popular candidate are automatically moved to the remaining candidates until one is selected winner.


Ready for the challenge? Code up a solution in your favorite language by midnight Sunday, February 14th, Eastern Standard Time. [ed. looks like we have a deadline error, so hold on to your hats, let us remedy this] Submit it to contest at codetown dot us. Also, post the link or code on this Discussion so the group can see it. We're allowing a little more time for this contest, so the results will be judged by...you! A poll will be posted in Contest Town so you can vote for your favorite app. Maybe we can use IRV to decide?

The winner will receive ... bear with us, as we're waiting to hear back from our sponsor, but this contest is going up now to give you the maximum possible amount of time to code. Good luck!

Views: 888

Replies to This Discussion

Am I too late? I think Eric and Dan may already be tied to win this contest. Regardless, I'm uploading my entry. One interesting thing- with my dataset, some ballots actually lost all their selections after the second run-off ( I had seven candidates, people selected the top four) so the total votes decreased. At first I thought this was a bug, but this might be one of the complaints people have with the system of instant runoffs. (?)
Attachments:
All - thanks for your submissions. We are still searching for a prize sponsor, so until we get one, the door is open at least until 2/14 for submissions. Stay tuned!
The code that I wrote at last night's meeting is posted at http://github.com/ericlavigne/instant-runoff

I have not yet figured out how to post the video online, as it weighs in at 3.5GB.

It's good to see that some others have submitted solutions. Looks like Michael's solution is a bit ahead of mine as it can read votes in from a file. And of course Dan's is way ahead since it has been used for real elections.
wait, really? where can I find Dan's entry?

Eric Lavigne said:
The code that I wrote at last night's meeting is posted at http://github.com/ericlavigne/instant-runoff

I have not yet figured out how to post the video online, as it weighs in at 3.5GB.

It's good to see that some others have submitted solutions. Looks like Michael's solution is a bit ahead of mine as it can read votes in from a file. And of course Dan's is way ahead since it has been used for real elections.
wait, really? where can I find Dan's entry?

He talked about it at both the January and February GatorJUG meetings, but I haven't seen either the code or the running program. I think it was a project for Santa Fe Community College.
it is a large project that is not portable. This is why i was not trying to enter it. I could take snippets of code or screenshots and post it for people to look at. time permitting at our next meeting i will demo it. There is a staff side that allows us to enter in who is running for what position. It allows creation of parties. It allows the user to enter a date and time range, this range controls when the ballot appears to students on our student website. The students must log in to see it. If they do not meet certain parameters they are not allowed to vote. Must be enrolled in classes currently for instance.
The staff side includes allowing staff to see a sample ballot, and a results page.
it is a large project that is not portable. This is why i was not trying to enter it. I could take snippets of code or screenshots and post it for people to look at. time permitting at our next meeting i will demo it.

This sounds interesting, and I would certainly be interested in seeing code, screenshots, and/or a demo.
All my data is in tables. I used the power of sql to do part of my counting.
vote_cnt is the order that this candidate was put in by the voters.
ex
SELECT
COUNT(*)

INTO
:SR1037W1.COUNT

FROM
OWNERSQL.SRT_GOVT_VOTES T1

WHERE T1.ACAD_BEG_YR = :ACAD_BEG_YR AND
T1.ID_NUM = :SEARCH_ID1 AND
T1.VOTE_CNT = :SEARCH_CNT1
AND EXISTS(SELECT * FROM OWNERSQL.SRT_GOVT_VOTES T2
WHERE T2.ACAD_BEG_YR = :ACAD_BEG_YR AND
T1.SSN = T2.SSN AND
T2.ID_NUM = :SEARCH_ID2 AND
T2.VOTE_CNT = :SEARCH_CNT2
)

The results of multiple sql queries is combined and then compared.
if one candidate has > half votes then we are done and present the results.
else
determine who is in last place.
then do sql queries to give his votes to the others.
i'll print some code out and show everyone the system next month.

next student goverment voting is:
The next Student Government Election will begin on 03/31/2010 at 08:00 AM. Voting will end 04/01/2010 at 03:00 PM.
you can come by and question the voters/students and see what they think.
During your presentation I wasn't fully following your logic as I don't deal with Clojure, Lisp or functional programming much. But now after looking at your code I see pretty much followed your line of attack, when I wrote it I thought I was taking a different approach.
During your presentation I wasn't fully following your logic as I don't deal with Clojure, Lisp or functional programming much. But now after looking at your code I see pretty much followed your line of attack, when I wrote it I thought I was taking a different approach.

Any suggestions for how I could have explained it better? What did you understand later that you didn't understand during the presentation?
Update on contest winning entry: Michael, Kevin and Eric, we have not gotten a sponsor for Contest 2 yet, though since we haven't chosen a winner yet, the door is still open. Here's the plan. If we don't get a sponsor by the next GatorJUG meeting, I will choose a prize for the winning entry. I'll continue to search for a sponsor. And, stay tuned for Contest #3! Since all the entries are from GatorJUG members, we'll discuss the conclusion of this contest at the next GatorJUG meeting in March. Sound fair? Let me ask of you that you post the features each of your entries implements here as a comment.

RSS

Happy 10th year, JCertif!

Notes

Welcome to Codetown!

Codetown is a social network. It's got blogs, forums, groups, personal pages and more! You might think of Codetown as a funky camper van with lots of compartments for your stuff and a great multimedia system, too! Best of all, Codetown has room for all of your friends.

When you create a profile for yourself you get a personal page automatically. That's where you can be creative and do your own thing. People who want to get to know you will click on your name or picture and…
Continue

Created by Michael Levin Dec 18, 2008 at 6:56pm. Last updated by Michael Levin May 4, 2018.

Looking for Jobs or Staff?

Check out the Codetown Jobs group.

 

Enjoy the site? Support Codetown with your donation.



InfoQ Reading List

Presentation: Several Components are Rendering: Client Performance at Slack-Scale

Jenna Zeigen discusses front-end performance issues encountered by Slack as they continue to grow and evolve the desktop app.

By Jenna Zeigen

SSH Backdoor from Compromised XZ Utils Library

When Microsoft Engineer Andres Freund noticed SSH was taking longer than usual he discovered a backdoor in xz utils, one of the underlying libraries for systemd, that had taken years to be put in place. The backdoor had found its way into testing releases of Linux distributions like Debian Sid, Fedora 41 and Fedora Rawhide but was caught before propagating into more highly used stable releases.

By Chris Swan

For Practitioners, by Practitioners: Solve Your Software Challenges at InfoQ & QCon Software Events

Behind every InfoQ Dev Summit and QCon software development conference is a collective of distinguished senior software practitioners who carefully curate the topics based on the crucial trends and essential best practices you need to know about. These architects and leaders are charged with creating THE conference they would want to attend.

By Artenisa Chatziou

How Technology Can Drive Culture Change in Software Organisations

Technological improvements like containers, VMs, infrastructure-as-code, software-defined-networking, collaborative version control, and CI/CD can make it possible to fix cultural issues around organisational dynamics and bad product delivery. According to Nigel Kersten, software leaders should leverage tech to create positive changes in organisational dynamics and relationships between teams.

By Ben Linders

Radius is Now a Cloud Native Compute Foundation (CNCF) Sandbox Project

The Microsoft Azure Incubations Team recently announced the approval of Radius as a Cloud Native Compute Foundation (CNCF) sandbox project. Radius is a cloud-native, cloud-agnostic application platform that the CNCF has recognized as having the potential to contribute to the cloud-native ecosystem.

By Steef-Jan Wiggers

© 2024   Created by Michael Levin.   Powered by

Badges  |  Report an Issue  |  Terms of Service