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

Gemini Code Assist to Create APIs, Integrations, and Automation Flows in Public Preview

At the Cloud Next Conference, Google unveiled its enterprise-focused AI Code completion and assistance tool, Gemini Code Assist, which is available in public preview for Apigee API Management and Application Integration.

By Steef-Jan Wiggers

Presentation: Success Patterns in for Building Cyber-Physical Systems with Agile

Robin Yeman demonstrates that there is a mission imperative to migrate from phase gate approach to Scaled Agile to increase safety for stakeholders.

By Robin Yeman

Article: Multi-Cloud Observability Using Fluent Bit

Explore the benefits and challenges of observability in multi-cloud deployments. See how Fluent Bit, a lightweight log collection and distribution tool, can enhance multi-cloud observability by improving cloud neutrality, cutting egress costs, and tackling compliance challenges.

By Phil Wilkins

QCon London: Spreading Ownership and Delivering Value at Spotify with Backstage Plugins

At QCon London, Pia Nilsson and Mike Lewis from Spotify led a session explaining how they have evolved the plugin architecture of Backstage to enable easier extensibility. Going into the background of Backstage's inception, Nilsson explained how Backstage has emerged as a technology being used to change the ways of working for 3000 employees in a meaningful way.

By Matt Saunders

Java News Roundup: Jakarta EE 11-M2, JEPs Targeted for JDK 23, Spring Boot, Hibernate, GlassFish

This week's Java roundup for April 15th, 2024 features news highlighting: the second milestone release of Jakarta EE 11; Stream Gathers (Second Preview) and Vector API (Eighth Incubator) targeted for JDK 23; the first release candidate of Spring Boot 3.3.0; the first alpha release of Hibernate 7.0.0; and the fifth milestone release of GlassFish 8.0.0.

By Michael Redlich

© 2024   Created by Michael Levin.   Powered by

Badges  |  Report an Issue  |  Terms of Service