【发布时间】:2019-01-08 16:01:25
【问题描述】:
节点 V 的中介中心性定义为 所有节点对之间最短路径的比例 通过V。
我查看了 tinkerpop 食谱文档,发现它没有帮助/不起作用。即它返回一个
......1>
当我运行查询时。
运行的查询是:
g.V().as("v").repeat(both().simplePath().as("v")).emit().
filter(project("x","y","z").by(select(first, "v")).
by(select(last, "v")).
by(select(all,"v").count(local)).as("triple").
coalesce(select("x","y").as("a").
select("triples").unfold().as("t").
select("x","y").where(eq("a")).
select("t").
store("triples")).
select("z").as("length").
select("triple").select("z").where(eq("length"))).
select(all, "v").unfold().
groupCount().next()
我正在使用劳伦斯提供的航线数据,如本指南http://kelvinlawrence.net/book/Gremlin-Graph-Guide.pdf 中所述。它不包含中心性度量。我从下面开始,a)不给出任何循环路径,b)发射()调制器“输出”所有遍历的顶点
g.V().repeat(both().simplePath()).emit()
我如何从这里开始计算节点的中间中心度/或者还有其他地方可以开始。
【问题讨论】:
-
您能否更具体地说明一下配方中的哪些问题?从控制台获取该类型的输出表示某种形式的语法错误,其中控制台需要右括号或一些额外的输入。请提供您尝试过的代码。
-
请参阅编辑。它取自 tinkerpop 食谱文档tinkerpop.apache.org/docs/current/recipes/#degree-centrality