Thursday, December 4, 2008

Picking teams

Write an algorithm to fairly assign n players to m sports teams in a league. Each player will create an order of their peers based on how much they want to be on their team (or how good they are). This list will not include the player themselves.

For instance, to split 6 players A,B,C,D,E,F into 3 teams, the players might submit:
A: {B, C, D, E, F}
B: {A, D, C, F, E}
C: {A, B, D, F, E}
D: {C, B, A, E, F}
E: {B, A, D, F, C}
F: {A, B, C, D, E}

Your algorithm must (1) be fair globally and (2) maximize each player's perception of the team they end up on. In our example, the team EC would do a poor job of satisfying (2) because each player is paired with their last choice, while AB would do a good job of satisfying (2) but probably fail to satisfy (1) because they're both very highly-ranked players.

It's up to you to determine how to quantify these two requirements, and run-time is not a large consideration.

No comments: