Skip to content

LaNet-vi 5.0.0 - Complete Python Rewrite

Choose a tag to compare

@estcarisimo estcarisimo released this 31 Oct 23:40
· 50 commits to main since this release

LaNet-vi 5.0.0 - Complete Python Rewrite 🎉

We're excited to announce LaNet-vi 5.0.0, a complete rewrite of the large-scale network visualization tool in modern Python!

🌟 Highlights

Complete Modernization

  • Full Python 3.9+ implementation replacing legacy C++ codebase
  • Modern package management with uv (10-100x faster than pip)
  • Clean, maintainable codebase with comprehensive type hints
  • MIT License for maximum compatibility

Three Decomposition Algorithms

  • K-cores: Degree-based hierarchical decomposition
  • K-denses: Triangle-based community detection
  • D-cores: Directed graph decomposition (in/out-degree)

Dual Interface

  • Python API for programmatic use and integration
  • Full-featured CLI with intuitive commands
  • YAML configuration file support

High-Performance Visualization

  • Optimized circular hierarchical layout algorithm
  • Gradient edge coloring with depth-based rendering
  • Handles networks with millions of nodes
  • Publication-ready output (PNG, PDF, SVG)

📦 Installation

Using uv (recommended - fastest)

uv pip install lanet-vi

Or with pip

pip install lanet-vi

🚀 Quick Start

Command Line

Visualize a network

lanet-vi visualize --input network.txt --output viz.png

With k-denses decomposition

lanet-vi visualize --input network.txt --decomp kdenses --output viz.png

Python API

import networkx as nx
from lanet_vi import Network, LaNetConfig, DecompositionType

Load and visualize

G = nx.karate_club_graph()
config = LaNetConfig()
net = Network(G, config)
net.decompose(DecompositionType.KCORES)
net.visualize("output.png")

✨ What's New

Core Features

  • Complete Python rewrite using NetworkX, NumPy, and Matplotlib
  • Three decomposition algorithms: k-cores, k-denses, d-cores
  • Optimized two-pass circular layout elimininating radial artifacts
  • Gradient edge coloring based on endpoint k-core values
  • Community detection with Louvain algorithm
  • Support for weighted and directed graphs
  • Flexible I/O supporting compressed formats (gzip, bz2)

Visualization Improvements

  • Smooth circular distribution with neighbor-based positioning
  • Automatic ring spacing optimization (epsilon=0.40 default)
  • Edge transparency and width based on k-core values
  • Auto-scaling legends for large networks
  • Configurable resolution, colors, and layout parameters

Developer Experience

  • Modern build system with uv and pyproject.toml
  • Comprehensive documentation with examples
  • Full test suite with pytest
  • Type hints throughout codebase
  • Zero linting errors (ruff, mypy)
  • GitHub Actions CI/CD pipeline

Example Datasets

  • CAIDA AS-Relationships Internet topology visualization
  • Side-by-side k-cores vs k-denses comparisons
  • Working examples for all decomposition types

📊 Performance

  • Handles 50K+ node networks smoothly
  • Efficient edge selection algorithm (configurable percentage)
  • Spatial hashing for O(N) circle packing
  • Optimized defaults based on extensive testing with real datasets

🔧 Breaking Changes

This is a complete rewrite. If migrating from LaNet-vi 3.x (C++):

  • Configuration file format changed (YAML instead of custom format)
  • Command-line interface redesigned with modern conventions
  • Python 3.9+ required (was C++ binary)
  • Output file formats remain compatible

📚 Documentation

🙏 Acknowledgments

Original C++ implementation by Mariano Beiró and J. Ignacio Alvarez-Hamelin.

Based on the research:

  • Alvarez-Hamelin et al. (2006). "Large scale networks fingerprinting and visualization using the k-core decomposition." NIPS 18.
  • Beiró et al. (2008). "A low complexity visualization tool for complex systems analysis." New Journal of Physics.

🐛 Bug Reports & Feature Requests

Please report issues at: https://github.com/conexdat/LaNet-vi/issues