Wireless sensor networks (WSNs) have become increasingly important in recent years due to their ability to monitor and collect data in various environments. However, WSNs are often limited by their energy resources, making energy efficiency a critical concern in designing WSNs. Clustering and multi-hop routing are effective methods for maximizing the lifetime of WSNs. The energy efficient clustering and routing problem in WSNs can be formulated as a multi-dimensional knapsack problem (d-kp). This formulation can generalize all clustering and routing protocols in regard to energy efficiency. In this paper, we investigate the hardness of the energy-efficient clustering and routing problem in WSNs based on the d-kp formulation and introduce a modified Salp Swarm Algorithm (SSA) as a method to solve this problem. SSA is a metaheuristic algorithm inspired by the behavior of salps in the ocean. Moreover, we prove that it is impossible to design a polynomial time fitness function to maximize a long-term metric such as FND (time of first node death), which is a commonly used metric for network lifetime. Our results have implications for the design of energy-efficient WSNs and call for the development of more efficient algorithms that can handle the complexity of this problem. furthermore, we evaluate our proposed algorithm using simulation and compare it to existing algorithms. Our results show that using SSA with a carefully designed fitness function based on the theoretical findings and a unique one-to-one routing protocol to mitigate the energy hole problem, outperforms many of the existing algorithms in terms of energy efficiency and network lifetime.