rnet_connected function

Keep only segments connected to the largest group in a network