Are there constraint problem calculators?

166 Views Asked by At

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?

2

There are 2 best solutions below

0
On BEST ANSWER

The search term you want is "Knapsack Problem".

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

There are some interactive ones online,

https://www.google.com/#q=knapsack+problem+solver

As you remembered, this is in principle equivalent to CSP's, or any other NP-complete problem.

5
On

For each set, you can figure the logs/money ratio. Can you buy multiples of one type? If so, just buy as many as you want of the best. If not, buy the best one, and keep going down until you have spent as much as you want. If you have some money left over, look down to see if any small cheap sets are out there and think about those.