Repairing network partitions in Wireless Sensor Networks