# Solving an ordered knapsack problem exactly with a non linear (blackbox) evaluation function

Thanks in advance for the help.

I have the following problem which, for lack of a better description, I'm referring to as the problem I've listed in the title.

Specifically I have a knapsack problem where I must exactly fill the knapsack. Additionally, the order in which I place the elements into the knapsack affects the strength of the solution (but not the volume of the individual elements). The function that is used to evaluate the strength, or goodness, of the packing is non linear and very complex. Because of this, I have a model that I will use to repeatedly simulate my evaluation function to get an idea of the strength of each solution rather than directly evaluating my evaluation function (sort of like a surrogate function).

For example, suppose I have a knapsack of size ten. The following would be possible solutions assuming integers are the elements that I can place into the knapsack (for all intents in purposes my actual problem can be visualized in this manner): [5,5], [3,3,4], [4,3,3], etc.

What I'm interested in is two-fold. First, does this problem reduce to any well studied problems from which I could read up more on how they are solved? I'm currently thinking about using some kind of heuristic search to solve this problem, such as a Genetic Algorithm (I don't have to have the optimal solution, though I would like the best that I can get). Second and somewhat related to the first, what work if any has been done on problems that fit the description that I have given above? The knapsack problem is a very well studied problem and I would find it hard to believe if there hasn't been any work done on problems that fit my current one. Unfortunately though, while I've found work somewhat related to my problem, I haven't been able to find anything that directly reduces to my problem.

• Welcome to CS.SE! We're going to need to know something about the function you mention, or about the surrogate, to help you. Does it have any properties/structure? Is it monotonic (adding more elements always increases the goodness)? Is it approximately additive? sub-additive (upper-bounded by a linear function)? super-additive? convex? concave? Can you tell us anything useful about it? Without some kind of information about it, there's not likely to be any useful algorithm or answer possible, beyond saying that your problem is intractible.
– D.W.
Aug 24, 2016 at 21:09
• The surrogate function is essentially the output of a simulation; theres nothing else that I can really say about it besides that its complicated. The actual evaluation function outputs a probability that is computationally expensive to calculate. What I'm primarily interested in isn't so much a solution to my problem (after all, thats what the paper I intend publish will be about), but rather any work that's been done on similar problems. In particular, knapsack problems with the constraint that the knapsack must be completely filled and the property that solution quality is effected by Aug 24, 2016 at 21:34
• the order in which elements are placed into it. This is slightly different than the standard knapsack problem where each element placed in the knapsack contributes a certain amount to the solution quality as a function of its own constant individual contribution and an interaction with other elements in the knapsack (for example the simple case where each element has a constant value that is added to the solution quality). Aug 24, 2016 at 21:37