ngraph
所属分类:图形图像处理
开发工具:JavaScript
文件大小:56KB
下载次数:0
上传日期:2023-02-22 02:38:49
上 传 者:
sh-1993
说明: ngraph.graph的中心和授权(HITS)算法
(Hubs and authorities (HITS) algorithm for ngraph.graph)
文件列表:
LICENSE (1086, 2023-08-19)
index.d.ts (1120, 2023-08-19)
index.js (3358, 2023-08-19)
package-lock.json (228712, 2023-08-19)
package.json (661, 2023-08-19)
test (0, 2023-08-19)
test\index.js (1329, 2023-08-19)
# ngraph.hits [![build status](https://github.com/anvaka/ngraph.hits/actions/workflows/tests.yaml/badge.svg)](https://github.com/anvaka/ngraph.hits/actions/workflows/tests.yaml)
Hubs and authorities (HITS) algorithm for [`ngraph.graph`](https://github.com/anvaka/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](https://en.wikipedia.org/wiki/HITS_algorithm).
# usage
``` js
// 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:
``` js
{
"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:
``` js
var precision = 1e-5;
hits(graph, precision); // compute with 1e-5 precision
```
# install
With [npm](https://npmjs.org) do:
```
npm install ngraph.hits
```
# license
MIT
近期下载者:
相关文件:
收藏者: