Potential fields for maintaining connectivity of mobile networks