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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:45:04+00:00 2026-05-12T11:45:04+00:00

I’m looking for [free] server software to store hierarchal data efficiently. My key challenge

  • 0

I’m looking for [free] server software to store hierarchal data efficiently. My key challenge is that an object or group of objects almost always has 2 “parents” and one or both parents can have different connections with other parents, and those descendants must remain distinct from the common parent’s other descendants.

Example:

A and B
    C
    D
    E and F
        G
        H
    E and I
        J
        K
L and M
    ...

I guess the gotcha will probably be that I’d strongly prefer to use this with PHP, but I’m open to learning a new language, as this is a personal project without any deadline. (I’m using a Linux server; I’m not willing to change that)

Edit:
To clarify my example – C, D and E are all direct descendants of both A and B, F and I are descendants of something else, possibly the same thing, possibly not, G and K are both direct descendants of both E and F, etc.

  • 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-12T11:45:04+00:00Added an answer on May 12, 2026 at 11:45 am

    I’m not sure if this is exactly what you’re looking for, but you can use Graphviz dot to model/graph relationships. Here’s the updated content of the .dot file, more like your clarification:

    digraph G {
        compound = true // allow edges between clusters
        subgraph cluster_ab {
            rank = same;
            A -> B -> A
        }
        A -> C [ltail=cluster_ab]
        A -> D [ltail=cluster_ab]
        A -> E [ltail=cluster_ab]
        subgraph cluster_ef {
            rank = same;
            E -> F -> E
        }
        E -> G [ltail=cluster_ef]
        E -> H [ltail=cluster_ef]
    
        subgraph cluster_ei {
            E -> I -> E
        }
        I -> J [ltail=cluster_ei]
        I -> K [ltail=cluster_ei]
    }
    

    sample dot output http://img21.imageshack.us/img21/6177/64094067.png

    This one is a little different, because you can’t create overlapping clusters (E->I and E->F). But I think it’s more like the way you’ve clarified, even though it isn’t terribly apparent that E and I are siblings — I also had to make sure to link from I to J,K, otherwise there was a warning and it looked a bit uglier.

    There are plenty of libraries that interface with Graphviz/dot that would let you generate these kinds of graphs dynamically, rather than by hand as I did. Then if you’ve already got a library to store/retrieve directed graphs, you’re pretty much there on storing hierarchical data. As to whether it’s efficient, as you mentioned in your question… depends on how much data you’re storing, of course.


    As @Kim points out in the comments, you can get a quite simplified graph by treating siblings as pairs, rather than individual nodes:

    digraph G {
        "A,B" -> C
        "A,B" -> D
        "A,B" -> E
        "E,F" -> G
        "E,F" -> H
    
        "E,I" -> J
        "E,I" -> K
    }
    

    It’s an obvious and elegant solution that I completely overlooked, although it remains a little ambiguous about sibling relationships when overlap occurs (E again).

    simpler graph http://img35.imageshack.us/img35/8969/so2b.png

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

Sidebar

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.