Graph Theory 101 - Part:8 - Multilayer & Multiplex Networks
Next few articles will be a little detour from mainstream graph theory into one of its fascinating branches called "Network Science". We can correlate many phenomena and features of network science with daily life. In this current article, we are going to take a look into "multi-layer networks". The name seems complex but is not a very difficult concept to relate to with everyday life. Of course, deeper studies into any subject is really complex, but we are not that worried as the article series as it states is a "101 series", so we restrict ourselves to concepts only. To discuss this topic, we will take a scenario which will help us understand the multi-layer network.
We are actually going to look into two concepts in reality, "multi-layer network" and "multiplex network". Let us begin our journey with "multi-layer network".
Ravi has been planning to visit his ancestral village for quite a long time now. Last time he visited, was when he was a kid and has not been able to do so ever since. Putting down his cup of coffee on the table, he quickly fires up Google Flight and start searching for a flight. The problem is there is no direct flights and he has to jump transport. From airport he needs to take a cab and reach railway?station to take a train ride to the town that is closest to his village. Then from station, he needs to board a bus and take an hour's ride to reach his village. But that's not the end of the journey, his ancestral home is on far side of the river, so finally he needs to take a boat ride to reach his home. Hmmm, he said to himself, "A long but exciting journey awaits me".
If we look closely, we can see that Ravi has to change multiple modes of transportation to go from Point-A (his present location) to Point-B (his ancestral home). All these modes of transport connect various intermediate points in his travel path, but all these transport modes are different from each other. We can think the various modes of transport as being different layers and the way the travel path goes from one layer to another defines the multi-layer structure of the journey. We can visualize the flow using "pymnet" library of Python. The code was run in Spyder IDE, as couldn't fix few Jupyter notebook related errors.
from pymnet import *
import matplotlib.pyplot as plt
%matplotlib inline
G = MultilayerNetwork(aspects=1)
# Layer-A represent CAB transport network
G.add_layer('A')
G.add_node(1,layer='A')
G.add_node(2,layer='A')
G[1,2,'A','A'] = 1
# Layer-B represent AIR transport network
G.add_layer('B')
G.add_node(2,layer='B')
G.add_node(3,layer='B')
G[2,'A'][2,'B'] = 1
G[2,'B'][3,'B'] = 1
# Layer-C represent RAILWAY transport network
G.add_layer('C')
G.add_node(3,layer='C')
G.add_node(4,layer='C')
G[3,'B'][3,'C'] = 1
G[3,'C'][4,'C'] = 1
# Layer-D represent BUS transport network
G.add_layer('D')
G.add_node(4,layer='D')
G.add_node(5,layer='D')
G[4,'C'][4,'D'] = 1
G[4,'D'][5,'D'] = 1
# Layer-E represent WATER transport network
G.add_layer('E')
G.add_node(5,layer='E')
G.add_node(6,layer='E')
G[5,'D'][5,'E'] = 1
G[5,'E'][6,'E'] = 1
# Plot the multi-layer network
fig = draw(G,layerColorDict={'A':"y", 'B':"m", 'C': "c", 'D': "g", 'E':"r"},defaultEdgeColor="black", layout="spring", layergap=0.7, defaultLayerLabelLoc= (0,0), figsize=(10,10))
Multilayer network can be very useful in studies of spreading of zoonotic diseases like Flu or COVID that jumped from animals to humans. Here "animal" and "human" both are part of separate layers but just like there are edges between the layers of a multi-layer network, which is called "coupling", spread of zoonotic viruses also depends on these couplings be it contact or conducive mutation of virus to be able to infect human, etc. The stronger the coupling, the more likely the jump from one layer to another.
We can see multi-layer networks almost everywhere around us from financial transactions to financial frauds, from transport networks to spread of diseases.
领英推荐
Next, let us briefly look upon another interesting network called "multiplex network". In this type of network, we are interested in nodes which are part of different network layers within a multi-layer network. Take for example role of person as "husband/wife/father/mother/son/daughter" in context of a "family layer", the same person in context of "society layer" might be having a different role (say member of the development committee for the community), again in the "professional layer" same person will have a different role to play. So, we see it is the same person, but roles played by the person are different in different contexts (here akin to layers). The different layers are multiplexing onto a single node i.e. the person in this example.
from pymnet import *
import matplotlib.pyplot as plt
%matplotlib inline
# Define the network
G = MultiplexNetwork(couplings='none')
G.add_node("Andy")
G.add_node("Carol")
G.add_node("Tyler")
G.add_layer("Family")
G.add_layer("Work")
# Define connections
G["Andy","Carol","Family","Family"] = 1
G["Andy","Tyler","Work","Work"] = 1
# Plot the network?
fig = draw(G,layerColorDict={"Family":"y", "Work":"c"},defaultEdgeColor="red", layout="spring", layergap=2, defaultLayerLabelLoc= (0,1), figsize=(10,10))
Here same node "Andy" is part of two different layers and have different intra-layer connections. We can say that Andy and Carol are family, but Tyler is not part of the family by checking the "Family" layer and the intra-layer connections that exists on that layer. Similarly, we can deduce that Andy and Tyler are colleagues, but Carol doesn't work in the same organization as Andy & Tyler. This is evident from the intra-layer connection that exists between Andy and Tyler on the "Work" layer.
This is just a glimpse of how powerful a simple concept of "node" and "edges" represented by graph theory can become as a tool of analyzing data and the relationship. A small out of the context example, suppose we are investigating some sort of collusion between seemingly unrelated groups, in an environment supposedly to be random. What we can do is to model the connections within that environment as some graphs, now if there is indeed a collusion between certain groups (represented by node), we can start seeing patterns like cycles popping up in the graph every time we run the simulations on different data sets. And then perform a subgraph isomorphism using cycles on the graph formed by the dataset; then every time the probability is high that a cycle will pop up that is formed precisely by the nodes that are colluding. This is just an over simplistic example as we have to use certain advanced notions within network science to establish such collusion. But this example was just for illustration purpose as to how graphs can be used to understand relations and expose patterns.
I hope you liked this detour.