ngraph.hits
TypeScript icon, indicating that this package has built-in type declarations

2.2.0 • Public • Published

ngraph.hits build status

Hubs and authorities (HITS) algorithm for ngraph.graph. HITS algorithm is a link analysis algorithm, which assigns each graph node two scores:

  • authority - estimates the value of a node
  • hub - estimates the value of outgoing links from a node

See more details about algorithm here: Hyperlink-Induced Topic Search.

usage

// let's say we have a graph with just one link: a -> b
var graph = require('ngraph.graph')();
graph.addLink('a', 'b');

// let's compute ranks for each node:
var hits = require('ngraph.hits');
var result = hits(graph);

Now result will be an object with the following values:

{
  "a": {
    "authority": 0,
    "hub": 1
  },
  "b": {
    "authority": 1,
    "hub": 0
  }
}

By default the algorithm will compute ranks values with 1e-8 precision. You can configure this by passing optional argument:

var precision = 1e-5;
hits(graph, precision); // compute with 1e-5 precision

install

With npm do:

npm install ngraph.hits

license

MIT

Package Sidebar

Install

npm i ngraph.hits

Weekly Downloads

1

Version

2.2.0

License

MIT

Unpacked Size

9.35 kB

Total Files

7

Last publish

Collaborators

  • anvaka