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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:44:27+00:00 2026-06-04T21:44:27+00:00

I am given 3 sets A, B and C, each with n elements. These

  • 0

I am given 3 sets A, B and C, each with n elements. These sets can contain duplicates (not certain if Set is the right term).

Now I am trying to form a set D with n elements (say D1 to Dn), each element Di containing 3 elements, one from A, one from B and one from C.

My objective is to find the set D which minimizes the sum of products of elements in Di.

Brute force seems to be a pretty bad idea here because even for n>5, the algorithm slows down pretty badly. Can anyone suggest a better approach? Is Linear Programming suitable for 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-06-04T21:44:29+00:00Added an answer on June 4, 2026 at 9:44 pm

    So you want to form two bipartite graphs that create a matching of elements of A-B and B-C, such that the average product (a_i * b_j * c_k) is minimized.

    Unfortunately I believe this is an NP-hard problem. (if you take the number of matchings n=3 as a variable)

    I don’t think the two matchings can be made seperately:

    Consider A = {1, 10}, B = {1, 10}

    The matching of A,B in isolation is 1 x 10 = 10 and 1 x 10 = 10 (for a total of 20)

    However consider C = { 1, 10000 }

    If we take the greedy match of A,B with C we get 10 x 1 = 10 and 10 x 10000 = 100000 (for a total of 100010)

    However if we had of taken the non-optimal matching A,B as 1 x 1 = 1 and 10 x 10 = 100 (for a total of 101)

    We could then match it with C as 1 x 10000 = 10000 and 100 x 10 = 1000 (for a total of 11000)

    So we can see that it is necessary to consider all possible combinations.

    This isn’t a proof that it’s NP-hard, but I hope it communicates an intuition.

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

Sidebar

Related Questions

Given a set** S containing duplicate elements, how can one determine the total number
Given two sets a = [5,3,4,1,2,6,7] b = [1,2,4,9] c = set(a) - set(b)
Given several vectors/sets, each of which contains multiple integer numbers which are different within
Ok I have a dynamically created set of elements where each particular kind gets
I have been given 2 data sets and want to perform cluster analysis for
Given an admin media class that sets up a rich text editor, like: class
Two sets of 'n' numbers are given A and B. Chose one element from
Given is a set S = {s 1 , ..., s m } where
Given a package, how can I automatically find all its sub-packages?
Given these two queries: Select t1.id, t2.companyName from table1 t1 INNER JOIN table2 t2

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.