Giter VIP home page Giter VIP logo

ngraph.slpa's Introduction

ngraph.slpa Build Status

Graph community detection algorithm. This work is based on "Towards Linear Time Overlapping Community Detection in Social Networks" paper from Jierui Xie and Boleslaw K. Szymanski.

This project is part of ngraph family.

usage

// To find communities of graph `G`, where G is `ngraph.graph` object:
var findCommunities = require('ngraph.slpa');
var searchResult = findCommunities(G);

// now we can find all communites for node `foo`:
var nodeFooCommunities = searchResult.node.foo;

console.log('Node `foo` belongs to:');
for (var i = 0; i < nodeFooCommunities.length; ++i) {
  console.log(
    'Community  name:', nodeFooCommunities[i].name,
    'With probablity:', nodeFooCommunities[i].probablity
  );
}

// We can also find what other nodes belong to `foo`'s
// first community:
var firstCommunityName = nodeFooCommunities[0].name;
var otherNodesFromCommunity = searchResult.communities[firstCommunityName];

console.log('Community name:', firstCommunityName);
for (var j = 0; j < otherNodesFromCommunity.length; ++j) {
  console.log(otherNodesFromCommunity[j]);
}

According to the paper, performance of community calculation is O(T * m), where T is a number of iteration for the algorithm, and m is total number of edges. You can set number of iteration by passing it as a second argument:

var searchResult = findCommunities(G, 100);

Memory-wise current implementation is O(scary) and needs lots of improvements. I'm not happy with how I've implemented nodeMemory object, and I believe it can be done better.

install

With npm do:

npm install ngraph.slpa

license

MIT

ngraph.slpa's People

Contributors

anvaka 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.