Skip to content

Conversation

@amanz360
Copy link

@amanz360 amanz360 commented Dec 9, 2016

Added gurobi implementation to kemenyILP

samsaksfithian and others added 17 commits December 2, 2016 15:29
Created an input file. Added ability to enter name of desired file on
the command line. Added photo reference for how to format/create input
files.
Made the actual calculation of the winner be a separate (and thus
overridable) function.  Basic version still uses WMG, new kemenyILP
overrides and uses Gurobi ILP optimization.
kemenyILP now properly functions as a mechanism and can be used like any
other prefpy mechanism but it uses gurobi to solve Kemeny as an ILP.
Cleaned up basic run file and added ability to specify input file on
initial command line call. Created some output formatting functions to
convert candidates from ints to their string names, display a ranking
in visual rank format (eg. “a > b > c”), etc.
kemenyILP is now a direct subclass of Mechanism, not MechanismKemeny,
since it does/overloads basically everything itself anyway. Added
several member variables to store data so it could be printed from main
after the calculations. Eliminated function to convert solution to
ranking, and just integrated it into the main calculation and data
variable setting.
Got rid of redundant/unused/random tests/old code bits
Added output formatting to change the keys of dictionaries from numbers
to corresponding candidate names.
Super memory inefficient so won’t generate large files. Will fix soon.
Still slow, because it potentially goes through all the permutations of
candidate rankings, but only stores as many as requested for the file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants