11 KiB
Note
本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。
English · 原始项目 · 上游 README
原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。
EasyGraph
Copyright (C) <2020-2026> by DataNET Group,复旦大学
- Documentation: https://easy-graph.github.io/
- Source Code: https://github.com/easy-graph/Easy-Graph
- Issue Tracker: https://github.com/easy-graph/Easy-Graph/issues
- PyPI Homepage: https://pypi.org/project/Python-EasyGraph/
- Youtube channel: https://www.youtube.com/@python-easygraph
Introduction
EasyGraph 框架由四个组件构成:EasyGraph (Core)、EasyHypergraph、EGGPU 和 EasyGNN。

EasyGraph 是一款主要以 Python 编写的开源网络分析库。它同时支持无向网络和有向网络,并兼容多种网络数据格式。EasyGraph 提供一整套网络分析算法,包括社区发现、结构洞跨越者检测、网络嵌入和模体检测等。此外,它通过将关键组件以 C++ 实现并利用多进程来优化性能。
👉 更多详情,请参阅我们的文档页面。
EasyHypergraph 是一款全面、计算高效且节省存储的超图计算工具,既适用于深入的 hypergraph 分析,也适用于日益发展的超图学习领域。 它弥合了 EasyGraph 与高阶关系之间的鸿沟。EasyHypergraph 作为 EasyGraph 框架中的集成模块开发,与其核心架构完全兼容。
👉 更多详情,请参阅其文档页面。
EGGPU 是一款高性能 GPU 加速网络分析库,支持介数中心性、betweenness centrality)、k-core 中心性、单源最短路径等基础功能,以及约束(constraint)等结构洞指标。EGGPU 基于 EasyGraph 库构建,具备高效的系统架构和原生 CUDA 实现,同时提供友好的 Python API,可在大规模网络分析中带来显著加速。
👉 更多详情,请参阅其文档页面。
📢 EasyGraph News
📣 Media & Press
- [08-09-2025] EasyHypergraph: Fast, Efficient Higher-Order Network Analysis
- [01-15-2025] 开放原子大赛OpenRank开源数字生态分析与应用创新大赛全国一等奖 (in Chinese)
- [01-07-2025] 计算机科学技术学院教授陈阳入选“2024中国开源先锋33人” (in Chinese)
- [12-04-2024] 国际开源基准委员会的"顶级开源证书" (in Chinese)
- [10-16-2024] 2023年度上海开源创新卓越成果奖 (in Chinese)
- [11-06-2023] 复旦大学陈阳Patterns:EasyGraph——面向多学科的高性能网络结构分析工具箱|Cell Press论文速递 (in Chinese)
- [11-04-2023] EasyGraph:多功能、跨平台、高效率的跨学科网络分析库 (in Chinese)
🚀 Releases & Milestones
- [06-07-2026] EasyGraph v1.6.2 released (Community functions upgraded)
- [05-07-2026] EasyGraph v1.6.1 released (Add OpenMP-powered path-based functions)
- [02-01-2026] EasyGraph v1.6 released (OpenMP-powered functions for large network analysis)
- [01-16-2026] 🎉 1M Downloads! Thanks to our amazing community!
- [01-01-2026] EasyGraph v1.5.3 released (The Hypergraph Interchange Format (HIF) standard)
- [11-23-2025] EasyGraph v1.5.2 released (LS algorithm for effective community detection)
- [10-11-2025] EasyGraph v1.5.1 released (Python 3.14 supported)
- [07-27-2025] EasyGraph v1.5 released (This version integrates the HWNN model and supports 11 representative network datasets)
- [06-29-2025] 🎉 800K+ Downloads!
- [11-22-2024] EasyGraph v1.4.1 released (Python 3.13 supported)
- [09-20-2024] EasyGraph v1.4 released (GPU-powered functions for large network analysis)
- [05-27-2024] EasyGraph v1.3 released (issues related to hypergraph analysis and visualization resolved)
- [04-09-2024] EasyGraph v1.2 released (Python 3.12 supported)
- [02-05-2024] EasyGraph v1.1 released (hypergraph analysis and learning for higher-order networks)
- [08-17-2023] EasyGraph v1.0 released
- [07-22-2020] EasyGraph first public release
📈 Publications
- [05-30-2025] 🎉 Our paper "EasyHypergraph: an open-source software for fast and memory-saving analysis and learning of higher-order networks" was accepted by Humanities and Social Sciences Communications (Nature Portfolio)! [PDF]
- [08-08-2023] 🎉 Our paper "EasyGraph: A Multifunctional, Cross-Platform, and Effective Library for Interdisciplinary Network Analysis" was accepted by Patterns (Cell Press)! [PDF]
Stargazers
Install
Supported Versions
3.8 <= Python <= 3.14 is required.
Installation With pip
$ pip install --upgrade Python-EasyGraph
The conda package is no longer updated or maintained.
If you've previously installed EasyGraph with conda, please uninstall it with conda and reinstall with pip.
Build From Source
If prebuilt EasyGraph wheels are not supported for your platform (OS / CPU arch, check here), or you want to have GPU-based functions enabled, you can build it locally.
Prerequisites
- CMake >= 3.23
- A compiler that fully supports C++11
- CUDA Toolkit 11.8 or later would be preferred (If need GPUs enabled)
Installation
On Linux
git clone --recursive https://github.com/easy-graph/Easy-Graph
export EASYGRAPH_ENABLE_GPU="TRUE" # for users who want to enable GPUs
pip install ./Easy-Graph
在 Windows 上
% For Windows users who want to enable GPU-based functions, %
% you must execute the commands below in cmd but not PowerShell. %
git clone --recursive https://github.com/easy-graph/Easy-Graph
set EASYGRAPH_ENABLE_GPU=TRUE % for users who want to enable GPUs %
pip install ./Easy-Graph
在 macOS 上
# Since macOS doesn't support CUDA, we can't have GPUs enabled on macOS
git clone --recursive https://github.com/easy-graph/Easy-Graph
pip install ./Easy-Graph
提示
EasyGraph 的机器学习功能要求 1.12.1 <= PyTorch < 2.0。 请注意,即使你的环境中未安装 PyTorch,这也不会阻止你正常运行非机器学习功能。 但当某些模块依赖 PyTorch 时,你会收到一些警告,提示这些模块不可用。
简单示例
本示例演示 EasyGraph 中方法的常规用法。
>>> import easygraph as eg
>>> G = eg.Graph()
>>> G.add_edges([(1,2), (2,3), (1,3), (3,4), (4,5), (3,5), (5,6)])
>>> eg.pagerank(G)
{1: 0.14272233049003707, 2: 0.14272233049003694, 3: 0.2685427766200994, 4: 0.14336430577918527, 5: 0.21634929087322705, 6: 0.0862989657474143}
这是一个使用 HIS 算法检测 结构洞跨越者(structural hole spanners) 的简单示例。
>>> import easygraph as eg
>>> G = eg.Graph()
>>> G.add_edges([(1,2), (2,3), (1,3), (3,4), (4,5), (3,5), (5,6)])
>>> _, _, H = eg.get_structural_holes_HIS(G, C=[frozenset([1,2,3]), frozenset([4,5,6])])
>>> H # The structural hole score of each node. Note that node `4` is regarded as the most possible structural hole spanner.
{1: {0: 0.703948974609375},
2: {0: 0.703948974609375},
3: {0: 1.2799804687499998},
4: {0: 1.519976806640625},
5: {0: 1.519976806640625},
6: {0: 0.83595703125}
}
引用
如果你在学术出版物中使用 EasyGraph,恳请引用以下论文:
@article{gao2023easygraph,
title={{EasyGraph: A Multifunctional, Cross-Platform, and Effective Library for Interdisciplinary Network Analysis}},
author={Min Gao and Zheng Li and Ruichen Li and Chenhao Cui and Xinyuan Chen and Bodian Ye and Yupeng Li and Weiwei Gu and Qingyuan Gong and Xin Wang and Yang Chen},
year={2023},
journal={Patterns},
volume={4},
number={10},
pages={100839},
}
📢 如果你发现任何异常情况,请提交 issue 告知我们。如有任何问题或需要特定功能,欢迎与我们讨论。我们致力于持续改进 EasyGraph,让更多开发者受益!