Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: x objects in y containers where all objects are used

by MidLifeXis (Monsignor)
on Nov 06, 2009 at 15:45 UTC ( [id://805509]=note: print w/replies, xml ) Need Help??


in reply to x objects in y containers where all objects are used

Update2: Re-re-reading the OP, I now understand the question. I did make a bad assumption. :-)

Update: This node is based on the assumption that the bins have a maximum size. If that assumption is invalid, and the task is to create a set of unordered combinations, then this post is not a solution (well, the fitness function is trivial). See blokhead's comment below.

This is a bin packing algorithm, but you are looking for all solutions, not just the best solution. This is a theory problem.

See also the knapsack problem, travelling salesman problem, and other examples of this class of problem.

--MidLifeXis

  • Comment on Re: x objects in y containers where all objects are used

Replies are listed 'Best First'.
Re^2: x objects in y containers where all objects are used
by blokhead (Monsignor) on Nov 06, 2009 at 16:29 UTC
    In bin-packing, the difficulty of the problem comes from the fact that the items are different sizes. In any casting of the OP problem in terms of bin packing, you would have all items the same size, which completely trivializes the problem. Also, in any bin-packing problem there is generally an unlimited supply of bins of fixed capacity, unlike in the OP where there are a fixed number of bins with unlimited capacity. Any references on bin packing (let alone TSP, which seems completely unrelated apart from it also being NP-complete, or knapsack, in which items have both a variable cost and variable weight) will be unlikely to have anything relevant for these variants (let alone the very specific problem of enumerating solutions).

    blokhead

      Update: Bad assumption confirmed.

      I am running on moritz's assumption that the bins have limited sizes. Otherwise, you are correct, it is a trivial loop or recursive iteration problem. You are also correct that the TSP is probably casting too large of a net. I tend to be a generalist.

      The solution I have in mind is the general NP solution - exhaustive search with a fitness function. In this case, the fitness function would be to check if the binsize was overshot.

      --MidLifeXis

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://805509]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (10)
As of 2024-04-19 08:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found