Skip to main content

Easy Graph

Project description

EasyGraph

Copyright (C) <2020-2025> by DataNET Group, Fudan University


PyPI Version Python License Downloads

Introduction

The framework of EasyGraph is composed of four components: EasyGraph (Core), EasyHypergraph, EGGPU, and EasyGNN. Framework of EasyGraph.

EasyGraph is an open-source network analysis library primarily written in Python. It supports both undirected and directed networks and accommodates various network data formats. EasyGraph includes a comprehensive suite of network analysis algorithms such as community detection, structural hole spanner detection, network embedding, and motif detection. Additionally, it optimizes performance by implementing key components in C++ and utilizing multiprocessing.

👉 For more details, please refer to our documentation page.


EasyHypergraph is a comprehensive, computation-effective, and storage-saving hypergraph computation tool designed not only for in-depth hypergraph analysis but also for the growing field of hypergraph learning. It bridges the gap between EasyGraph and higher-order relationships. EasyHypergraph is developed as an integrated module within the EasyGraph framework, maintaining full compatibility with its core architecture.

👉 For more details, please refer to its documentation page.


EGGPU is a high-performance GPU-accelerated network analysis library that supports essential functions such as betweenness centrality, k-core centrality, and single-source shortest path,as well as structural hole metrics like constraint. Built on top of the EasyGraph library, EGGPU features an efficient system architecture and native CUDA implementation, while providing a user-friendly Python API and significant speedups for large-scale network analysis.

👉 For more details, please refer to its documentation page.

News

  • [03-28-2025] 🎉 Thanks to our amazing community! EasyGraph has reached 700,000 downloads!
  • [12-04-2024] 🎉 We received the "Top Open Source Certificate" by International Open Benchmark Council!
  • [11-22-2024] We released EasyGraph 1.4.1! This version now fully supports Python 3.13.
  • [09-27-2024] 🎉 EasyGraph has reached 500,000 downloads!
  • [09-20-2024] We released EasyGraph 1.4! This version features GPU-powered functions for efficient large network analysis.
  • [05-27-2024] We released EasyGraph 1.3! This version has resolved several issues related to hypergraph analysis and visualization.
  • [04-09-2024] We released EasyGraph 1.2! This version now fully supports Python 3.12.
  • [03-06-2024] 🎉 We received the Shanghai Open Source Innovation Outstanding Achievement Award (Grand Prize)! News
  • [02-05-2024] We released EasyGraph 1.1! This version features hypergraph analysis and learning for higher-order network modeling and representation.
  • [08-17-2023] We released EasyGraph 1.0!
  • [08-08-2023] 🎉 Our paper "EasyGraph: A Multifunctional, Cross-Platform, and Effective Library for Interdisciplinary Network Analysis" was accepted by Patterns (Cell Press)!
  • [07-22-2020] First public release of EasyGraph!

Stargazers

Stars

Install

Supported Versions

3.8 <= Python <= 3.13 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

On 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

On 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

Hint

EasyGraph uses 1.12.1 <= PyTorch < 2.0 for machine learning functions. Note that this does not prevent your from running non-machine learning functions normally, if there is no PyTorch in your environment. But you will receive some warnings which remind you some unavailable modules when they depend on it.

Simple Example

This example demonstrates the general usage of methods in 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}

This is a simple example for the detection of structural hole spanners using the HIS algorithm.

  >>> 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}
  }

Citation

If you use EasyGraph in a scientific publication, we kindly request that you cite the following paper:

  @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},
  }

📢 If you notice anything unexpected, please open an issue and let us know. If you have any questions or require a specific feature, feel free to discuss them with us. We are motivated to constantly make EasyGraph even better and let more developers benefit!

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_easygraph-1.4.5.tar.gz (340.9 kB view details)

Uploaded Source

Built Distributions

python_easygraph-1.4.5-cp313-cp313-macosx_11_0_arm64.whl (693.7 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

python_easygraph-1.4.5-cp312-cp312-macosx_11_0_arm64.whl (693.6 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

python_easygraph-1.4.5-cp311-cp311-macosx_11_0_arm64.whl (691.8 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

python_easygraph-1.4.5-cp310-cp310-macosx_11_0_arm64.whl (690.4 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

python_easygraph-1.4.5-cp39-cp39-macosx_11_0_arm64.whl (690.5 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

python_easygraph-1.4.5-cp38-cp38-macosx_11_0_arm64.whl (690.0 kB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

File details

Details for the file python_easygraph-1.4.5.tar.gz.

File metadata

  • Download URL: python_easygraph-1.4.5.tar.gz
  • Upload date:
  • Size: 340.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for python_easygraph-1.4.5.tar.gz
Algorithm Hash digest
SHA256 421bbfe29c923d5477d6f6db4d2f3660a3888564b0d51626b513cb87b9cf622e
MD5 2ad1bf27a95ef3b8675f79ecf4d85871
BLAKE2b-256 5e8d696b7ad4a1ae53229580c4b09ea031494b7c7ecf23599ef0a35ff225274d

See more details on using hashes here.

File details

Details for the file python_easygraph-1.4.5-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for python_easygraph-1.4.5-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d0178ac1ac13cf1e188c1a32fc9a74a787d189e57da96f38927dcb5adf8340c2
MD5 cce301ed809cb87f3d11777d27969175
BLAKE2b-256 094ffd9ddff7f9ae26575d92c43d579a88a2816fdd67f846a67e9ce3b3242b2a

See more details on using hashes here.

File details

Details for the file python_easygraph-1.4.5-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for python_easygraph-1.4.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 33dce53848a55f46f271e718ddeced0024e4e223e507c6e8b9888583327d9845
MD5 fb268b0474fe277665f7fa1166009153
BLAKE2b-256 0eaf5b2377d0ccfdf740ebe6b139e20157cdcaf46147742ea9da47e8c7837bd6

See more details on using hashes here.

File details

Details for the file python_easygraph-1.4.5-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for python_easygraph-1.4.5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7aabf61d8080bb454e4a78189713120c34a58453841bc939c215237f7fe44987
MD5 66b6c626a26ad00e2217da41083b5b95
BLAKE2b-256 bec361e96d1d92793e3df833109dd3da67e2a88c40d57d3a693a478f63961363

See more details on using hashes here.

File details

Details for the file python_easygraph-1.4.5-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for python_easygraph-1.4.5-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 00b8413315c44eeba6242e8140a7bef73016562ce229a963183f476d1e9d1ae6
MD5 f2bd7905675a4aad389d949cd4d0c9b9
BLAKE2b-256 4f82a3ceeae4f844fd2007af724d7399dfc12a258a0ca6a0159dbee50cc9503a

See more details on using hashes here.

File details

Details for the file python_easygraph-1.4.5-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for python_easygraph-1.4.5-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 480506facb292690431174a380675231716abd60a9337393498a05e8fc18b6b1
MD5 b762107d642eca401962751edd5063e5
BLAKE2b-256 0278cafed13212f5539a1ff130cfb7a7306e5e0ba4b44eb6b34e44c3d8825509

See more details on using hashes here.

File details

Details for the file python_easygraph-1.4.5-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for python_easygraph-1.4.5-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 770be6ae90758c43ba19ba42ece81f071a33e6d2ce9e8bfa0b257d66977140ef
MD5 960a1e69bccdc5072f7c62f1f9f0c7f6
BLAKE2b-256 9d45dfac93f240a99caffa8a72dd007d5fcc3d1047c45352c6c7607ee97b1d76

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page