PDA

View Full Version : Preference voting in poll


coolbawn
04-13-2006, 09:18 AM
It would be good if polls could support preference voting as well as the existing first-past-the-post poll. In other words:

Allow user to add a poll with n textual options eg 4 options: A, B, C and D (no change required).
Allow user to specify poll type: 1 = first-past-the-post; 2 = preference. If type = 1, no change. If type = 2 ….

Allow voting user to state his/her preferences eg A = 4, B = 2, C = 1, D = 3.
The user doesn’t have to vote on all options, so can merely specify B = 2 and C = 1.
Ideally vB checks that votes submitted are consecutive from 1 and no more than the total options.

vB keeps a record for each vote eg: Voter=1; A=" "; B=2; C=1; D=3;
or just: voter 1; C B D
vB displays the results of the first preference votes in the same way as now for first-past-the-post.
Admin or moderator dumps the vote records from the MySQL database to into a worksheet to analyze the results, namely:
- Eliminate the least popular option (with fewest 1st preference votes)
- Reallocate that option’s 2nd preference votes to the other options
- Eliminate options and reallocate their votes until the winner is identified.

Presumably / maybe:

The input type in the poll would change from checkbox to an integer.
Each vote must already be recorded so vB knows who has voted.
The poll display logic would change to look for fields on records with a “1” instead of a check.

Actually I have just googled some software at http://stv.sourceforge.net which can analyze "raw" data like: voter 1; C B D, so it would be great if vB or a plug-in could output that.

That link also links to http://www.demochoice.org/ which is open source web-based polling software using PHP. As a non-programmer, I suspect that it could be turned into a vB plug-in, but that's just a guess.

How tricky is this to develop ? Anyone interested ? How useful might it be for the community ? First-past-the-post is sometimes fine, but is often discredited. In my experience, forums would use far, far more polls if the polling method was suitable.

lpetrich
04-06-2008, 11:57 AM
That would be a great idea. I'm fairly proficient in coding, and it should not be difficult to code by someone proficient at writing web apps or some of the vBulletin mods that some people have created.

In fact, vBulletin already supports one alternative to first-past-the-post (http://en.wikipedia.org/wiki/Plurality_voting_system): approval voting (http://en.wikipedia.org/wiki/Approval_voting). You select it by selecting "allow multiple choices" in the poll-setup options. And instead of being a line of radio buttons, the poll becomes a line of checkboxes that can be selected independently.

Single-choice - radio buttons - first-past-the-post
Multiple-choice - checkboxes - approval voting

These two possibilities require no client-side JavaScript; only standard HTML forms objects. The only server-side coding necessary is simple adding up.


A fancier version of approval voting is range voting (http://en.wikipedia.org/wiki/Range_voting), where each option now gets a popup menu indicating the rating that you can give it, like 1, 2, 3, 4, 5 or -1, 0, 1. As with the others, no client-side coding and only simple server-side coding is necessary. Approval voting and range voting are special cases of "rated voting".


With popups, one can indicate preference order, thus making possible preference voting. But one has to enforce preference order, though that can easily be done on the client side with appropriate JavaScript code. If that code is is not executed, then one can do server-side checking as a backup. However, the vote counting is all server-side, as before.

The Borda count (http://en.wikipedia.org/wiki/Borda_count) is fairly simple. For n options, the top preference gets rating (n-1), the next-from-top (n-2), etc., and the votes are counted in the usual way.

The Condorcet method (http://en.wikipedia.org/wiki/Condorcet_method) interprets each voter's preference ranking as a set of comparisons of all possible pairs of options; the results of these comparisons are added to a table of how many times which option beat which option. This, this approach is sometimes called "Virtual Round Robin" or "Instant Round Robin."

From this table one finds an overall preference ranking, using some algorithm to disambiguate circular cases like A > B > C > A. There are several algorithms that have been developed for that; the most popular one is the Schulze algorithm.

In Instant Runoff Voting (http://en.wikipedia.org/wiki/Instant-runoff_voting), the vote counting is done in rounds. In each round, the voters' highest-preferred options are counted up, and the option that gets the least votes gets dropped. Each vote is then searched to find the highest undropped preference. The rounds continue until one option gets the majority of the vote.

One can extend Instant Runoff Voting to multiple winners with the single transferable vote (http://en.wikipedia.org/wiki/Single_transferable_vote). A victory threshold is set at (total votes)/((number of winners) + 1), and the counting works as in IRV, but with winners as well as losers dropping out. An option wins if it is over the threshold; its extra votes get used for continued counting.


I am willing to assist anyone who might be interested in coding a preference-voting add-on for vBulletin; I have experience with JavaScript but not with PHP or SQL or vBulletin internals. Please PM me if you would wish my assistance.


Some preference-poll sites:

http://betterpolls.com - implements several vote-counting algorithms
http://demochoice.com - implements IRV and STV
Condorcet Internet Voting System (http://www.cs.cornell.edu/andru/civs.html) - implements the Condorcet algorithm