An Energy-Efficient Method for Nodes Assignment in Cluster-Based Ad Hoc Networks