An algorithm for selecting the cluster leader in a partially connected sensor network