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 8849749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:44:05+00:00 2026-06-14T12:44:05+00:00

Here is my problem scenario: I have a few thousand objects. Each object has

  • 0

Here is my problem scenario:

I have a few thousand objects. Each object has 256 Boolean dimensions (true or false). I want to find clusters such that

  1. Each cluster has a minimum amount of true dimensions (a dimension of a cluster is true iff any object in that cluster has this dimension market as true).
  2. The overall sum of all true dimensions over all clusters is minimal.
  3. Each cluster is not bigger than a certain predefined value.

The optimality of the solution is not required, however the algorithm should be fast.

How should I best approach this problem? Is there an algorithm that you would recommend?


Note: I already implemented a brute force approach to this problem, but it is quite slow.

  • 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-14T12:44:06+00:00Added an answer on June 14, 2026 at 12:44 pm

    You can write this as a mixed-integer linear program (MILP):

    You have a fixed amount of clusters and objects.
    Each cluster can have at most 256 true dimensions.
    Parameter D_{k,j} is equal to 1 if dimension i is true in object k.

    You have the following variables:

    1. d_{i,j} is a binary variable equal to 1 if dimension j is a true dimension of cluster i.
    2. o_{i,k} is a binary variable that is true if object k is in cluster i.

    You have the following constraints:

    1. Each object can be in only one cluster
    2. A dimension is true in cluster iif it is true in all objects inside cluster
    3. Each cluster can only hold M objects

    The second constraint is a tricky one because it doesn’t feel linear, but actually you can write it linearly.
    The constraints can be written as:

    1. C1 for all k
    2. C2 for all i and j
    3. C3 for all i

    The objective function can be the sum of all d_{i,j}, so you minimize the overall sum of all true dimensions over all clusters.

    Let me explain the second constraint: on the right-hand-side, you compute the number of elements inside cluster i, minus the number of objects having dimension j set to one. This is equal to zero if all objects have dimension j, or something positive if not.

    If this evaluates to zero, then d_{i,j} must be equal to one to avoid violating the constraint. If not, d_{i,j} can be anything (zero or one). This works because d_{i,j} will appear in the objective function, which means that when the program has the choice between zero or one, it will choose zero.

    Once you write this up, you can solve it using a commercial solver (if you have one, they give free licenses to students, in case you are one) or Coin-OR just to name one.

    Just as a reminder: solving MILPs is an NP-complete problem.

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

Sidebar

Related Questions

Here is the scenario: I have run a trace for few hours during maximum
As my title says, I have a set property crash problem. Here's the scenario:
Here is my scenario: I have a static object which will connect to a
I have a tricky problem to deal with. Here's the scenario: I have an
I have encountered a problem when simulation transparency in OpenGL. Here is the scenario:
Here's a problem scenario: I've got a C++ object that includes a Cleanup() virtual
I have problems with my keyup binding when cloning an element. Here's the scenario:
I have a problem here im trying to upload a file first time it
I have a problem here. My Zend_Forms do not render in view script. Via
I have a problem here I can't solve. I have a database of houses

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.