val degrees: VertexRDD[Int] = graph.degrees
val ngb=graph.collectNeighbors(EdgeDirection.Out)
val deg2 = degrees.leftOuterJoin(ngb)
Now i want a key/value pair RDD where key is degree and value is neighbor vertex id. Basically i want to change from (id,Array[1,2,3]) to {(id,1)(id,2)(id,3)}
I have tried nested map and creating a string for the outer map. I am stuck here. If anyone can help. Thanks in advance.