0

I am making a web app and need some player pricing algorithm for NBA players, much like what Fanduel uses. Does anybody have any resources or know how to implement something like this in Ruby? I would like to have players that I can add to a team that must fit within a predefined salary cap. I would be able to build a 5 player team (PG, SG, SF, PF, C) and a 9 player team (PG, PG, SG, SG, SF, SF, PF, PF, C). Players' salaries are changed daily. With Fanduel, in order to get the exact players I want, they are oftentimes $10 over the combined limit. It seems like there is some trick to this equation. The problem seems similar to something called the knapsack problem.

sawa
  • 165,429
  • 45
  • 277
  • 381
Joseph Gill
  • 1,067
  • 11
  • 18
  • 1
    @amit: Actually this seems to be a subtle reversal of the problem (although I also thought originally that it was a duplicate). If I read it correctly, OP wants to generate the prices such that it is impossible for the knapsack to contain certain ("best") combinations so that someone trying to get a player roster has to make important decisions (I guess the aim is to enhance enjoyment of the game by forcing player to choose between features of a team possible with a limited budget) – Neil Slater Aug 06 '13 at 08:34
  • 1
    @Joseph Gill: I think the problem as stated is a bit vague. It may well be the case that Fanduel uses a very simple pricing algorithm, and simply relies on the fact that the knapsack problem is hard to solve (and possibly enjoyable for people to try). The algorithm may simply be that all "full" teams cost a certain amount (probably same as your budget), and prices are divided between players according to ability - your natural inclination to want the good players from each team will cause you to over-allocate and need to play carefully. No need to solve knapsack to set prices in that case. – Neil Slater Aug 06 '13 at 08:40
  • Thanks a lot Neil. I was looking for a reversal of the problem. And your analysis above makes sense too. – Joseph Gill Aug 06 '13 at 16:30

0 Answers0