08:54 pm, 1 May 05

### haskell condorcet module

I may as well publish my Haskell Condorcet voting module. Maybe someone will find it useful. Or at least find bugs in it and critique my Haskell style.

08:54 pm, 1 May 05

I may as well publish my Haskell Condorcet voting module. Maybe someone will find it useful. Or at least find bugs in it and critique my Haskell style.

motive_nuanceevanmotive_nuanceG = ( ( 1 ( 3 4 5)) (2 ()) (3 ( 2)) (4 ()) (5 ( 3)))

the path for node 1 would be:

( 1 ( 3 4 5) ( 2))

and for node 5 would be:

( 5 ( 3) (2 )).

If this is right, and the beats function works the way I understand it (the path from i to j is the same as or shorter than the path from j to i), then things work pretty much the way I was thinking.

If this is right, the Condorcet algorithm could be interpreted as a function on a graph. If so, what would be the right way to use a vertex-weighted graph?

evanIt's actually Floyd's algorithm (all-points shortest paths rather than one-source, which is Dijkstra's) and in reverse, sorta: as you're trying to find the all-pairs

greatest path. The edges are already weighted: the weight of (A, B) is how many votes ranked A higher than B. And (as I understand it) if A beat C (and C beat B) harder than A beat B directly, then A beats B with the greater strength.