Working with multilayer networks?

Hi everyone!

I'm working on one specific case which involves multilayer networks and therefore considering to use Neo4j instead of the mostly unstandardized software solutions like MuxViz, Py3plex, etc.

For more info please visit

The mentioned packages includes specific algorithms which can calculate centrality measures on multilayer networks, taking into account all of the layers, not only one. That being said, my scenario could resemble something like this:

A.) Trade networks - countries are nodes, links are traded goods, date is a temporal value. That way for example i can have five networks with five different goods, one network for each year;


B.) Communication networks - people are nodes, links are channels of communication, date is also a temporal value. For example, i have three networks (calls, messages, e-mails).

Conclusively, Neo4j can easily calculate centrality measures for each network layer, but the idea is to take all layers into account at once.

Any ideas?

Please help... anyone!

Hi @accounts4 ,

Have you already looked at using the centrality algorithms in the Graph Data Science library? Neo4j's property graph model is naturally a multilayer network because each relationship must have a relationship type (effectively creating a layer). When you run any of the centrality algos, you can decide which relationship types to include.

For example, take a look at page rank: PageRank - Neo4j Graph Data Science

There's a good article about using it here:


1 Like

Hi @abk ,
thanks for the reply.

Ok, understood. In that case i have two more questions:

1.) Is it possible to somehow define interlayer links between different layers (not intralayer!) and make specific calculations? Or that option is not available as of yet?

2.) Regarding the case you have described, please consider this scenario:

  • nodes are countries;
  • we have 10 networks which consist of 10 randomly selected traded goods;
  • for each traded good we have 5 years of data, meaning 5 networks (or better to say network dynamics over 5 years).

What would be the best case scenario to load data in the above mentioned case? Put everything into one network, define 10 different type of links (traded goods) and for each traded good define link weights (amount of traded goods). Furthermore, would it be possible to add time (year) attribute which would link to one specific type of link (traded good) and corresponding link weights (amount of traded goods) for that specific year?

Alternatively we can make:
a.) 10 networks (for each traded good) where each network have a time component - five years with corresponding link weights;
b.) 5 networks (for each year), each network containing 10 different link types (traded goods) and corresponding link weights.

What would be the best scenario for this?

Hi @accounts4 ,

  1. Neo4j doesn't formally distinguish between kinds of relationships. The knowledge of the different kinds (like inter vs intra) of relationships is not in the DBMS, only in the application/domain.

  2. The best way to identify the right scenario is to try a few different models with a small amount of data, to see whether you get results that you like. As a domain expert knowing the solution you're looking for you're the best person to know the right answer.


Hi again @abk ! I need to refresh this topic with one more technical question.

Let's say that the relationship type is only one and it's called "export". Furthermore, i have several different link properties such as year, value, quantity and code which represents type of specific good.

There are several dozens different codes (ie type of goods) and i want to take into calculation only 15 of them. Please note that each traded good represents one layer.

If they start with some specific (similar) number, for example:

good 1 - 300001
good 2 - 300005
good 3 - 300034
etc. it possble to use some regular expressions to include all of the desired codes or i need to list each one when using GDS?

btw. these codes are in fact HS classification codes for traded goods.

Can anyone help please? :frowning:

Hi @accounts4 ,

What have you tried? Neo4j supports both regular expression predicates and also more efficient "starts with" predicates.

For regular expressions, take a look at: WHERE - Neo4j Cypher Manual

For starts with , read : Operators - Neo4j Cypher Manual


Hi @abk , i think that will help. I'll definitely get back to you with the results.


any updates?

I'll excitedly learning network science and how to model multi-layer networks. Would be great to know if you've been able to use Neo4j to do this so far!