The demands on assembly accuracy require accurate operations both in machining and assembly in order to achieve the high performance of products. Although advanced machining technologies can be used to satisfy most of the demands on precision assembly, the corresponding manufacturing cost will also be increased. Selective assembly provides an effective way for producing high-precision assembly from relatively low-precision components. The accuracy of selective assembly is mainly based on the number of groups and the range of the group (allocated equally on the design tolerance). However, there are often surplus parts in some groups due to the imbalance of mating parts, especially in the cases of undesired dimensional distributions, which makes the methods developed and reported in the literature often not suitable for practice. In this work, a particle swarm optimization (PSO) algorithm is proposed by applying batch selective assembly method to a complex assembly with three mating components (as in ball bearing: an inner race, ball and outer race), to minimize the surplus parts and thereby maximizing the assembly efficiency. Due to the continuous nature of particle swarm optimization algorithm, standard PSO equations cannot be used to generate discrete combination of mating parts. An effective encoding scheme is developed to make the combination of mating parts feasible. The evolution performance of the PSO algorithm with different control parameter values is also analysed. © Springer-Verlag London Limited 2011.