算法介绍参考:

cloud.tencent.com/developer/a…

tech.it168.com/a2018/0428/…

各算法详细用法参考:

github.com/neo4j-contr…

Centrality Algorithms(中心性算法)

6. PageRank

PageRank也用于机器学习，以确定最有影响的提取特征。在生物学中，它被用来识别食物网中哪些物种的灭绝会导致物种死亡的最大连锁反应。

```MERGE (home:Page {name:'Home'})
MERGE (product:Page {name:'Product'})
MERGE (a:Page {name:'Site A'})
MERGE (b:Page {name:'Site B'})
MERGE (c:Page {name:'Site C'})
MERGE (d:Page {name:'Site D'})

```CALL algo.pageRank.stream('Page', 'LINKS', {iterations:20, dampingFactor:0.85})
YIELD nodeId, score
RETURN algo.asNode(nodeId).name AS page,score
ORDER BY score DESC```

7. Degree Centrality(程度中心性)

```CALL algo.degree.stream("Page", "LINKS", {direction: "incoming"})
YIELD nodeId, score
RETURN algo.asNode(nodeId).name AS name, score AS followers
ORDER BY followers DESC```

8. Closeness Centrality(亲密度中心性)

```CALL algo.closeness.stream('Page', 'LINKS')
YIELD nodeId, centrality
RETURN algo.asNode(nodeId).name AS name, centrality
ORDER BY centrality DESC```

9. Betweenness Centrality(中介中心性)

Betweenness Centrality也被用来评估多人在线游戏玩家和共享医师专业知识的信息流。

```CALL algo.betweenness.stream('Page','LINKIS',{direction:'out'})
YIELD nodeId, centrality
MATCH (page:Page) WHERE id(page) = nodeId
RETURN page.name AS page,centrality
ORDER BY centrality DESC;```