GithubHelp home page GithubHelp logo

kareef928 / localgraphclustering Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kfoynt/localgraphclustering

0.0 1.0 0.0 1.08 GB

License: Other

Shell 0.01% HTML 1.35% Python 0.15% C++ 0.17% MATLAB 0.01% C 0.01% Jupyter Notebook 98.32% Makefile 0.01%

localgraphclustering's Introduction

Build Status Coverage Status

Local Graph Clustering

Local Graph Clustering provides

  • methods that find local clusters in a given graph without touching the whole graph
  • methods that improve a given cluster
  • methods for global graph partitioning
  • tools to compute Network Community Profiles
  • scalable graph analytics on your laptop

The current version is 0.5.0 and it is appropriate for experts and intermediates. Contact information for any questions and feedback is given below.

Authors

Contributors

List of applications and methods

Pipelines

Examples

All examples are in the notebooks folder.

Below is a simple demonstration from test.py in notebooks on how to improve spectral partitioning using flow-based methods from local graph clustering.

from localgraphclustering import *

import time
import numpy as np

# Read graph. This also supports gml and graphml format.
g = GraphLocal('./datasets/senate.edgelist','edgelist',' ')

# Call the global spectral partitioning algorithm.
eig2 = fiedler(g)

# Round the eigenvector
output_sc = sweep_cut(g,eig2)

# Extract the partition for g and store it.
eig2_rounded = output_sc[0]

# Conductance before improvement
print("Conductance before improvement:",g.compute_conductance(eig2_rounded))

# Start calling SimpleLocal
start = time.time()
output_SL_fast = SimpleLocal(g,eig2_rounded)
end = time.time()
print("running time:",str(end-start)+"s")

# Conductance after improvement
print("Conductance after improvement:",g.compute_conductance(output_SL_fast[0]))

output_SL = output_SL_fast[0]

Examples with visualization

For general examples with visualization using our built-in drawing methods, see the Jupyter notebook examples with visualization.

For comparisons of spectral- and flow-based methods with visualization see the Jupyter notebooks here and here.

For visual demonstration of algorithms that can improve a given seed set of nodes see the Jupyter notebook here.

Scalable graph analytics on your laptop

For examples using reasonably large graphs (100 million edges) on a 16GB RAM laptop please see the Jupyter notebook here.

Advanced examples

For advanced examples see the Jupyter notebook here.

Demonstration: social networks

Demonstration: bioinformatics networks

Presentation

When local graph clustering methods do not perform well?

In theory and in practice we have observed that the performance of local graph clustering methods depends on the magnitute of the conductance of the target cluster as well as the magnitute of the minimum conductance in the induced subgraph of the target cluster. Simply put, if the "internal connectivity" of the target cluster (the minimum conductance in the induced subgraph of the target cluster) is not stronger than the "external connectivity" (the conductance of the target cluster) then local graph clustering methods have poor performance in terms of finding the target cluster. For theoretical details please see Section 3 in the Capacity Releasing Diffusion for Speed and Locality paper. For extensive numerical experiments that demonstrate properties of challenging target clusters please see Section 4 in Capacity Releasing Diffusion for Speed and Locality as well as the supplementary material in the same link.

Installation

Clone the repo
Enter the folder using the termimal
Type in the terminal `python setup.py install`

Note that this package runs only with Python 3.

It can also be installed through pip:

pip3 install localgraphclustering

Import from Julia

  1. In Julia, add the PyCall package:

    Pkg.add("PyCall")

  2. Update which version of Python that PyCall defaults to:

    ENV["PYTHON"] = (path to python3 executable)

    Pkg.build("PyCall")

    (You can get the path to the python3 executable by just running "which python3" in the terminal.)

  3. Make sure the PyPlot package is added in Julia.โ€จ

  4. Import localgraphclustering by using:

    using PyPlot

    using PyCall

    @pyimport localgraphclustering

You can now use any routine in localgraphluserting from Julia.

License

LocalGraphClustering, Copyright (C) 2017, Kimon Fountoulakis, Meng Liu, David Gleich, Michael Mahoney

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

localgraphclustering's People

Contributors

bkj avatar chesterhu avatar dgleich avatar kareef928 avatar kfoynt avatar mengliupurdue avatar

Watchers

 avatar

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.