Retrieve all modules a physical node is assigned to in python API #272
-
Hi Sorry if i'm spamming you again. I'm using the python API to partition a multilayer network. And I want to get all the modules each physical node is assigned to, using the Infomap object. I know I can write out a I know that I can call Maybe a bit more context: I study bioinformatics and the nodes are genome fragments. I'm exploring if the overlapping clustering could even perform better than the traditionally non-overlapping way. My network was created layer by layer, in each layer, link by link, using thanks in advance, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @u-xixi, For a multilayer network, you can access the for node in im.nodes:
print(node.node_id, node.layer_id, node.module_id) This will give you overlapping modules, as the same See this example. |
Beta Was this translation helpful? Give feedback.
Hi @u-xixi,
For a multilayer network, you can access the
node_id
andlayer_id
together withmodule_id
when you iterate the (state) nodes:This will give you overlapping modules, as the same
node_id
may occur multiple times for differentlayer_id
.See this example.