ABSTRACT Many models have been proposed in the literature of traffic engineering to investigate the relations between the prominent traffic variables such as velocity, density, and flow. However, in a specific period and environment, the traffic variables do not follow the same pattern discovered by a model and the observations might have various behavioral patterns. This means that a wide range of tangled data must be investigated and the aforementioned diverse patterns should be extracted so that the future values of the traffic variables can be predicted. This paper proposes a new approach based on which the relations between the traffic variables in the tangled data are detected. To show the practical value of this study, different procedures of the proposed approach are carried out for the traffic data of a highway in Iran. To detect the existing patterns of the collected data, an optimization regression-based model is developed based on which the traffic observations are segregated. The objective of this model is minimization of the Mean Squared Error () metric. The proposed approach fits multiple lines to the tangled data instead of a single one; therefore, the observations are segregated and diverse relations between the traffic variables will be revealed. The developed model is a mixed-integer non-linear mathematical formulation belonging to the class of NP-hard problems. Thus, two powerful meta-heuristics including the Genetic Algorithm (GA) and Particle Swarm Optimization (PSO) are used to solve the model and find the coefficients of the fitting lines. For a small number of observations, the outputs of the GA and PSO have been tested in terms of validity by comparing them to the optimal values provided by the LINGO software. The GA and PSO could reach the optimal values in 77% and 64% of their runs, respectively. The validity of the results have also been confirmed by conducting one sample t-tests. The coefficient of determination has been utilized to evaluate the goodness of the fitting lines acquired by the GA and PSO. The outputs show that the values of all fitting lines are above 0.80; therefore, it can be concluded that the GA and PSO have been successful in delivering high-quality fitting lines. Having acquired high-quality fitting lines, it was proven that the proposed approach has been sufficiently efficient and effective in detecting various behavioral patterns existing in the traffic tangled data.