In this paper, a new hybrid model is proposed using Subset Selection by Maximum Dissimilarity (SSMD) and adaptive neuro-fuzzy inference system (ANFIS) hybridized with the firefly algorithm (FFA) to predict the longitudinal dispersion coefficient (K x). The proposed framework (ANFIS-FFA), combines the specific structures and strengths of both ANFIS and FFA approaches. The FFA is used to derive the optimum ANFIS parameters. The K x data set includes 503 cross-sectional data point from small to large rivers. For pre-processing of the data set, the SSMD method is used, which is superior to the classical trial and error method. The database covers a wide range of river width (0.2-867m), and depths (0.034-19.9 m). Fifteen different combinations of river width (B), depth (H), flow velocity (U) and shear velocity (U *) are implemented as inputs to create fifteen estimative models. The output of the ANFIS-FFA model is compared with the ANFIS and previously published equations to check the performance of the proposed model. The results show that the highest accuracy is attained by the M1 model, with all geometric and hydrodynamic parameters as input variables in comparison with ANFIS and previous equations. The R 2 value, RMSE, MAE and NSE for ANFIS-FFA model are 0.67, 113.14 m 2 /s, 48 m 2 /s, and 0.63 for proposed dimensional model, and 0.35, 874.5, 520.8, and 0.1 in non-dimensional ANFIS-FFA model, respectively. These values were 0.37, 463.34 m 2 /s, 85.69 m 2 /s, and −5.19 for dimensional ANFIS model, and 0.11, 3269.88, 1932.09 and −11.54 for non-dimensional ANFIS model, respectively. Overall, hybridization caused 81%, 75%, 76% improvement in R 2 , RMSE and MAE. In another contribution of the paper, by using the matrix form of developed ANFIS-FFA optimized parameters, a novel explicit calculation procedure for estimation of K x is derived. Based on the results, the proposed ANFIS-FFA model exhibits significant improvements than the classical ANFIS and highlights that optimizing by nature-inspired optimization algorithms plays a critical role in strengthening the ANFIS estimations generality. INDEX TERMS Longitudinal dispersion coefficient, ANFIS-FFA, maximum dissimilarity method, natural rivers, adaptive neuro-fuzzy inference system.