pymnet icon indicating copy to clipboard operation
pymnet copied to clipboard

How to solve the degree and centrality of nodes and other indicators

Open LINQcode1 opened this issue 1 year ago • 1 comments

Hello May I ask how to call related packages to solve some related node indicators? For example, the degree and centrality of nodes, etc.

LINQcode1 avatar Mar 08 '23 07:03 LINQcode1

Can you be more detailed ? I am not sure what is your main concern. Are you trying to do some network analysis ?

cloner174 avatar Apr 23 '24 19:04 cloner174

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.

ercco avatar Jun 17 '24 09:06 ercco