pymnet
pymnet copied to clipboard
How to solve the degree and centrality of nodes and other indicators
Hello May I ask how to call related packages to solve some related node indicators? For example, the degree and centrality of nodes, etc.
Can you be more detailed ? I am not sure what is your main concern. Are you trying to do some network analysis ?
Hi, I'm not entirely certain what "related packages" means in this context. To find e.g. degrees of node-layers, you can do:
>>> M = pymnet.MultilayerNetwork(aspects=1,fullyInterconnected=False)
>>> M[1,2,'a','b'] = 1
>>> M[2,2,'b','b'] = 1
>>> pymnet.degs(M,degstype='nodes')
{(1, 'a'): 1, (2, 'b'): 2}
Multilayer centrality depends on how you define it, so implementing a function for your application could be a good idea.