• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

What sorting algorith does something like this?

Kyteland

Diamond Member
I was given a problem where I need to sort a set of weighted elements in to the minimum number of fixed sized containers. I remember doing something like this for a class in school, but I can't remember how.

So imagine that you have a pile of coins and that those coins can may have any value less than $1.00. I want something to sort those coins in to piles with a value of $1.00 or less. I need a way to minimize the number of piles produced during sorting.

My firt thought was something like the traveling salesman problem, but that isn't right. I can't think of anything else.

If you can think of something that is listed in Introduction to Algorithms that would be great because I have the book in front of me. 😉

Edit: Found the solution. Thanks everyone.
http://en.wikipedia.org/wiki/Bin_packing_problem
 
Originally posted by: Kyteland
I was given a problem where I need to sort a set of weighted elements in to the minimum number of fixed sized containers. I remember doing something like this for a class in school, but I can't remember how.

So imagine that you have a pile of coins and that those coins can may have any value less than $1.00. I want something to sort those coins in to piles with a value of $1.00 or less. I need a way to minimize the number of piles produced during sorting.

My firt thought was something like the traveling salesman problem, but that isn't right. I can't think of anything else.

If you can think of something that is listed in Introduction to Algorithms that would be great because I have the book in front of me. 😉


linear programming.
 
Back
Top