How to use the infomap.infomap function in infomap

To help you get started, we’ve selected a few infomap examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SkBlaz / Py3plex / py3plex / algorithms / community_detection / infomap / examples / python / example-file-io.py View on Github external
from infomap import infomap

name = "ninetriangles"
filename = "../../{}.net".format(name)


infomapWrapper = infomap.Infomap("-N5 --silent")

infomapWrapper.readInputData(filename)

infomapWrapper.run()

tree = infomapWrapper.tree

print("Found %d top modules with codelength: %f" % (tree.numTopModules(), tree.codelength()))

print("Writing top level modules to %s_level1.clu..." % name)
tree.writeClu("%s_level1.clu" % name, 1)
print("Writing second level modules to %s_level2.clu..." % name)
tree.writeClu("%s_level2.clu" % name, 2)

print("Writing tree to %s.tree..." % name)
tree.writeHumanReadableTree("%s.tree" % name)

infomap

Infomap network clustering algorithm

AGPL-3.0
Latest version published 1 year ago

Package Health Score

56 / 100
Full package analysis