# cdlib.algorithms.infomap¶

infomap(g_original: object, flags: str = '') → cdlib.classes.node_clustering.NodeClustering

Infomap is based on ideas of information theory. The algorithm uses the probability flow of random walks on a network as a proxy for information flows in the real system and it decomposes the network into modules by compressing a description of the probability flow.

Supported Graph Types

Undirected Directed Weighted
Yes Yes Yes
Parameters: g_original – a networkx/igraph object flags – str flags for Infomap NodeClustering object
>>> from cdlib import algorithms
>>> import networkx as nx
>>> G = nx.karate_club_graph()
>>> coms = algorithms.infomap(G)


Rosvall M, Bergstrom CT (2008) Maps of random walks on complex networks reveal community structure. Proc Natl Acad SciUSA 105(4):1118–1123

Note

Reference implementation: https://pypi.org/project/infomap/

Note

Infomap Python API documentation: https://mapequation.github.io/infomap/python/