### np-complete

#### Given a collection of consumers competing for a limited resource, allocate that resource to maximize it's applicability

Sorry the question title isn't very clear, this is a challenging question to ask without providing a more concrete example. Consider the following scenario: I have a number of friends whose birthdays are coming up on dates (d1..dn), and I've managed to come up with a number of gifts I'd like to purchase them of cost (c1..cn). Unfortunately, I only have a fixed amount of money (m) that I can save per day towards purchasing these gifts. The question I'd like to ask is: What is the ideal distribution of savings per gift (mi, where the sum of mi from 1..n == m) in order to minimize the aggregate deviance between my friends' birthdays and the date in which I'll have saved enough money to purchase that gift. What I'm looking for is either a solution to this problem, or a mapping to a solved problem that I can utilize to deterministically answer this question. Thanks for pondering it, and let me know if I can provide any additional clarification!

I think you've stated a form of a knapsack problem with some additional complications - the knapsack problem is NP-Complete (p 247, Garey and Johnson). The basic knapsack problem is where you have a number of objects each with a volume and a value - you want to fill a knapsack of fixed volume with the objects to maximize the value without exceeding the knapsack capacity. Given that you have stages (days) and resources (money) and the resources change by day while you decide what purchases to make, would lead me to a dynamic programming solution technique rather than a straight optimization model. Could you clarify in comments "minimizing the deviance"? I'm not sure I understand that part. BTW, mathoverflow.com is probably not helpful for this. If you look at algorithm questions, 50 on stackoverflow and 50 on mathoverflow, you'll find the questions (and answers) on stackoverflow have a lot more in common with the problem you are considering. There is a new site called OR Exchange, but there's not a lot of traffic there yet.

### Related Links

Grid dominating set is NP-complete

Given a graph with n vertices and m edges, does it contain a simple cycle of length ⌈n/2⌉?

NP-complete or NP-hard?

Why using linear integer programming (ILP) though it is NP-Complete?

Prove NP-Completeness of generating 2 shortest routes over given edge grouping constraints?

Reduction to Clique prob

Approximation Algorithm between two NP compete problems

Is it possible to find the probability to a solution of NP-complete problems?

Knapsack for each weight having multiple values - Is it possible to solve?

Reduction from Maximum independent set to Dominating set to prove the Dominating set is NP-complete

How I can prove that 2-CNF is not NP-complete?

When NP complete becomes NP hard

Can it be proven no polynomial algorithm exists for an NP-Complete prob.?

Effect of number base when proving NP completeness of numerical problems

How to reduce 3COLOR to 3SAT?

proof NP-complete