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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:16:24+00:00 2026-06-17T14:16:24+00:00

I have a set of elements that have various dependencies on each other. These

  • 0

I have a set of elements that have various dependencies on each other. These dependencies might be strict, eg. a depends on b and c; or some elements might have alternatives, eg. s depends on t or u. There are no circular dependencies.

I’m trying to do two things with the dependency information:

  1. Determine whether a given set of elements has all dependencies resolved
  2. List all possible completely resolved sets of elements

(In fact 2 is trivial given 1, since I can just generate all permutations and check them, where resources allow. There are probably better algorithms for that though.)

Are there algorithms for this that accommodate elements with alternative dependencies? I’ve found plenty that only account for strict dependencies, but I don’t know enough terminology to narrow my search.

  • 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-17T14:16:25+00:00Added an answer on June 17, 2026 at 2:16 pm

    Let’s assume your elements are listed in L. Then, for each element e in L you validate that all direct dependencies are resolved. To validate each element e, you could walk through the list D of e‘s dependencies and ensure that all elements d in D are found in L. To address the case of alternatives, now think of each d as a list of alternative dependencies on it’s own.

    for each d in e.D 
        d_ok = false
        for each alt_d in d
            if alt_d in L: d_ok = true, break
        if not d_ok: return false
    return true
    

    To list all possible sets that satisfy your dependencies, you can use a permutation index to iterate through all alt_ds in all possible different orders. You can generate these indices beforehand, because you know the number of alternatives for each element of L. You could check out ndgrid in MATLAB used as in the following code, assuming there is element a with three dependencies and b with two:

    [idx_a, idx_b] = ndgrid(1:3, 1:2);
    idx = [idx_a(:), idx_b(:)]; 
    

    for a reference on how to use such precomputed indices, independently of the language you want to implement this in.

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

Sidebar

Related Questions

I have a program that search some elements and show these on a GoogleMap.
I have a set of unique elements (there are not two identical elements). And
I have an NSObject set up to control various elements on my screen. I
I have a series of UITableViewCell elements with various UIControls to set model values.
I have a canvas where there are various amounts of child elements on the
I have a paging control on my site that has it's container element set
I have set of 6 elements and I would like to filter by every
I have a set of selected elements in jQuery: <div class=element></div> <div class=element></div> <div
I have a set of vertically ordered elements. They are displayed with the following
I have a vector of booleans. I need to set its elements from n-th

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.