Start here for most research workflows. The package installs both the Python API and the infomap command-line tool.
pip install infomapUpgrade an existing installation
pip install --upgrade infomapVerify the installation
infomap -vDocumentation
For most researchers, the Python package is the best starting point: it installs both the Python API and the infomap command-line tool. Use R for analysis workflows, Docker for reproducible compute environments, or standalone binaries when you only need the executable.
Use these references once Infomap is installed in Python or R.
Start here for most research workflows. The package installs both the Python API and the infomap command-line tool.
pip install infomapUpgrade an existing installation
pip install --upgrade infomapVerify the installation
infomap -vUse the R package when Infomap is part of an R analysis workflow. Pre-built binaries are published on r-universe.
install.packages("infomap", repos = c("https://mapequation.r-universe.dev", "https://cloud.r-project.org"))Use Homebrew when you want the native command-line tool without installing the Python package.
brew install mapequation/infomap/infomapTap and install separately
brew tap mapequation/infomap
brew install infomapUpgrade with the normal Homebrew flow
brew upgrade infomapUse the container image for reproducible CLI runs in CI, teaching material, or shared compute environments.
docker run -it --rm -v "$(pwd)":/data ghcr.io/mapequation/infomap:latest [infomap arguments]Use the WebAssembly worker package to embed Infomap in browser, Node.js, and TypeScript applications.
npm install @mapequation/infomapUse a standalone binary when you only need the executable. OpenMP builds may be faster on larger networks but require OpenMP runtime libraries.
| OpenMP | Without OpenMP | |
|---|---|---|
| Windows | infomap-win.zip | infomap-win-noomp.zip |
| macOS | infomap-mac.zip | infomap-mac-noomp.zip |
| Ubuntu | infomap-ubuntu.zip | infomap-ubuntu-noomp.zip |
Build locally when you want to modify Infomap, inspect the implementation, or compile with custom flags. Requires a working gcc or clang toolchain.
git clone git@github.com:mapequation/infomap.git
cd infomap
make build-nativeBuild without OpenMP
make build-native OPENMP=0Show available CLI options
./Infomap --helpWeb apps can open the Infomap workbench with a network and options already filled in. Put them in a JSON object, compress it with zlib deflate, encode it as base64url without padding, and pass it in the URL fragment as #s=. The fragment is never sent to a server, so the network stays in the browser.
async function infomapWorkbenchUrl({ network, args }) {
const json = JSON.stringify({ v: 1, network, args });
const compressed = new Blob([json])
.stream()
.pipeThrough(new CompressionStream("deflate"));
const bytes = new Uint8Array(await new Response(compressed).arrayBuffer());
let binary = "";
for (const byte of bytes) binary += String.fromCharCode(byte);
const s = btoa(binary)
.replaceAll("+", "-")
.replaceAll("/", "_")
.replaceAll("=", "");
return `https://mapequation.org/infomap/workbench/#s=${s}`;
}
const url = await infomapWorkbenchUrl({
network: {
name: "triangles.net",
value: "# source target\n1 2\n2 3\n3 1\n3 4\n4 5\n5 6\n6 4",
},
args: "--two-level --directed",
});
window.open(url, "_blank");v must be 1. network.value is the network in any input format and can be up to 200,000 characters, and args holds the Infomap options. The workbench opens with these inputs loaded, and the user starts the run.