Device-to-device communication offers a promising technology for the 5G network that aims to enhance the data rate, reduce latency and cost, improve energy efficiency, and provide other desired features. The 5G heterogeneous network (5GHN) with a decoupled association strategy of downlink (DL) and uplink (UL) is a promising solution for the challenges faced in the 4G heterogeneous network (4GHN). The research presented in this paper evaluates the performance of the 4GHN as well as a DL-and-UL-coupled (DU-CP) access scheme in comparison with the 5GHN with a DL-and-UL-decoupled (DU-DCP) access scheme in terms of the energy efficiency and network throughput in four-tier heterogeneous networks. The energy and throughput are optimized for both scenarios, i.e., DU-CP and DU-DCP, and the results are compared. Detailed performance analyses of the DU-CP and DU-DCP access schemes were conducted with the help of comparisons of the results achieved by implementing a genetic algorithm (GA) and particle swarm optimization (PSO). Both of these algorithms are suited for the non-linear problem under investigation in which the search space is large. The simulation results have shown that the DU-DCP access scheme gives a better performance than the DU-CP scheme in a four-tier heterogeneous network in terms of network throughput and energy efficiency. The PSO achieves an energy efficiency of 12 Mbits/joule for the DU-CP and 42 Mbits/joule for the DU-DCP, whereas the GA yields an energy efficiency of 28 Mbits/joule for the DU-CP and 55 Mbits/joule for the DU-DCP. The performance of the proposed method is compared with those of three other schemes. The results show that the DU-DCP scheme using the GA outperforms the compared methods.