图算法中的社区发现相关问题
发布于 3 个月前 作者 3703869795 475 次浏览 来自 问答

CALL apoc.algo.community(25,null,‘partition’,‘X’,‘OUTGOING’,‘weight’,10000) 这个语句中的各项参数该怎么用?能举个例子吗,感激不尽

10 回复

https://neo4j-contrib.github.io/neo4j-apoc-procedures/

The example call with scan all nodes 25 times. During a scan the procedure will look at all outgoing relationships of type :X for each node n. For each of these relationships, it will compute a weight and use that as a vote for the other node’s ‘partition’ property value. Finally, n.partition is set to the property value that acquired the most votes.

Weights are computed by multiplying the relationship weight with the weight of the other nodes. Both weights are taken from the ‘weight’ property; if no such property is found, the weight is assumed to be 1.0. Similarly, if no ‘weight’ property key was specified, all weights are assumed to be 1.0.

@zhelunwu 文档当然是看过了,还是不会用,就拿https://bigdata-ny.github.io/2016/08/12/graph-of-thrones-neo4j-social-network-analysis/ 这上面的例子来说吧,函数里的参数怎么用?

算法相关建议使用algo包,文档也更合理.apoc里的算法已经没有很好的维护了,因为都迁移到了algo 项目-github.com/neo4j-contrib/neo4j-graph-algorithms 文档-https://neo4j-contrib.github.io/neo4j-graph-algorithms/

@nonono 我想在python代码中使用apoc的图算法,该怎么做,下载源代码,然后import导入?还是?谢谢

你直接在cypher里面就可以调用啊。

@liutianling apoc用cypher调用,然后用python api的run方法来执行拼接的cypher
可以看下这个例子 https://github.com/thenoNOno/sql2neo4j

@nonono 谢谢!你说的确实可行。正在看看里面算法的效果,多谢啦。

@bingo 谢谢,是的,就是这么干的。

@nonono 文档有下载好了的分享吗?那个网站访问好慢的说,我邮箱514587849@qq.com

回到顶部