Project

davenport

0.0
No commit activity in last 3 years
No release in over 3 years
Provides a Ruby interface for aggregating partial order expressions into a partial order with minimal Kemeny-Young distance
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

davenport¶ ↑

home

github.com/wbreeze/davenport-ruby

code

github.com/wbreeze/davenport-ruby

rdoc

FIX (url)

bugs

github.com/wbreeze/davenport-ruby/issues

C-lib

github.com/wbreeze/davenport

DESCRIPTION:¶ ↑

A ranking is a partial order that, given some set of alternatives, places some before others. A preference graph, given some number of rankings, expresses the combination of all of those rankings. It is a directed, weighted graph in which the nodes represent the alternatives and the edges represent preferences.

Use this to build a preference graph from individual rankings and compute a Kemeny order, aggregated preference that minimizes the number of pair-wise disagreements with the individual rankings.

This is a Ruby binding built around a C language implementation of Davenport’s algorithm, found on github at wbreeze/davenport

FEATURES/PROBLEMS:¶ ↑

Please see github.com/wbreeze/davenport-ruby/issues for a list of any issues and add your own there, or contact the author.

SYNOPSIS:¶ ↑

pg = Davenport::PreferenceGraph.new(4)
pg.add_preference([1, 3, 2, 4]);
pg.add_preference([1, 2, 2, 4]);
pg.add_preference([2, 1, 3, 4]);
pg.add_preference([1, 3, 2, 4]);
pg.davenport
=> [1, 3, 2, 4]

The single array parameter for ‘add_preference` has a rank number for the item at the corresponding index. For example, with four items, `[1, 2, 2, 4]` assigns rank 1 to the first item, 2 to the second and third items, and 4 to the final item. The preference, `[2, 2, 2, 1]` ranks the last item first and all of the others equally after it.

REQUIREMENTS:¶ ↑

See .ruby-version for the version of Ruby used in development.

This requires the Davenport library installed according to wbreeze/davenport

INSTALL:¶ ↑

gem install davenport

DEVELOPERS:¶ ↑

After checking out the source, run:

$ rake newb

This task will install any missing dependencies, run the tests/specs, and generate the RDoc.

LICENSE:¶ ↑

GNU Lesser General Public License v3 (LGPL-3.0)

See the file, LICENSE for the full text.

Copyright © 2019 Douglas Lovell