I am new to using Graphs.jl and I would like to know a good way to build a graph for a network of networks. My specific application is to build a graph representing something like what is shown in the figure:

4 modules (each module being a certain graph, let’s say a 2d lattice for simplicity), with some connections between vertices of nearest-neighboring modules (let’s say for simplicity that some vertices in one module are connected randomly to some others in another module).

I know how to generate graphs in Graphs.jl, but I am unsure how to (i) concatenate them and (ii) whether there is a pre-built nice way to add connections between them. I am specifically thinking of concatenating the graphs because I would like the flexibility of being able to connect graphs of different sizes and types (e.g. one lattice module with one random module).

Hey there @KalelR! This is an interesting question Can I ask what you want to do with this hierarchical graph? Depending on the answer, we may be able to find a solution that suits your needs

Hey, thanks for the interest!
Sure. I want to simulate a spiking neuron network with this topology. This is to model the neuronal culture shown in the figure: there are four modules, with neurons highly interconnected within the module, with sparse connections between the nearest-neighbor modules. Hope I explain this clearly. The graph is modular, but I’m not sure if I would call it hierarchical.

The idea I have in mind is to be able to construct each module separately, as they could potentially be different, with different sizes or different topology. And then connect these modules. This latter part probably requires more manual work, but it would be nice to be able to stick these modules together in a flexible way that facilitates adding the inter-modular connections later.

I think it would be very interesting to try to build a new hierarchical graph type within the Graphs.jl interface. Do you want to try? Happy to provide guidance