Here is the problem is want to solve:

I want to connect nodes with directed labelled edges, but this two nodes are potentially themselves graphs, hypergraphs or the current structure I don't have a name for.

Here is a simple example with a graph $(v_1,e_1,v_2)$ where nodes $v_1$ and $v_2$ are connected by $e_1$. I want to have the following structure: $((v_1,e_1,v_2),e_2,(v_3,e_3,v_4))$

in this case, the $v_i$ hold a single value (i.e. classical graph nodes)

What I don't know is:

  • What is the name of such a structure ?
  • If it's a well known data structure, are there some efficient implementations ?

1 Answer 1


No, this isn't a hypergraph. I don't think it has a standard "name". Call it whatever you like: as long as you define your terms clearly, you should be fine.

Yes, you can implement this efficiently using any standard data structure for representing graphs: e.g., adjacency lists. Each node of the "outer" graph will contain a pointer to a data structure that describes the "inner" graph it represents.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.