Hi Guys,

I am trying something very basic. I am using GraphX to load a graph from an
edge list file which is like this:

*220 224*
*400 401*
*220 221*

So it has following nodes (just for the sake of understanding - bear with
me for drawing):

*220 => 224          400 => 401 *
* ||*

* v 221*

Clearly, there are two "connected components" in this graph (please CMIIW).
Following is my code:


*val graph = GraphLoader.edgeListFile(sc, inputFile)*

*val componentLowestVertexGraph = graph.connectedComponents*
*componentLowestVertexGraph.vertices.collect.foreach(x => {*
*      println(x._1) // print node id's*
*  })*

gives me following result:

*224*
*401*
*220*
*221*
*400*

Per the documentation of connectedComponents:

*return a graph with the vertex value containing the lowest vertex id in
the connected component containing that vertex.*

So I was expecting to get two vertices returned for above cases.

Can some one point out if I am missing something?

Manoj

Reply via email to