The graph is generated is generated from the iterative process. It looks like this ↓
graph = graph.outerJoinVertices(updatedNode2vdata)((vid, old, newOpt) => newOpt.getOrElse(old))
//debug graph: Graph[VD, ED]
val old_nodes = graph.vertices.collect()
val old_triplets = graph.triplets.collect()
val old_comms_set = old_nodes.map({ case (vid, vdata) => {
vdata.community
}
}).toSet
val test_comms_set = old_triplets.flatMap( et => {
Seq(et.dstAttr.community, et.srcAttr.community)
}
).toSet
val test_result = old_comms_set.equals(test_comms_set)
println("$$$$$$$$$$$$$$$$$$$$$$$$$$")
println(test_result)
println("$$$$$$$$$$$$$$$$$$$$$$$$$$")
//debug
It is expected that test_result is always true. However, after the first iteration step, it is true. In the subsequent iteration steps, it is false.
As shown in the following figure, even the size is not correct. enter image description here
It's so weird. Is it a bug or something?
My fault, the isolated nodes (which do not own any edges in my design) cause the phenomenon.