forceatlas2  by bhargavchippada

Fast graph layout for network visualization

Created 8 years ago
311 stars

Top 86.6% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

This repository offers the fastest Python implementation of the ForceAtlas2 graph layout algorithm, achieving 10-100x speedups via Cython optimization. It targets engineers, researchers, and power users needing efficient, scalable network visualization for large graphs, integrating seamlessly with NetworkX, igraph, and raw matrices.

How It Works

The core is a Cython-optimized ForceAtlas2 implementation, a force-directed layout for weighted undirected graphs. It uses Barnes-Hut approximation for O(n log n) complexity on large graphs (>10,000 nodes). Key features include linLogMode for tighter community clusters and outboundAttractionDistribution to mitigate hub dominance.

Quick Start & Requirements

Install via pip install fa2. For peak performance, install Cython (pip install cython) and build from source (pip install fa2 --no-binary fa2). Requires Python 3.9+. Optional visualization (fa2[viz]) and MCP server (fa2[mcp]) packages are available. See PyPI and the linked research paper for details.

Highlighted Details

  • 10-100x speedup with Cython.
  • Supports NetworkX, igraph, NumPy, and SciPy sparse matrices.
  • Scales efficiently to large graphs (>100,000 nodes) via Barnes-Hut.
  • Features linLogMode, adjustSizes, outboundAttractionDistribution, inferSettings, and 3D layout support.

Maintenance & Community

Contributions are welcome, with development guided by pytest and ruff. No specific community channels are listed. The multiThreaded computation feature is noted as needing implementation, suggesting potential future development.

Licensing & Compatibility

Licensed under GNU GPLv3, a strong copyleft license requiring derivative works to also be GPLv3. This may restrict integration into closed-source commercial products without separate licensing.

Limitations & Caveats

Requires Python 3.9+. The multiThreaded parameter is unimplemented. The GPLv3 license necessitates careful consideration for commercial use cases involving closed-source linking.

Health Check
Last Commit

2 weeks ago

Responsiveness

Inactive

Pull Requests (30d)
3
Issues (30d)
0
Star History
4 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.