有什么方法可以查找vertexId列表的邻居?

时间:2019-01-08 11:40:12

标签: scala apache-spark spark-graphx

我是spark graphx的新手,是否有任何方法可以从res中查找vertexId列表的邻居?除了使用

的迭代
val graph = Graph(vertexRDD, relation)
graph.edges.take(10).foreach(println(_))
graph.vertices.take(10).foreach(println(_))
val res = graph.vertices.filter { case s: GOODSProperty => s.flag == 1
case _ => true
}
 val direction: EdgeDirection =EdgeDirection.Both
 graph.collectNeighborIds(direction).lookup(vertexId)

例如,如果我想这样做

start_id(a list of id)->all_neighbour
then all_neighbour->next_neighbour
then next_neighbor->nextnext_neighbor

查找是执行此操作的最佳方式吗?

0 个答案:

没有答案