This paper presents an algorithm to resolve superimposed action potentials encountered during the decomposition of electromyographic signals. The algorithm uses particle swarm optimization with a variety of features including randomization, crossover, and multiple swarms. In a simulation study involving realistic superpositions of two to five motor-unit action potentials, the algorithm had an accuracy of 98%.