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: 887

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

Airbnb Open-Sources its ML Feature Platform Chronon

Chronon, Airbnb platform to create the infrastructure required to transform raw data into ML-ready features, is now open source. As Airbnb ML infrastructure engineer Varant Zanoyan explains, Chronon supports a variety of data sources and aims to provide low-latency streaming.

By Sergio De Simone

How to Do Sustainable Software Development

Software sustainability includes computing for environmental purposes and using resources appropriately. According to Coral Calero, software engineers need a holistic way of looking at software and should be aware of the environmental impact of software. Several tools and frameworks are available for software engineers to do sustainable software development.

By Ben Linders

Presentation: Protecting APIs in Financial Services with Zero Trust Overlay Mesh Networks

Clint Dovholuk reviews the three components of OpenZiti's architecture: controller, edge routers, and SDKs in addition to diving into the internal physical and logical architecture of OpenZiti.

By Clint Dovholuk

Building SaaS from Scratch Using Cloud-Native Patterns: A Deep Dive into a Cloud Startup

Joni Collinge, Diagrid's Founding Software Engineer, presented at QCon London and discussed a case study on the evolutionary design and implementation of the Diagrid Cloud platform, which underpins Diagrid’s SaaS offerings.

By Steef-Jan Wiggers

KubeCon EU: Mercedes-Benz’s Migration From Pod Security Policies to Validation Admission Policies

During KubeCon EU the Mercedes Benz team presented their migration journey from Pod Security Policies to Validation Admission Policies to secure their 1000+ Kubernetes clusters. The solution was chosen in favour of Kyverno due to its improved performance.

By Olimpiu Pop

© 2024   Created by Michael Levin.   Powered by

Badges  |  Report an Issue  |  Terms of Service