I'm fairly new to spark and GraphX, and I'm trying to understand how to perform the following operation using GraphX's Java APIs. I'm looking to produce a method with the following signature:
private <List<Graph<VD, ED>> computeConnectedComponents(Graph<VD, ED> graph){}
Where, given a graph with only positive degree nodes, but an unknown number of connected components, it should return a list (order doesn't matter) of graphs, where each graph is connected.
I am aware of GraphOps.connectedComponents()
and ConnectedComponents.run()
, but I am struggling to understand the return values. The docs list them as returning a graph of Graph<Object, ED>
and say something about the "lowest vertex id" being returned.
Basically, I am wondering what I could do to derive this list of Graphs from the return value of connectedComponents and my initial graph.