Git Product home page Git Product logo

tddschn / easy-graph Goto Github PK

View Code? Open in Web Editor NEW

This project forked from easy-graph/easy-graph

2.0 1.0 1.0 3.83 MB

EasyGraph is an open source graph processing library, which covers advanced graph processing methods in structural hole spanners detection, graph embedding and several classic methods.

Home Page: https://easy-graph.github.io/

License: BSD 3-Clause "New" or "Revised" License

Python 92.70% C++ 5.81% C 0.48% Shell 0.93% Batchfile 0.06% Makefile 0.02%

easy-graph's Introduction

EasyGraph

Copyright (C) <2020-2022> by Mobile Systems and Networking Group, Fudan University

image

image

image

Introduction

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

Install

Installation with pip :

$ pip install Python-EasyGraph

or conda :

$ conda install Python-EasyGraph

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

easy-graph's People

Contributors

chenyang03 avatar coreturn avatar icypole avatar sds131 avatar tddschn avatar unparalleled-calvin avatar yizhihenpidehou avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

web-logs2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.