Jameson & I both like my Apportioned Range Voting algorithm (which can be used with most any Cardinal method, I believe):
While Seats Available:
Distribute non-discriminating ballots (5/5/5, 2/2/2, +/+/+, -/-/-) evenly across all open seats, removing them from the set of Non-Apportioned Ballots (Ballot Set A)
SEE NOTE 1
Find winner of Ballot Set A according to the method in question (W)
SEE NOTE 2
Find ballots that show strongest support for W that would fill out a Hare Quota (Ballot Set H)
SEE NOTE 3
Find winner of Ballot Set H (Q)
While Q != W
Find the the ballots that show strongest support for Q (Ballot Set J)
Set Ballot Set H = Ballot Set J
Set W = Q
Seat W
Remove Ballot Set H from Ballot Set A (having been satisfied with the seating of W)
NOTE 1:
The reason this is inside the While loop, rather than before it is for cases where a voter casts a A1/B0/C0/D0 ballot, and A is ineligible for further seats, but that ballot isn't apportioned to A's Quota. At that point, it is effectively a non-discriminatory ballot of A-/B0/C0/D0, and should be treated as such.
NOTE 2:
The decision theorist in me says that in cases of ties, you should do a beam-search, and see if the resultant sets of winning candidates are different on the various final leaves of the beam, but I haven't bothered to do yet.
NOTE 3:
There are two methods for determining Greatest Support:
My Original Method: Descending order of Difference of Support
for W from that ballot's Average Support (ie W5/A2/B4/C0 ==> 5 -
(5+2+4+0)/4 == 5-2.75 == 2.25)
Jameson's Alternative: Descending order of Highest Score for W
I tested both in my development, and believe that the Difference From Average method is better. I have not yet tested whether "Difference from Average" should be calculated once, or every time a candidate has been removed from consideration, yet.
Also, I think Fractional Transfer is probably appropriate here, too.
Anyway, what language are you planning on writing this in? What sort of data structures?