Help O wise Monks!

I'm totally stumped on how to develop what I'm calling my "fantasy football optimization algorithm".

Here's the general idear. You have $100,000 to spend for 10 players (2 QB, 2RB, 2WR, 1TE, 2FLEX, 1DEF)...each position player costs you a bit of your $100,000. So say Drew Brees costs you $17,000, while some scrub costs you $5,000. In other words, if you spend a bunch at quarterback, you'll have to get a scrub at running back or vice versa. In building this algorithm, I'm trying to maximize the teams projected points, while staying under $100,000 in total salary.

So what I've done is converted each player's stats into a value based equation. It's simple. Basically, it's a "cost per point" analysis. In the case of Drew Brees, you have to pay $17,000 to get him, and he's projected to score 22 points per game, meaning you would roughly have to pay ~$750 per point.

What I'm trying to develop in perl is a program that looks at the players value rating, and runs through millions of iterations to assemble the team with the most projected points as close to the $100,000 salary cap as I can.

I haven't been able to get very far. Any ideas on how to do something like this? Should I assemble all data in some arrays or use a mysql db? How should I track when one a new "high score" has been reached? Any help is appreciated, and I'll let you guys/gals know how I do in my league once this is complete :)

I love it when a program comes together - jdhannibal

In reply to Optimization Algorithm Help by jdlev

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.