Tree nodes and iterators

Walking an Infomap partition yields nodes via these iterator types. InfoNode is the node wrapper returned by each step.

class infomap.InfoNode(*args)
property child_degree

The number of children.

Returns:

Number of children

Return type:

int

property flow

Get the flow of the node.

Returns:

The flow

Return type:

float

get_meta_data(dimension=0)

Get meta data on a specific dimension.

Parameters:

dimension (int) – The dimension (default 0)

Returns:

The meta data

Return type:

int

property is_leaf

True if the node has no children.

Returns:

Is leaf node

Return type:

bool

property is_leaf_module

True if the node has children but no grandchildren.

Returns:

Is leaf module

Return type:

bool

property is_root

True if the node has no parent.

Returns:

Is root

Return type:

bool

property layer_id

Get the layer id of a multilayer node.

Returns:

The layer id

Return type:

int

property meta_data

Meta data (on first dimension if more).

Returns:

The meta data

Return type:

int

property node_id

Get the physical node id.

Returns:

The node id

Return type:

int

property state_id

Get the state id of the node.

Returns:

The state id

Return type:

int

State-node iterators

class infomap.InfomapIterator(*args)
property child_index

Get the child index.

Returns:

The child index

Return type:

int

property depth

Get the depth.

Returns:

The depth

Return type:

int

property modular_centrality

Get the modular centrality of the node.

Returns:

The modular centrality

Return type:

float

property module_id

Get the module id of the node.

Returns:

The module id

Return type:

int

property path

Get the path to the node in the tree.

Returns:

The path

Return type:

tuple of ints

class infomap.InfomapLeafModuleIterator(*args)
property child_index

Get the child index.

Returns:

The child index

Return type:

int

property depth

Get the depth.

Returns:

The depth

Return type:

int

property modular_centrality

Get the modular centrality of the node.

Returns:

The modular centrality

Return type:

float

property module_id

Get the module id of the node.

Returns:

The module id

Return type:

int

property path

Get the path to the node in the tree.

Returns:

The path

Return type:

tuple of ints

class infomap.InfomapLeafIterator(*args)
property child_index

Get the child index.

Returns:

The child index

Return type:

int

property depth

Get the depth.

Returns:

The depth

Return type:

int

property modular_centrality

Get the modular centrality of the node.

Returns:

The modular centrality

Return type:

float

property module_id

Get the module id of the node.

Returns:

The module id

Return type:

int

property path

Get the path to the node in the tree.

Returns:

The path

Return type:

tuple of ints

Physical-node iterators

class infomap.InfomapIteratorPhysical(*args)
property child_index

Get the child index.

Returns:

The child index

Return type:

int

property depth

Get the depth.

Returns:

The depth

Return type:

int

property modular_centrality

Get the modular centrality of the node.

Returns:

The modular centrality

Return type:

float

property module_id

Get the module id of the node.

Returns:

The module id

Return type:

int

property path

Get the path to the node in the tree.

Returns:

The path

Return type:

tuple of ints

class infomap.InfomapLeafIteratorPhysical(*args)
property child_index

Get the child index.

Returns:

The child index

Return type:

int

property depth

Get the depth.

Returns:

The depth

Return type:

int

property modular_centrality

Get the modular centrality of the node.

Returns:

The modular centrality

Return type:

float

property module_id

Get the module id of the node.

Returns:

The module id

Return type:

int

property path

Get the path to the node in the tree.

Returns:

The path

Return type:

tuple of ints