Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inability to obtain the degree/strength of a node in an aggregate network #52

Open
aviswaroop opened this issue Jan 9, 2025 · 0 comments

Comments

@aviswaroop
Copy link

Greetings,
I wish to obtain the out-degree and out-strength of a node in an aggregate network, but have been unable to do so with the available functions.

I first created a multilayer network with three layers, and then subsequently created the aggregate network.

mnet = pymnet.MultilayerNetwork(aspects=1, directed=False, fullyInterconnected=False)

# Add individual layers to the multiplex network
mnet.add_layer("layer1")
mnet.add_layer("layer2")
mnet.add_layer("layer3")

...
...

AN = pymnet.aggregate(mnet, 1)

Using list(AN) and list(AN.edges), I was able to verify that the appropriate nodes and edges exist in the aggregate network.

I have been able to obtain the aggregated weight for an edge in the aggregate network using AN[source, target], but I have not been able to get further information such as the degree of a node.

In the following code, I was able to get the node label as output, and also the degree distribution. But with the exception of these two, the others output 0.

for element in AN:
    node = pymnet.net.MultilayerNode(element, AN, layers)
    print('node:', element)
    print('degree', node.deg())
    print('outdegree', node.deg_out())
    print('outstrength', node.strength_out())
    print('degree distribution', pymnet.degs(AN))

I found a few private functions within the MultilayerNetwork class, but the functions I tried below were also giving the output as 0.

print(AN._get_degree_out('DK'))
print(AN._get_strength_out('DK'))
print(AN._get_link(list(AN.edges)[0]))

I seek your guidance on the appropriate method to identify the characteristics of a node in an aggregate network.

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant