Viewing the Jupyter Notebooks from nbviewer is encouraged because GitHub is still not fully integrated with the Jupyter Notebook: http://nbviewer.jupyter.org/github/suyunu/Flow-Shop-Scheduling/blob/master/ga-fss.ipynb
In this project, we tried to solve Flow Shop Scheduling Problem (FSSP) with Genetic Algorithm (GA). Before I start doing anything on the problem, I made a literature survey and found these 2 papers:
- Murata, Tadahiko, Hisao Ishibuchi, and Hideo Tanaka. "Genetic algorithms for flowshop scheduling problems." Computers & Industrial Engineering 30.4 (1996): 1061-1071
- Reeves, Colin R. "A genetic algorithm for flowshop sequencing." Computers & operations research 22.1 (1995): 5-13.
These 2 papers have done lots of good optimization tests for the parameters and obtained good results. So, I took pieces’ form both papers:
- Murata et al.
- General Structure
- Crossover
- Mutation
- Reeves
- Selection
There are n machines and m jobs. Each job contains exactly n operations. The i-th operation of the job must be executed on the i-th machine. No machine can perform more than one operation simultaneously. For each operation of each job, execution time is specified. Operations within one job must be performed in the specified order. The first operation gets executed on the first machine, then (as the first operation is finished) the second operation on the second machine, and so until the n-th operation. Jobs can be executed in any order, however. Problem definition implies that this job order is exactly the same for each machine. The problem is to determine the optimal such arrangement, i.e. the one with the shortest possible total job execution makespan.
I used a simple permutation representation.
The string "ABCDEF" represents a job sequence where "Job A" is processed first, then "Job B" is processed, and so on. If the string "ABCADE" is generated by genetic operators such as crossover and mutation, this string is not a feasible solution of the flow shop scheduling problem because the job "A" appears twice in the string and the job "F" does not appear. Therefore the string used in the flow shop scheduling problem should be the permutation of given jobs.
In this part I will explain the genetic operators such as crossover and mutation as well as the selection mechanism for the flow shop scheduling problem.
-
(Initialization) Randomly generate an initial population
$P_1$ of$N_{pop}$ strings (i,e.,$N_{pop}$ solutions). -
(Selection) Select
$N_{pop}$ pairs of strings from a current population according to the selection probability. -
(Crossover) Apply crossover operator to each of the selected pairs in Step 2 to generate
$N_{pop}$ solutions with the crossover probability$P_c$ . If the crossover operator is not applied to the selected pair, one of the selected solutions remains as a new string. -
(Mutation) Apply mutation operator to each of the generated
$N_{pop}$ strings with the mutation probability$P_m$ (we assign the mutation probability not to each bit but to each string). - (Elitist Update) Randomly remove one string from the current population and add the best string in the previous population to the current one.
- (Termination) If a prespecified stopping condition is satisfied, stop this algorithm. Otherwise, return to Step 2