Say I have a set of entities and multiple hierarchies based on them, each hierarchy modeling a different type of relationship. What would be a useful structure to model this scenario?
For instance, imagine this scenario:
Entities are software modules
There are two hierarchies in our mental model of the situation (I'm ignoring how we'd actually represent this on the filesystem for this question):
- "Technologically related" with edges from
JSONtoAccountJSONandBlogpostJSON, etc - "Feature related" with edges from
AccounttoAccountJSONandAccountUI, etc
- "Technologically related" with edges from
One possibility is a labeled directed multigraph where the edges are labeled either tech or feature, but this misses at least one constraint: that if we look only at edges of one type they form a tree[1].
Another possibility is a multitree, but that disallows diamonds, and we can have diamonds when using edges of both labels.
Suggestions from outside of graph theory are also welcome. The fact that we're starting with trees/forests makes me think of graph theory, but maybe there's a better way to describe what happens when they're combined.
[1] Or a forest if the entities in a particular hierarchy aren't necessarily connected.