Solving a connectivity problem