194 lines
11 KiB
Markdown
194 lines
11 KiB
Markdown
<!-- WEHUB_ZH_README -->
|
||
> [!NOTE]
|
||
> 本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。
|
||
> [English](./README.en.md) · [原始项目](https://github.com/easy-graph/Easy-Graph) · [上游 README](https://github.com/easy-graph/Easy-Graph/blob/HEAD/README.md)
|
||
> 原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。
|
||
|
||
EasyGraph
|
||
==================
|
||
|
||
Copyright (C) <2020-2026> by [DataNET Group,复旦大学](https://fudan-datanet.mysxl.cn/)
|
||
|
||
___________________________________________________________________________
|
||
|
||
[![PyPI Version][pypi-image]][pypi-url]
|
||
[![Python][python-image]][python-url]
|
||
[![License][license-image]][license-url]
|
||
[![Downloads][downloads-image]][downloads-url]
|
||
|
||
[pypi-image]: https://img.shields.io/pypi/v/Python-EasyGraph.svg?label=PyPI
|
||
[pypi-url]: https://pypi.org/project/Python-EasyGraph/
|
||
[python-image]: https://img.shields.io/pypi/pyversions/Python-EasyGraph.svg?label=Python
|
||
[python-url]: https://pypi.org/project/Python-EasyGraph/
|
||
[license-image]: https://img.shields.io/pypi/l/Python-EasyGraph?label=License
|
||
[license-url]: https://github.com/easy-graph/Easy-Graph/blob/master/LICENSE
|
||
[downloads-image]: https://img.shields.io/pepy/dt/python-easygraph?label=Downloads&labelColor=brightgreen&color=yellowgreen
|
||
[downloads-url]: https://pypi.org/project/Python-EasyGraph/
|
||
|
||
- **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++ 实现并利用多进程来优化性能。
|
||
|
||
<!-- # New Features in Version 1.3
|
||
- **Support for more hypergraph metrics and algorithms.** Such as [hypercoreness](https://www.nature.com/articles/s41467-023-41887-2), [vector-centrality](https://www.sciencedirect.com/science/article/pii/S0960077922006075), [s-centrality](https://epjds.epj.org/articles/epjdata/abs/2020/01/13688_2020_Article_231/13688_2020_Article_231.html), and so on.
|
||
- **Support for more hypergraph datasets.** Static hypergraph datasets and dynamic datasets can be both loaded by calling the corresponding dataset name.
|
||
- **Support for more flexible dynamic hypergraph visualization.** Users can define dynamic hypergraphs and visualize the structure of the hypergraph at each timestamp.
|
||
- **Support for more efficient hypergraph computation and hypergraph learning.** Adoption of suitable storage structure and caching strategy for different metrics/hypergraph neural networks.
|
||
-->
|
||
👉 更多详情,请参阅我们的[文档](https://easy-graph.github.io/)页面。
|
||
|
||
|
||
---
|
||
**EasyHypergraph** 是一款全面、计算高效且节省存储的超图计算工具,既适用于深入的 hypergraph 分析,也适用于日益发展的超图学习领域。
|
||
它弥合了 EasyGraph 与高阶关系之间的鸿沟。EasyHypergraph 作为 EasyGraph 框架中的集成模块开发,与其核心架构完全兼容。
|
||
|
||
👉 更多详情,请参阅其[文档](https://easy-graph.github.io/docs/hypergraph.html)页面。
|
||
|
||
---
|
||
**EGGPU** 是一款高性能 GPU 加速网络分析库,支持介数中心性、betweenness centrality)、k-core 中心性、单源最短路径等基础功能,以及约束(constraint)等结构洞指标。EGGPU 基于 EasyGraph 库构建,具备高效的系统架构和原生 CUDA 实现,同时提供友好的 Python API,可在大规模网络分析中带来显著加速。
|
||
|
||
👉 更多详情,请参阅其[文档](https://easy-graph.github.io/docs/eggpu.html)页面。
|
||
|
||
# 📢 EasyGraph News
|
||
|
||
## 📣 Media & Press
|
||
- [08-09-2025] [EasyHypergraph: Fast, Efficient Higher-Order Network Analysis](https://scienmag.com/easyhypergraph-fast-efficient-higher-order-network-analysis/)
|
||
- [01-15-2025] [开放原子大赛OpenRank开源数字生态分析与应用创新大赛全国一等奖 (in Chinese)](https://mp.weixin.qq.com/s/e54JHaP2AAEUN3S8RZ-Y2g)
|
||
- [01-07-2025] [计算机科学技术学院教授陈阳入选“2024中国开源先锋33人” (in Chinese)](https://news.fudan.edu.cn/2025/0107/c2463a143932/page.htm)
|
||
- [12-04-2024] [国际开源基准委员会的"顶级开源证书" (in Chinese)](https://chenyang03.wordpress.com/wp-content/uploads/2025/07/image.png?w=1024)
|
||
- [10-16-2024] [2023年度上海开源创新卓越成果奖 (in Chinese)](https://mp.weixin.qq.com/s/kO6Dpyolf74dlDvKuoLlJA)
|
||
- [11-06-2023] [复旦大学陈阳Patterns:EasyGraph——面向多学科的高性能网络结构分析工具箱|Cell Press论文速递 (in Chinese)](https://mp.weixin.qq.com/s/f2LCyQv1dYuquM_EfGX6Ow?poc_token=HBV092ijI2L534IrD0Jl_fnf3VjhX8UudcPFLH6b)
|
||
- [11-04-2023] [EasyGraph:多功能、跨平台、高效率的跨学科网络分析库 (in Chinese)](https://swarma.org/?p=46252)
|
||
|
||
## 🚀 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](https://github.com/HIF-org/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](https://www.nature.com/articles/s41599-025-05180-5)]
|
||
- [08-08-2023] 🎉 Our paper "EasyGraph: A Multifunctional, Cross-Platform, and Effective Library for Interdisciplinary Network Analysis" was accepted by Patterns (Cell Press)! [[PDF](https://www.sciencedirect.com/science/article/pii/S2666389923002180)]
|
||
|
||
# Stargazers
|
||
|
||
[![Stars][star-image]][star-url]
|
||
|
||
[star-image]:https://reporoster.com/stars/easy-graph/Easy-Graph
|
||
[star-url]: https://github.com/easy-graph/Easy-Graph/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](https://pypi.org/simple/python-easygraph/)), 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](https://pytorch.org/get-started/locally/) < 2.0。
|
||
请注意,即使你的环境中未安装 PyTorch,这也不会阻止你正常运行非机器学习功能。
|
||
但当某些模块依赖 PyTorch 时,你会收到一些警告,提示这些模块不可用。
|
||
|
||
# 简单示例
|
||
|
||
本示例演示 EasyGraph 中方法的常规用法。
|
||
```python
|
||
>>> 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](https://keg.cs.tsinghua.edu.cn/jietang/publications/WWW13-Lou&Tang-Structural-Hole-Information-Diffusion.pdf) 算法检测 [结构洞跨越者(structural hole spanners)](https://en.wikipedia.org/wiki/Structural_holes)
|
||
的简单示例。
|
||
|
||
```python
|
||
>>> 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,让更多开发者受益!
|