In the paper, an algorithm that allows to detect and reject outliers in a self-organizing map (SOM) has been proposed. SOM is used for data clustering as well as dimensionality reduction and the results obtained are presented in a special graphical form. To detect outliers in SOM, a genetic algorithm-based travelling salesman approach has been applied. After outliers are detected and removed, the SOM quality has to be estimated. A measure has been proposed to evaluate the coincidence of data classes and clusters obtained in SOM. A larger value of the measure means that the distance between centers of different classes in SOM is longer and the clusters corresponding to the data classes separate better. With a view to illustrate the proposed algorithm, two datasets (numerical and textual) are used in this investigation.