The latest Heterogeneous Network (HetNet) environments, supported by 5th generation (5G) network solutions, include small cells deployed to increase the traditional macrocell network performance. In HetNet environments, before data transmission starts, there is a user association (UA) process with a specific base station (BS). Additionally, during data transmission, diverse resource allocation (RA) schemes are employed. UA-RA solutions play a critical role in improving network load balancing, spectral performance, and energy efficiency. Although several studies have examined the joint UA-RA problem, there is no optimal strategy to address it with low complexity while also reducing the time overhead. We propose two different versions of simulated annealing (SA): Reduced Search Space SA (RS 3 A) and Performance-Improved Reduced Search Space SA (P IRS 3 A), algorithms for solving UA-RA problem in HetNets. First, the UA-RA problem is formulated as a multiple knapsack problem (MKP) with constraints on the maximum BS capacity and transport block size (TBS) index. Second, the proposed RS 3 A and P IRS 3 A are used to solve the formulated MKP. Simulation results show that the proposed scheme P IRS 3 A outperforms RS 3 A and other existing schemes such as Default Simulated Annealing (DSA), and Default Genetic Algorithm (DGA) in terms of variability and DSA and RS 3 A in terms of Quality of Service (QoS) metrics, including throughput, packet loss ratio (PLR), delay and jitter. Simulation results show that P IRS 3 A generates solutions that are very close to the optimal solution.