Maximize Fantasy Baseball Lineup

2013-09-13 Thread Mark Watson
Hey, newish user here.

I want to make an app that finds the optimal lineup for fantasy baseball 
games.

Each player is assigned a cost, the average points they earn a game, and 
position. For example: Andrew McCutchen, 3.4, 4900, OF

You have to pick one catcher, one pitcher, one first basemen, one second 
basemen, one shortstop, one third basemen, and three outfielders. The catch 
is you also have to stay below a predetermined total cost of your team. I 
want to maximize my total average points while staying under the cost limit.

My plan was to iterate through every possible combo, and swap an atom if I 
find a lineup with a better total average points while staying under the 
total cost limit.

My issues are:

1) This seems like an inelegant solution (brute force)

2) I don't know of a good way to handle the fact that I need to choose 
three outfielders, but can't choose any one outfielder multiple times

Any advice? Thanks!

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Maximize Fantasy Baseball Lineup

2013-09-13 Thread Norman Richards
This sounds like a classic knapsack problem.  For such a small problem
space, a simple dynamic programming solution would suffice.


If you are interested in exploring this problem at a larger scale, I high
recommend coursera's Discrete Optimization class:

https://class.coursera.org/optimization-001

-- 
-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Clojure group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.