This function is used internally by pathway2Graph to remove the smaller disconnected parts of the pathway graph.
removeDisconnectedParts(mygraph)
mygraph
a graph object
Nirupama Benis