Skip to main content

Easy Graph

Project description

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

https://img.shields.io/pypi/v/Python-EasyGraph.svg?label=PyPI https://img.shields.io/pypi/pyversions/Python-EasyGraph.svg?label=Python https://img.shields.io/pypi/l/Python-EasyGraph?label=License https://static.pepy.tech/personalized-badge/python-easygraph?period=total&units=international_system&left_color=brightgreen&right_color=yellowgreen&left_text=Downloads

Introduction

EasyGraph is an open-source network analysis library. It is mainly written in Python and supports analysis for undirected networks and directed networks. EasyGraph supports various formats of network data and covers a series of important network analysis algorithms for community detection, structural hole spanner detection, network embedding, and motif detection. Moreover, EasyGraph implements some key elements using C++ and introduces multiprocessing optimization to achieve better efficiency.

News

  • [08-17-2023] We release EasyGraph 1.0!

  • [08-08-2023] Our paper “EasyGraph: A Multifunctional, Cross-Platform, and Effective Library for Interdisciplinary Network Analysis” has been accepted by Patterns!

Stargazers

Stargazers repo roster for @easy-graph/Easy-Graph

Install

  • Prerequisites

3.8 <= Python <= 3.11 is required.

  • Installation with pip

$ pip install --upgrade Python-EasyGraph

The conda package is no longer updated or maintained.

If you’ve installed EasyGraph this way before, please uninstall it with conda and install it with pip.

If prebuilt EasyGraph wheels are not supported for your platform (OS / CPU arch, check here), you can build it locally this way:

git clone https://github.com/easy-graph/Easy-Graph && cd Easy-Graph && git checkout pybind11
pip install pybind11
python3 setup.py build_ext
python3 setup.py install
  • 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 shows 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 would appreciate citations to 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}
}

Project details


Release history Release notifications | RSS feed

This version

1.1

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

Python_EasyGraph-1.1-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (775.6 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

Python_EasyGraph-1.1-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl (791.9 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ i686

Python_EasyGraph-1.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (775.0 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

Python_EasyGraph-1.1-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl (790.2 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ i686

Python_EasyGraph-1.1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (779.7 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64

Python_EasyGraph-1.1-pp38-pypy38_pp73-manylinux_2_17_i686.manylinux2014_i686.whl (794.4 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ i686

Python_EasyGraph-1.1-cp311-cp311-win_amd64.whl (642.8 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

Python_EasyGraph-1.1-cp311-cp311-musllinux_1_1_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

Python_EasyGraph-1.1-cp311-cp311-musllinux_1_1_i686.whl (1.4 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ i686

Python_EasyGraph-1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (795.0 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

Python_EasyGraph-1.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (794.6 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686

Python_EasyGraph-1.1-cp311-cp311-macosx_11_0_arm64.whl (658.4 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

Python_EasyGraph-1.1-cp311-cp311-macosx_10_14_universal2.whl (972.8 kB view hashes)

Uploaded CPython 3.11 macOS 10.14+ universal2 (ARM64, x86-64)

Python_EasyGraph-1.1-cp310-cp310-win_amd64.whl (645.3 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

Python_EasyGraph-1.1-cp310-cp310-musllinux_1_1_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

Python_EasyGraph-1.1-cp310-cp310-musllinux_1_1_i686.whl (1.3 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ i686

Python_EasyGraph-1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (794.8 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

Python_EasyGraph-1.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (794.5 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686

Python_EasyGraph-1.1-cp310-cp310-macosx_11_0_x86_64.whl (704.7 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ x86-64

Python_EasyGraph-1.1-cp310-cp310-macosx_11_0_arm64.whl (657.2 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

Python_EasyGraph-1.1-cp39-cp39-win_amd64.whl (643.5 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

Python_EasyGraph-1.1-cp39-cp39-musllinux_1_1_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

Python_EasyGraph-1.1-cp39-cp39-musllinux_1_1_i686.whl (1.3 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ i686

Python_EasyGraph-1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (794.5 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

Python_EasyGraph-1.1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl (794.7 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ i686

Python_EasyGraph-1.1-cp39-cp39-macosx_11_0_x86_64.whl (704.9 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ x86-64

Python_EasyGraph-1.1-cp39-cp39-macosx_11_0_arm64.whl (657.2 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

Python_EasyGraph-1.1-cp38-cp38-win_amd64.whl (645.0 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

Python_EasyGraph-1.1-cp38-cp38-musllinux_1_1_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ x86-64

Python_EasyGraph-1.1-cp38-cp38-musllinux_1_1_i686.whl (1.3 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ i686

Python_EasyGraph-1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (794.8 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

Python_EasyGraph-1.1-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl (793.4 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ i686

Python_EasyGraph-1.1-cp38-cp38-macosx_11_0_x86_64.whl (704.7 kB view hashes)

Uploaded CPython 3.8 macOS 11.0+ x86-64

Python_EasyGraph-1.1-cp38-cp38-macosx_11_0_arm64.whl (678.8 kB view hashes)

Uploaded CPython 3.8 macOS 11.0+ ARM64

Supported by

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