eles.components() gives all components of the elements in the calling collection. It would be nice to have ele.component() that gives the component of a node or an edge.
ele.component() would have to take into account all the elements in the graph --- i.e. you can't specify a subset of elements to consider. For those cases, it's better to use eles.components().
eles.components()gives all components of the elements in the calling collection. It would be nice to haveele.component()that gives the component of a node or an edge.ele.component()would have to take into account all the elements in the graph --- i.e. you can't specify a subset of elements to consider. For those cases, it's better to useeles.components().