Substantial deterioration of surface water quality, mainly caused by human activities and climate change, makes the assessment of water quality a global priority. Thus, in this study, four metaheuristic algorithms, namely the particle swarm optimization (PSO), differential evolution (DE), ant colony optimization algorithm (ACOR), and genetic algorithm (GA), were employed to improve the performance of the adaptive neuro-fuzzy inference system (ANFIS) in the evaluation of surface water total dissolved solids (TDS). Monthly and annual TDS were considered as target variables in the analysis. In order to evaluate and compare the authenticity of the models, an economic factor (execution time) and statistical indices of the coefficient of determination (R2), Kling Gupta efficiency (KGE), root mean squared error (RMSE), mean absolute error (MAE), and Nash-Sutcliff efficiency (NSE) were utilized. The results revealed that the hybrid methods used in this study could enhance the classical ANFIS performance in the analysis of monthly and annual TDS of both stations. For more clarification, the models were ranked using the TOPSIS approach by simultaneously applying the effects of statistical parameters, temporal and spatial change factors, and execution time. This approach significantly facilitated decision-making in ranking models. The ANFIS-ACOR annual model considering discharge had the best performance in the Vanyar Station; Furthermore, ANFIS-ACOR monthly model ignoring discharge was outstanding in the Gotvand Station. In total, after utilizing two defined and proposed temporal and spatial change factors, ANFIS-ACOR and ANFIS-DE hybrid models had the best and worst performance in TDS prediction, respectively.