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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:12:52+00:00 2026-05-28T08:12:52+00:00

I have a list of formulae for combining elements: A + B + C

  • 0

I have a list of formulae for combining elements:

A + B + C = X
D + E + F = Y
G + H + I = Z

I want to ensure that given any random 4 elements, there will never be more than 1 applicable formula. For example the formulae below should not be allowed as if I get elements A, B, C and D then both are applicable:

A + B + C = X
B + C + D = Y

Every formula will consist of 3 elements on the LHS and it’s the LHS that I want to enforce the rule on.  
The elements are sortable, if that helps.


An alternative, equivalent problem:

I have a list of an array of 3 elements: List<Element[3]> How do I ensure that no 2 elements appear in more than one array.


What would be a reasonably efficient (runtime speed) way of doing this for a large number of elements and a large number for formulae (beyond brute forcing)?

  • 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-28T08:12:52+00:00Added an answer on May 28, 2026 at 8:12 am

    You can represent the constraints on the set of equations as a graph. The vertices are the elements, with n[i] elements in equation i. For equation i, there are thus n[i]*(n[i]-1)/2 pairs of elements; these become edges. Iterate through the equations, adding the edges to the graph. Anytime you’d want to add an edge that is already present, you’ve found a conflict.

    For each edge, you could store a set of equation numbers that would generate the edge; this allows the specific conflicts to be identified, rather than just the presence of conflicts.

    Let N be the number of equations and M the number of elements in the equation with the most elements. The time complexity is O(M^2*N), as is the space complexity. If all equations have a fixed number of elements, time and space usage will thus be O(N).

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

Sidebar

Related Questions

i have list of rows that user select and i want to delete them,
I have a list of documents that I want to paste relative links to
I have List I want to sort Desc by Priority, which is int and
i have list of images and on mouse over there is option box shows
I have a long list of names that I need to have quotes around
I have a list of items heading that are all in INTEGER (yes the
Possible Duplicate: Replace individual list elements in Haskell? I have managed to make some
I have a sharepoint list that has a number column call xyz i am
I am looking for a way to create a formula field that will list
So I have a SQL query that gives me a list of ints. Listed

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.