A genetic algorithm for generating optimal assembly plans