removed att connected_components where a deep copy is performed. This reduces both
memory and time.