# Are there constraint problem calculators?

So I just remembered Lincoln Logs exist, so I found ten giant sets of them on ebay for Buy It Now, and I'm trying to decide what combination of purchases gives me the most logs for the least money if I'm going to purchase $n$ sets.

Then I remembered this is exactly the sort of thing I learned in algorithms class, but I really don't want to set this up myself. Much, much too lazy on this rainy day. Are there any online or downloadable calculators which let me set it up easily?

-
I'm not sure what you're asking exactly, but I will vote this up if only for Lincoln Logs. Could you comment on the 'giant'ness of the sets? Are they equally huge? Are you having some combination of bidding and buying now? – Ian Coley Mar 20 '13 at 0:09
Given that I am purchasing $n$ sets of logs which have {cost, number of logs} from the set ( {20, 120}, {45, 300}, {30, 220}, etc ), which $n$ sets should I purchase in order to maximize the ratio of logs acquiredd to money spent? – Aerovistae Mar 20 '13 at 0:11
@FrankMcGovern, your unclosed comment is messing up the page. Please delete it. – Gerry Myerson Mar 20 '13 at 1:50
But seriously I think this is a site bug that needs to be MetaSO posted, so don't just delete it-- all of the comments under this question are going beyond their assigned HTML element and overlapping into the community bulletin, at least on my screen. – Aerovistae Mar 20 '13 at 2:11
@FrankMcGovern: it's fixed. – robjohn Mar 20 '13 at 3:24

The search term you want is "Knapsack Problem".

http://en.wikipedia.org/wiki/Knapsack_problem

There are some interactive ones online,

@zyx: If you want to maximize money spent, buy them all. If the best logs per money is outside your budget, exclude it and go on to the next. There could be an issue if the best logs/money almost exhausts your budget and all you can afford after that is a bad bargain. Say you are offered $(100,50), (60,31),(58,31),(3,10)$ and have $62$ to spend. You can get $118$ taking the middle two and only $103$ taking the top and bottom. But you can get $100$ and still have $12$ in your pocket, which might be the best choice. These problems are theoretically hard and practically easy. – Ross Millikan Mar 20 '13 at 2:03