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

  • Home
  • SEARCH
  • 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 4035104
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:03:23+00:00 2026-05-20T12:03:23+00:00

I have the following problem: I have a given number of identically formed items

  • 0

I have the following problem:

  1. I have a given number of identically formed items with different colors (I know how many there are from each color)
  2. I pack these items into boxes that can hold each a given number (n) of item in such way that I use the minimum number of boxes: round_up(total_nr_of_items/n)
  3. There are some colors I am not allowed to put in one box except if I can’t otherwise have the ideal number of boxes.
  4. There is a minimal number of items from each color (different for each color) that I’m allowed to put in a box. That is I can decide to put 0 pcs. of a color into a box or a minimum of k pcs. or above. This constraint can also be broken (as few times as possible) if the packing could not be done with the minimum number of boxes.
  5. I want to find a solution where as few colors as possible are split between boxes.

I think this is a kind of packing problem but I don’t know which one.

Please suggest into which packing problem can the above be converted into and/or an algorithm that I could use to solve this problem.

  • 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-05-20T12:03:23+00:00Added an answer on May 20, 2026 at 12:03 pm

    Looks like an NP-Hard constraint satisfaction problem. You’ll have hard and soft constraints something like this.

    Build-in constraints:

    • I have a given number of identically formed items with different colors (I know how many there are from each color)

    Hard constraints:

    • There are some colors I am not allowed to put in one box.

    • There is a minimal number of items from each color (different for each color) that I’m allowed to put in a box. That is I can decide to put 0 pcs. of a color into a box or a minimum of k pcs. or above.

    Soft constraints:

    • I pack these items into boxes that can hold each a given number (n) of item in such way that I use the minimum number of boxes: round_up(total_nr_of_items/n)

    Softer constraints (or really low weight soft constraints):

    • I want to find a solution where as few colors as possible are split between boxes.

    For algorithms to solve this, take a look at Simulated annealing, Tabu search, Branch and bound, …

    For software which implements such algorithms and support constraints, take a look at Drools Planner (java, open source).

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

Sidebar

Related Questions

I have the following problem: I am given a tree with N apples, for
I have the following problem, given the following service contract, data contract, and service
Given the following problem , I'd appreciate for any corrections since I have no
I have a problem with nested templates and their template specialization. Given the following
I am working in C# 4.0 and I have the following problem: given a
I have to solve the following optimization problem: Given a set of elements (E1,E2,E3,E4,E5,E6)
Given the following problem : we have participants and we want to place them
I face the following problem in a cryptographical application: I have given a set
Someone I know went to an interview and was given the following problem to
I am working on the following problem: I have to convert a given array

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.