ngraph.louvain.native

1.0.0 • Public • Published

ngraph.louvain.native

Similar to ngraph.louvain, this module detects clusters in a graph using the Louvain Method.

The major difference here, is that this is a native node module, with C++ bindings, so that computation happens much faster.

Alas, this means this module can only work in node.js environment.

If you need pure javascript implementation use ngraph.louvain (it is fast too).

usage

Install the module:

npm i ngraph.louvain.native

And then use it:

let detectClusters = require('ngraph.louvain.native');
 
let graph = require('miserables'); // ngraph instance
 
// this would detect clusters
let clusters = detectClusters(graph);
 
// and you can iterate over them:
graph.forEachNode(function(node) {
  console.log('Node ' + node.id + ' belongs to ' + clusters.getClass(node.id));
});

see also

license

MIT

support

If you like what I do, please support me on patreon.

/ngraph.louvain.native/

    Package Sidebar

    Install

    npm i ngraph.louvain.native

    Weekly Downloads

    2

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    23.6 kB

    Total Files

    16

    Last publish

    Collaborators

    • anvaka