Sunday 15 April 2012

algorithm - Multiple Constraint Knapsack Problem -


If there is more than one obstacle (for example, both a volume limit and a weight limit, where quantity and weight are each item Not related), we get problem of multiplied breakfast, problem of multi-dimensional lid, or m-dimensional lid.

How do I code this in the most customized fashion? Well, one of the greatest forces can develop a recursive solution. It may be that the branch is bound and binding. But essentially for a long time you do some kind of memonization or use dynamic programming which again take large amounts of memory, if not done well.

The problem I am the commonest thing is that

I have a napask (capacity, value, i) in exchange for the usual impotence (capacity, I) because I have them The upper limit of both is that someone can guide me with this? Or, to solve these problems, appropriate resources should be made available to a large extent n

or to provide appropriate resources for completing this NP?

Thanks

Combine constraints, refer to Chapter 1.3.1, in which the constraints Merge is said to be.

An example is that you have
variable, obstacle 1, obstacle 1, 43, 66
2, 65, 54
3, 34, 49
4, 99, 32
5, 2, 88

Multiply the first hurdle by some large number, then add it to the other obstacle.

Then you have
variable, mergence barrier1, 430066
2, 650054
3, 340049
4, 990032
5, 20088

Whatever algorithm you wanted to do with an obstacle from there. The main limiter, which takes into account how many points your variable can hold.


No comments:

Post a Comment