Graphem - JAX: Node Influence Maximization via Geometric Embeddings
Graphem - JAX: Node Influence Maximization via Geometric Embeddings - Published in JOSS (2025)
Science Score: 98.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 4 DOI reference(s) in README and JOSS metadata -
✓Academic publication links
Links to: arxiv.org, joss.theoj.org -
○Academic email domains
-
○Institutional organization owner
-
✓JOSS paper metadata
Published in Journal of Open Source Software
Repository
Basic Info
- Host: GitHub
- Owner: igorrivin
- License: mit
- Language: Python
- Default Branch: main
- Size: 28.4 MB
Statistics
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 1
- Releases: 1
Metadata Files
README.md
Graph embedding and node influence maximization
Features
- Graph Embedding: Laplacian-based layout with force-directed refinement
- JAX Backend: GPU/TPU acceleration for large graphs
- Influence Maximization: Novel embedding-based seed selection algorithm
- Graph Generators: Standard models (Erdős–Rényi, Barabási–Albert, Watts-Strogatz, etc.)
- Visualization: Interactive 2D/3D plots with Plotly
- Benchmarking: Centrality correlation analysis and performance testing
- Datasets: Built-in loaders for SNAP and Network Repository datasets
Installation
bash
pip install graphem-jax
Note: For GPU or TPU acceleration, JAX needs to be specifically installed with hardware support. See the JAX documentation for more details on enabling GPU/TPU support.
From source:
bash
pip install git+https://github.com/igorrivin/graphem.git
Quick Start
Graph Embedding
```python import graphem as ge
Generate graph
edges = ge.erdosrenyigraph(n=500, p=0.01)
Create embedder
embedder = ge.GraphEmbedder( edges=edges, n_vertices=500, dimension=3 )
Compute layout
embedder.runlayout(numiterations=50)
Visualize
embedder.display_layout() ```
Influence Maximization
```python
Select influential nodes
seeds = ge.graphemseedselection(embedder, k=10)
Estimate influence spread
import networkx as nx G = nx.fromedgelist(edges) influence, _ = ge.ndlibestimated_influence(G, seeds, p=0.1) print(f"Influence: {influence} nodes ({influence/500:.1%})") ```
Benchmarking
```python from graphem.benchmark import benchmark_correlations
Compare embedding radii with centrality measures
results = benchmarkcorrelations( ge.erdosrenyigraph, graphparams={'n': 200, 'p': 0.05}, dim=3, num_iterations=40 )
Display correlation matrix
ge.reportfullcorrelationmatrix( results['radii'], results['degree'], results['betweenness'], results['eigenvector'], results['pagerank'], results['closeness'], results['nodeload'] ) ```
Google Colab Notebook
You can check out most of the graphem features in Google Colab by running the demo notebook
Key Components
Core Class
GraphEmbedder: Main embedding engine with Laplacian initialization and force-directed layout
Algorithms
- Graph embedding: Spectral initialization + spring forces + intersection avoidance
- Influence maximization: Radial distance-based seed selection vs traditional greedy
- Generators: 12+ graph models including SBM, small-world, scale-free
Datasets
Built-in access to standard network datasets: - Stanford Network Analysis Project - Network Repository
Examples
The examples/ directory contains:
- graph_generator_example.py - Generate and visualize various graph embeddings
- random_regular_example.py - Random regular graph analysis with GraphEm
- real_world_datasets_example.py - Work with real world datasets (based on Facebook, arXiv, and Wikipedia data)
- graphem_notebook.ipynb - Interactive Jupyter notebook with examples and visualizations
Testing
GraphEm includes a comprehensive unit test suite that validates all core functionality using the built-in graph generators.
Running Tests
To run the full test suite:
bash
python -m pytest tests/
For verbose output:
bash
python -m pytest tests/ -v
Test Coverage
The test suite covers:
- Graph Generators (
test_generators.py): All built-in graph generators including Erdős-Rényi, Barabási-Albert, Watts-Strogatz, random regular, geometric, caveman, and stochastic block models - Graph Embedder (
test_embedder.py): Core embedding functionality, layout algorithms, different dimensions, and large graph handling - Influence Maximization (
test_influence.py): NDLib integration, seed selection, and influence estimation
Test Requirements
Tests require the same dependencies as GraphEm plus:
- pytest (for running tests)
- ndlib (for influence maximization tests)
All tests use deterministic seeds for reproducible results.
Benchmarking
Run comprehensive benchmarks:
bash
python run_benchmarks.py
Generates performance tables and correlation analysis in Markdown and LaTeX formats.
Documentation
Full API documentation is available here.
Contributing
Quick start: See CONTRIBUTING.md for essential guidelines.
Detailed guide: contributing documentation for development setup, testing, and contribution guidelines.
Citation
If you use GraphEm in research, please cite our work
BibTeX:
bibtex
@misc{kolpakov-rivin-2025fast,
title={Fast Geometric Embedding for Node Influence Maximization},
author={Kolpakov, Alexander and Rivin, Igor},
year={2025},
eprint={2506.07435},
archivePrefix={arXiv},
primaryClass={cs.SI},
url={https://arxiv.org/abs/2506.07435}
}
APA Style:
Kolpakov, A., & Rivin, I. (2025). Fast Geometric Embedding for Node Influence Maximization. arXiv preprint arXiv:2506.07435.
License
MIT
Owner
- Name: Igor Rivin
- Login: igorrivin
- Kind: user
- Location: Princeton, NJ
- Company: Temple University
- Website: http://www.igorrivin.com
- Repositories: 3
- Profile: https://github.com/igorrivin
JOSS Publication
Graphem - JAX: Node Influence Maximization via Geometric Embeddings
Authors
Tags
JAX centrality measures node influence data visualizationCitation (CITATION.cff)
cff-version: 1.2.0
message: "If you use this work, please cite it as below."
title: "Fast Geometric Embedding for Node Influence Maximization"
authors:
- family-names: Kolpakov
given-names: Alexander
- family-names: Rivin
given-names: Igor
doi: 10.48550/arXiv.2506.07435
date-released: 2025-08-18
url: https://arxiv.org/abs/2506.07435
abstract: |
Computing classical centrality measures such as betweenness and closeness is computationally expensive on large-scale graphs. In this work, we introduce an efficient force layout algorithm that embeds a graph into a low-dimensional space, where the radial distance from the origin serves as a proxy for various centrality measures. We evaluate our method on multiple graph families and demonstrate strong correlations with degree, PageRank, and paths-based centralities. As an application, it turns out that the proposed embedding allows to find high-influence nodes in a network, and provides a fast and scalable alternative to the standard greedy algorithm.
keywords:
- graph embedding
- node influence
- centrality measures
- network analysis
- force layout
GitHub Events
Total
- Create event: 3
- Release event: 1
- Issues event: 2
- Watch event: 1
- Issue comment event: 10
- Push event: 12
- Pull request event: 5
- Fork event: 1
Last Year
- Create event: 3
- Release event: 1
- Issues event: 2
- Watch event: 1
- Issue comment event: 10
- Push event: 12
- Pull request event: 5
- Fork event: 1
Issues and Pull Requests
Last synced: 5 months ago
All Time
- Total issues: 1
- Total pull requests: 4
- Average time to close issues: 10 days
- Average time to close pull requests: 15 days
- Total issue authors: 1
- Total pull request authors: 1
- Average comments per issue: 2.0
- Average comments per pull request: 1.0
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 4
- Average time to close issues: 10 days
- Average time to close pull requests: 15 days
- Issue authors: 1
- Pull request authors: 1
- Average comments per issue: 2.0
- Average comments per pull request: 1.0
- Merged pull requests: 2
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- giorgospanay (1)
Pull Request Authors
- sashakolpakov (4)
