Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7793197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T22:24:35+00:00 2026-06-01T22:24:35+00:00

When I say box I am talking about shipping boxes. I have a number

  • 0

When I say box I am talking about shipping boxes.

I have a number of random sized, small items that I need to pack into as few boxes as possible.
I need to know what box sizes are optimal.

  • All items are rectangular prisms.
  • It’s easy to exclude a box size for an item which is too large to fit.
  • I know the box sizes (they are the available box sizes which I have in-stock)
  • Items can be positioned horizontally or vertically, not diagonal.
  • As many boxes as required can be used. The goal is to use as few boxes as possible.
  • Multiple box sizes may be used to optimally fit the varying-sized items.

What algorithm exists that allows me to calculate the box sizes I need to use for optimal space usage? To fit the most items into as few boxes as possible.

The available box sizes come from what I have available, in-stock. You can create a finite number of made up box sizes for example purposes.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T22:24:37+00:00Added an answer on June 1, 2026 at 10:24 pm

    This is a generalization of the Bin packing problem, meaning it is NP-Hard.

    To see this, imagine all bins and packages have the same width and height, and additionally all bins (but not packages) have the same length. Then it is a one-dimensional problem: we have bins of size V, and packages of size a1, a2, …, an. This simplified case is exactly the Bin-packing problem. Thus, a fast solution to your problem gives us a fast solution to bin-packing, so your problem is at least as hard; and since bin-packing is NP-Hard, so is your problem.


    There are some approximation algorithms available though; for example, it’s easy to show that the simple first-fit algorithm (put every item in the first bin that it fits into) will never do worse than 2x the optimal solution.

    The similar “First Fit Decreasing” algorithm (sort the items in descending order, then put every item in the first bin it fits into) is even better, guaranteeing to be within about 25% of the optimal solution. There is also another, slightly more complicated algorithm called MFFD which guarantees to be within about 20%.

    And of course, with only 7 boxes, you could always just brute-force the solution. This will require about 7n steps (where n is the number of items), so this solution is infeasible with more than a dozen or so items.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am talking about windows GUI programs. Say a program-window has a dialog box
Say there are x number of boxes, each box contains an inventory of the
Let's say I have a text box, and I have to put a number
I have list box with items.... say Listboxitem1 listboxitem2 listboxitem3... Is it possible to
Say I have a class Box with two attributes, self.contents and self.number. I have
Say I have a select box eg <div data-bind='visible: someProp'> <select class=selectSubWidgets data-bind='options: subWidgets,optionsText:
Say you have a box and you use the box shadow css. How could
Lets say I have a text box which should have a default value.... and
Let's say we have a box with some short paragraphs: <div style=overflow:hidden> <p>Some text</p>
Say you have a 50px by 50px div/box <div style=width: 50px; height: 50px;> </div>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.