慢慢 6 years ago
commit 78beb200f5

@ -77,7 +77,7 @@
``` ```
//起始顶点id //起始顶点id
val srcVertexId = 1L val srcVertexId = 1L
// 调用`pregel`方法之前,首先初始化所有点的值 // 调用pregel方法之前首先初始化所有点的值
val initialGraph = graph.mapVertices { case (id, (name)) => if (id == srcVertexId) (new ArrayBuffer[Long](),0.0) else (new ArrayBuffer[Long](),Double.PositiveInfinity) } val initialGraph = graph.mapVertices { case (id, (name)) => if (id == srcVertexId) (new ArrayBuffer[Long](),0.0) else (new ArrayBuffer[Long](),Double.PositiveInfinity) }
initialGraph.vertices.foreach(println) // 后面操作中删除 initialGraph.vertices.foreach(println) // 后面操作中删除

Loading…
Cancel
Save