A genetic algorithm for flexible job-shop problem