Bin Packing Problem Variation with Restricted Bins & Items

  • Context: Undergrad 
  • Thread starter Thread starter Mentallic
  • Start date Start date
  • Tags Tags
    Bin
Click For Summary

Discussion Overview

The discussion revolves around a variation of the bin packing problem, where participants explore how to distribute a list of items with positive values into a limited number of bins, ensuring that the distribution is as even as possible. The constraints include a maximum number of items per bin and a total number of bins that exceeds the ratio of items to bins.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant inquires if the problem has a specific name and describes the constraints of sorting items into bins with a maximum capacity.
  • Another participant references external material on bin packing and questions whether the sum of item values in each bin must be equal, suggesting a sorting approach to distribute items.
  • A participant argues that sorting items and distributing them sequentially would lead to unequal sums in the bins, providing an example to illustrate this point.
  • There is a discussion about the implications of having multiple items with the same value and whether this affects the distribution strategy.
  • One participant expresses confidence in finding a more efficient algorithm for larger values of n, while another emphasizes the importance of achieving similar sums in each bin.
  • A suggestion is made to look into Multi-Way Number Partitioning as a potential approach to the problem.

Areas of Agreement / Disagreement

Participants generally agree that achieving similar sums in each bin is a key aspect of the problem, but there is no consensus on the best approach or algorithm to use. Multiple competing views on the distribution strategies remain unresolved.

Contextual Notes

Participants note that the problem's complexity may vary based on the distribution of item values and the constraints of the bins. There are unresolved questions about the implications of item values and the potential need for multiple bins for identical values.

Mentallic
Homework Helper
Messages
3,802
Reaction score
95
I have a problem whereby I'm given an item list of size n with the value of each item being greater than zero, and need to sort them among a restricted amount of bins as evenly as possible. Additionally, each bin can hold at most k items and the number of bins is slightly greater than n/k (Giving some wiggle room to have k-1 items in some bins but k items in most).

Does this sort of problem have a name?
 
Mathematics news on Phys.org
http://www.seas.upenn.edu/~cit596/notes/dave/p-and-np4.html
 
Hi guys, no solution from me, just asking for clarification: in Buzz's reference the value of the items plays a role (the integer values in each bin have to add up to the same number). It looks as if that isn't a requirement in the post #1 case. So I thought I'd just ask: would it be Ok if I would just sort the list and place the first n/k from the sorted list in bin #1, the next n/k in bin #2 etc. ?

Probably not, because that would allow items with the same value to end up in adjacent bins -- but I can't find that restriction in the description.
On the other hand: what if the list has more than k entries for items with a particular value? Would a solution have to include assigning multiple bins to the same value in such a case ? (this time I suppose a "yes"...)

The described sort of problem reminds me of the list of addresses in the back of my appointment book: there are 10 tabs for 26 first letters. Some pages are too full, others almost empty.

With an initial sort of time complexity ##O(n \log n)## and some algorithm to assign value ranges to bins I don't suppose the problem described in post #1 is necessarily ##O(2^n)## , then.
 
Buzz Bloom said:
http://www.seas.upenn.edu/~cit596/notes/dave/p-and-np4.html

Thanks, I'll look more into integer bin packing. At the moment, my problem is going to have a value of n in the hundreds so O(2n) is just too unreasonable, but I'm confident there exists a more efficient algorithm that provides an approximate solution.

BvU said:
Hi guys, no solution from me, just asking for clarification: in Buzz's reference the value of the items plays a role (the integer values in each bin have to add up to the same number). It looks as if that isn't a requirement in the post #1 case. So I thought I'd just ask: would it be Ok if I would just sort the list and place the first n/k from the sorted list in bin #1, the next n/k in bin #2 etc. ?
Well, if you sort the items and place the same amount of them into each bin sequentially, you'll definitely not have a similar sum in each bin. You'll actually end up with the worst possible solution!

example, given the list, (10,5,1,2,9,5) and 2 bins, if you sort the list you'll get (1,2,5,5,9,10) and placing the first 3 into bin 1 gives 1+2+5=8 while bin 2 has 5+9+10=24. These values are the furthest from being equal to the optimal average in each bin of (1+2+5+5+9+10)/2 = 16.
Finding the optimal solution for this list can be easily done by hand since you know what the optimal solution should be, and the list is small with nice numbers that can be chosen to sum to 16.

BvU said:
Probably not, because that would allow items with the same value to end up in adjacent bins -- but I can't find that restriction in the description.
On the other hand: what if the list has more than k entries for items with a particular value? Would a solution have to include assigning multiple bins to the same value in such a case ? (this time I suppose a "yes"...)
In my problem, there's no issue with having many equal values. In fact, the more equal that the entire list is, the easier the problem becomes because you can choose any k values and end up with approximately the average (optimal) solution.

BvU said:
The described sort of problem reminds me of the list of addresses in the back of my appointment book: there are 10 tabs for 26 first letters. Some pages are too full, others almost empty.
Yes, it's very similar to that too!
 
Mentallic said:
Well, if you sort the items and place the same amount of them into each bin sequentially, you'll definitely not have a similar sum in each bin. You'll actually end up with the worst possible solution!
That is what I missed in the problem statement: apparently you want similar sums in each bin when you say "evenly" ?
 
BvU said:
That is what I missed in the problem statement: apparently you want similar sums in each bin when you say "evenly" ?
Yes.
 
  • Like
Likes   Reactions: BvU
  • Like
Likes   Reactions: BvU

Similar threads

  • · Replies 37 ·
2
Replies
37
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 18 ·
Replies
18
Views
3K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 3 ·
Replies
3
Views
8K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 1 ·
Replies
1
Views
5K
  • · Replies 8 ·
Replies
8
Views
2K