What & why
GeaFlow has PageRank and ClosenessCentrality, but not Betweenness Centrality —
a measure of how often a vertex sits on shortest paths between other vertices,
i.e. how much of a "bridge" it is. It's a core metric for social-network and
key-node analysis. It's also genuinely hard: the classic Brandes algorithm has
two phases (shortest-path counting + dependency accumulation), which makes it a
satisfying high-difficulty challenge.
GeaFlow 有 PageRank、ClosenessCentrality,但缺介数中心性(Betweenness)——衡量一个
顶点作为"最短路径桥梁"的重要性,是社交网络/关键节点分析的核心指标。它实现难度大
(经典 Brandes 算法需要两阶段:最短路径计数 + 依赖累积),非常适合作为高难度挑战题。
The task
Implement Betweenness Centrality on GeaFlow's vertex-centric / message-passing
model (an unweighted-graph version is a fine first cut).
基于 GeaFlow 的顶点中心/消息传递模型实现介数中心性(可先做无权图版本)。
Where to look / 怎么做
- Reference the more complex existing algorithms:
udf/graph/PageRank.java (multi-iteration + convergence) and
SingleSourceShortestPath.java (shortest paths).
- Implement
AlgorithmUserFunction using multi-round iteration + sendMessage
for shortest-path counting and dependency back-propagation (the Brandes approach).
- Register in
BuildInSqlFunctionTable.java.
- Use a small graph (5–7 nodes), compute the standard answer by hand, and turn
it into .sql/.txt tests.
Done when
What & why
GeaFlow has PageRank and ClosenessCentrality, but not Betweenness Centrality —
a measure of how often a vertex sits on shortest paths between other vertices,
i.e. how much of a "bridge" it is. It's a core metric for social-network and
key-node analysis. It's also genuinely hard: the classic Brandes algorithm has
two phases (shortest-path counting + dependency accumulation), which makes it a
satisfying high-difficulty challenge.
GeaFlow 有 PageRank、ClosenessCentrality,但缺介数中心性(Betweenness)——衡量一个
顶点作为"最短路径桥梁"的重要性,是社交网络/关键节点分析的核心指标。它实现难度大
(经典 Brandes 算法需要两阶段:最短路径计数 + 依赖累积),非常适合作为高难度挑战题。
The task
Implement Betweenness Centrality on GeaFlow's vertex-centric / message-passing
model (an unweighted-graph version is a fine first cut).
基于 GeaFlow 的顶点中心/消息传递模型实现介数中心性(可先做无权图版本)。
Where to look / 怎么做
udf/graph/PageRank.java(multi-iteration + convergence) andSingleSourceShortestPath.java(shortest paths).AlgorithmUserFunctionusing multi-round iteration +sendMessagefor shortest-path counting and dependency back-propagation (the Brandes approach).
BuildInSqlFunctionTable.java.it into
.sql/.txttests.Done when
CALL betweenness() YIELD (id, score)works