2016 2nd International Conference on Cloud Computing and Internet of Things (CCIOT

)

An Improved Genetic Algorithm Using Opposition-
based Learning for Flexible Job-shop Scheduling
Problem

Huang Ming, Wang Mingxu, Liang Xu Huang Ming, Wang Mingxu, Liang Xu
School of software School of software
Dalian Jiaotong University Dalian Jiaotong University
Dalian, China Dalian, China
15041119328@163.com 15041119328@163.com

Abstract—Aiming at the flexible job-shop scheduling A dual chains structure coding method was used. Multi-parent
problem, the mathematical model was established with the precedence operation crossover and opposite critical-machine
objective of minimizing the makespan, and an improved crossover were proposed. Modified neighbor search mutation
genetic algorithm using opposition-based learning was and opposite inverse mutation were proposed. Compared this
proposed. For the characteristics of flexible job-shop proposed algorithm with other algorithms for solving FJSP,
scheduling, a dual chains structure coding method was some typical benchmark examples were used for validation and
used to encode the chromosome. Population was initialized the results show this proposed algorithm is an effective
with a hybrid scheme. Genetic operations were conducted approach.
in population among two effective crossover methods and
two mutation methods, which were proposed basis of II. FJSP MODEL
context coding method. Lastly, case-studies based on some
typical benchmark examples were carried out to evaluate A. Problem Description
the proposed algorithm. The experimental results show FJSP can be formulated as follows: there are
that these improvements allow the genetic algorithm to N jobs  J i , i  1,2, , N  , which need to be processed on
reach high quality solutions in very short time. M machines Mi ,i 1,2,, M .Each job Ji i 1,2,, N  consists
Keywords—flexible job-shop scheduling problem; opposition- of a sequence of ki ki  1 operations. Oij denotes the
based learning; genetic algorithm k k  1,2, , k i  operation of job J i . Mi k Mi k 1,2,, M
represents the set of machines which can process the Oij . An
I. INTRODUCTION
operation Oij can be executed by one machine out of set
Flexible job-shop scheduling problem (FJSP), which is an
extension of the classical job-shop problem [1], was also a non- M i k of given machines.
polynomial-hard (NP-hard) problem. It has captured the
interest of many researchers. For example, a FJSP with 3 jobs and 4 machines is
illustrated in TABLE I. The symbol “—” means the operation
In recent years, the hotspot of research is still using cannot be processed on the corresponding machine.
intelligent optimization algorithms, such as genetic algorithm
[2], for solving FJSP. Wang el al. [3] examined the
characteristics of FJSP, proposed an improved genetic TABLE I. PROCESS TIMES FOR A FJSP WITH 3JOBS AND 4 MACHINES
algorithm. Peng el al. [4] introduced evolutionary strategy
Job Operation M1 M2 M3 M4
based on cloud model and proposed a modified non-dominated
sorting algorithm. Lu el al. [5] proposed an improved cellular O11 3 4 — 3
genetic algorithm for FJSP according to its characteristics. Wu J1
O12 3 5 — —
el al. [6] proposed a hybrid intelligence algorithm to solve
multi-objective FJSP that was based on the combination of O21 3 4 5 —
J2
genetic algorithm, ant colony algorithm, and particle swarm O22 — 3 4 —
optimization.
O31 — — 3 4
However, the shortcomings of premature convergence and
J3 O32 3 — 2 4
low search efficiency still exist when using the genetic
algorithm for solving FJSP. An improved genetic algorithm O33 4 3 6 —
using opposition-based learning was put forward in this paper.

978-1-4673-9822-0/16/$31.00 ©2016 IEEE 8 Dalian, China
FJSP mainly focuses on two problems: where 1  i  n , r  n , 1  j, u  ki .
 Arrange an operation Oij to an appropriate machine, 4) Positive constraint: the start time, process time, and
completion time are always positive.
called machine allocation problem.
 Arrange the sequence of operations for the N jobs  st ijk  0 , Cijk  0 , t ijk  0 
reasonably, called job-shop scheduling.
The objective of FJSP is finding a reasonable processes
sequence and machine arrangement that allows some III. OPPOSITION-BASED LEARNING
objectives reach the optimal. Opposition-based learning was firstly proposed by
Tizhoosh [7]. The basic idea of it is chosen a better one from
B. Objective Function current solution and their opposite solution to be next
This paper considers minimizing makespan, so we choose generation. It’s conducive to improve population diversity and
the following function as objective function: avoid premature convergence. The conception of opposite
number was depicted by Definition 1 and Fig.1.
  f  minmax Ci , i  1,2,  , n  Definition 1 Opposite number [8]: if x  a.b  and x  R ,
then the opposite number of x is:
where Ci is the completion time of the job J i .
  x   a  b  x 
C. Constraints
Four kinds of constraints need to be considered for FJSP as
follows:
1) Operation constraint: Oij must be processed after
Oi  j 1 finished. Fig. 1. Opposite number

  st ijk  st i  j 1h  t i  j 1h  According to opposition-based learning, this paper
proposed improved genetic operations.

where st ijk denotes the start time of Oij on machine M i , t ijk IV. IMPROVED GENETIC ALGORITHM USING OPPOSITION-BASED
denotes the completion time of Oij on machine M i , LEARNING

1  i  n , 1  j  k i , h, k  1,2,  , M A. Coding
2) Operation processing constraint According to the characteristics of FJSP, our chromosome
a) Processing time constraint uses a dual chains structure coding method [9]. One chain is
coding based on the process sequence of operations, called
  C ijk  t ijk  process chain. Another chain is coding based on the
arrangement of processing machine, called machine allocation
chain.
where Cijk denotes the completion time of Oij on machine M i ,
1) Process chain coding
1  i  n , 1  j  ki . Concerning the process chain, we use an array of integers
b) Processing machine constraint: Oij can only be with the length of each chain, and each integer value equals the
index of array of operation for the corresponding job sequence.
processed by the machine from the given set. According to TABLE I, for example, one process chain can be
coding as follows:
  M k  M ik 

where M k denotes k th machine in the machine set
M  m1, m2,,mM , M i k denotes the set of available machines of
Oij .
3) Machine constraint: each M k can only process one Oij
at the same time.

  st ijk  st ruk  t ruk 

9
C. Initial Population Chromosomes
Process
Based on initializing population by a hybrid scheme [10],
2 1 3 2 3 3 1 an improved hybrid scheme was proposed to generate the
chain
initial population. The population has good uniformity and
diversity.
1) Initial chromosomes randomly
Job
For the process chain, the value of each gene position is
J2 J1 J3 J2 J3 J3 J1
sequence chosen from job set J   j1 , j 2 ,, j N  randomly. For the
machine allocation chain, the value of each gene position is
generated randomly in the length range of the machine
Operation O21 O11 O31 O22 O32 O33 O12 allocation chain.
sequence

2) Initial chromosomes based on U n n s (uniform design)  
Fig. 2. Process chain coding Step1: Compute the length of machine allocation
chain length .
2) Machine allocation chain coding
For the machine allocation chain, we use the array of Step2: If length is odd number, set n  length ;
integers with the length of machine allocation chain, and each else, n  length  1 .
integer value equals the number of machine chosen by
corresponding operation for each job. Step3: Find all integers h which have the following
properties:
According to TABLE I, for example, one machine
allocation chain can be coding as follows:  h  n
 The greatest common divisor of n and h is 1
Sort by
O11 O12 O21 O22 O31 O32 O33 The generating vector h  h1 , h2 ,, hs  is composed of
operation
these integers.

Machine 2 1 4 3 2 3 1
 
Step4: Generate U n n s according to the h  h1 , h2 ,, hs  .
allocation Each cell of uniform design is generated by recurrence formula
chain
as follows:

M1 M2 M4 M1 M3 M4  uij  h j

    uij  h j u 
 h j  n 
ij
ui 1, j   u  h % n
  
uij  h j  n 
  i j j
Arrange machine M1 M2 M3

where i  1,2,  , n  1 , j  1,2,  , s
Fig. 3. Machine allocation chain coding
Step5: If n  length  1 , delete the last row of U n n s .  
B. Fitness Function Step6: Select s columns from U n n s as s machine  
In GA, the evolution of individuals is mainly according to allocation chain.
the value of their fitness function. The ability of adapting to
environment is also determined by that value. In GA, the 3) Initial chromosomes based on the best machine
minimization problem is usually converted into an equivalent Each gene position of machine allocation chain is the
maximization problem, so we choose the following machine with minimal process time in their available machines
transformation as fitness function: set. According to TABLE I, for example, each operation’s best
machine, process time and coding are illustrated in TABLE II.

C max  f ( x ) ( f ( x )  C max ) TABLE II. BEST MACHINE CODING
 Fx   
 0 ( f ( x)  C max )
Operation Best machine Time Coding

where C max is taken as a large positive, f  x  is objective O11 M1 2 1
function. O12 M1 3 1

10
O21 M1 3 1 fitness value of the population; f max represents the biggest
fitness value of the population; N denotes the evolutionary
O22 M2 3 2 generations;  represents a convergence limit of adaptive
O31 M3 3 3 crossover probability.  is a fixed positive decimal in this
paper.
O32 M3 2 3
According to the characteristics of FJSP, two kinds of
O33 M2 3 2 method for crossover operation were proposed. One is multi-
parent precedence operation crossover; the other is opposite
D. Selection critical-machine crossover.
Selection operation is responsible for selecting some
individuals of the population. Roulette-wheel selection 1) Multi-parent precedence operation crossover
operator is used to select some good individuals. The Based on improved precedence operation crossover [11], a
multi-parent precedence operation crossover was proposed.
population size is M , the fitness value of individual i is Fi , the
Three parent individuals are Parent 1 , Parent 2 and Parent 3 .
selection works as follows:
Two new children individuals are Chidren 1 and Chidren 2 .
Step1: Compute the sum of fitness value of all individuals. The crossover works as follows:
Step1: Set c  C , Pc denotes crossover probability.
M
   Fi , i  1,2,  , M   Step2: If c  0 , go to Step 3; else, end;
i 1

Step3: Generate a random number rand between 0, 1 ,
Step2: Compute the probability of being selected for each
individual i i  1,2,
,M  . if rand  Pc , select three individuals from C as Parent 1 ,
Parent 2 and Parent 3 , and go to Step 4; else, go directly to
Step 8.
M
Step4: Divide the job set 1, 2,i, j,  n into two non-
  Pi  Fi /  F , i  1,2,  , M  
i 1
i
empties mutual children set J 1 and J 2 randomly;

Step3: Compute the cumulative probability of each Step5: Copy all genes of Parent 1 that are included in
individual i i  1,2,
,M  . J 2 to Chidren 1 in the same position.

Step6: Copy all genes of Parent 2 that are included in J 1
  Pi  Pi  Pi 1  to Chidren 2 in the same position.

Step4: Generate a random number random between 0,1 , Step7: Copy all genes of Parent 3 that are included in J 1
to Chidren 1 sequentially and copy the gene of Parent 3 that
if Pi  random Pi1 , select individual i i  1,2,
,M  .
are included in J 2 to Chidren 2 sequentially.
E. Crossover
An improved adaptive crossover probability was put Step8: Set c  c  3 , back to Step 2.
forward, which takes evolutionary generation and status of the where C means number of individuals ready for crossover
population into consideration within their compute process. operation.
The crossover probability formulas were shown as follows:
Set J 1  1,2 , J 2  3 . The process of three parent
individuals generating two children was depicted in Fig.4:
P  P  P  P    f   favg 
 c1 c2  c1 c2 sin   , f   favg
 Pc   2 2  2 fmax  favg 
 
 Pc1 f   favg

1
 Pc1    
2  lg N

where Pc 2 is a fixed positive decimal; f  denotes the bigger
fitness value of two individuals; f avg represents the average

11
where C means number of individuals ready for crossover
Parent 1 ① ② 3 ② ① 3 3 ② ① operation.
3) Critical-machine
Critical-machine represents the last machine which
completes the processing task, and all operation processed by
Chidren 1 3 3 3 that machine called critical-operation. Makespan is determined
by critical-machine many times. Fig.5 is the Gantt chart of
Fig.2 and Fig.3, critical-machine was underlined, and the
Parent 3 ① ① ② 3 ② ② 3 ① 3 shaded area represents the critical-operation.

Chidren 1 ① ① 3 ② ② 3 3 ② ①

Parent 2 2 2 1 ③ 1 1 ③ 2 ③

Chidren 2 2 2 1 1 1 2

Parent 3 1 1 2 ③ 2 2 ③ 1 ③
Fig. 5. Gantt chart

Chidren 2 2 2 1 ③ 1 1 ③ 2 ③ F. Mutations
Fig. 4. Multi-parent precedence operation crossover
Similar with the improved adaptive crossover probability,
improved adaptive mutation probability formulas were shown
2) Opposite critical-machine crossover as follows:
Based on critical-machine optimization crossover [12], an
opposite critical-machine crossover was proposed. The
crossover works as follows: P  P  P  P   f   favg 
 m1 m2  m1 m2 sin   , f  favg
Step1: Set c  C , Pc denotes crossover rate.  Pm  2 2  2 fmax favg 
 
 Pm1 , f  favg
Step2: If c  0 , go to Step 3; else, end; 

Step3: Generate a random number rand between 0, 1 ,
if rand  Pc , select two individuals from C as Parent 1 0.1
  Pm1    
and Parent 2 , and go to Step 4; else, go directly to Step 8. 2  0.8  lg N

Step4: Decode individual Parent 1 , and get the critical- where Pm 2 is a fixed positive decimal; f denotes the fitness
machine of Parent 1 . value of individual ready for mutation; f avg represents the
Step5: Find all critical-operations of Parent 1 that are average fitness value of the population; f max represents the
processed on the critical-machine. biggest fitness value of the population; N denotes the
Step6: Take all machines out of Parent 2 corresponding to evolutionary generations;  represents a convergence limit of
adaptive mutation probability.  is a fixed positive decimal in
the critical-operation in Parent 1 and compute their opposite
this paper.
machine
Similarity, according to the features of FJSP, modified
Step7: Exchange the machine of critical-operation in the neighbor search mutation and opposite inverse mutation
Parent 1 and the opposite machine of corresponding operation methods were proposed.
in the Parent 2 ;
1) Modified neighbor search mutation
Step8: Set c  c  2 , back to Step 2. Based on improved neighbor search mutation [13], an
improved neighbor search mutation was proposed. The
mutation works as follows:

12
Step1: Set c  1 , Pm denotes mutation probability. Step3: If g  times , algorithm ends; else, go to Step 4.

Step2: If c  C , go to Step 3; else, end; Step4: Calculate the fitness value Fi of each individual i
Step3: Generate a random number rand between 0, 1 , Step5: Execute roulette wheel selection operation
if rand  Pm , select individual ci ci  C  from C as Step6: According to crossover probability Pc , execute
Parent 1 and go to Step 4; else, go directly to Step 6. multi-parent precedence operation crossover and opposite
critical-machine crossover respectively.
Step4: Generate  gene positions differently and give a full
array of these  genes, generate !individuals. Step7: According to mutation probability Pm , execute
Step5: Compute the fitness value of those !individuals, modified neighbor search mutation and opposite inverse
and return the best individual to replace ci ci  C  mutation respectively.
Step8: Set g  g  1 , back to Step 3;
Step6:Set c  c  1 , back to Step 2;
Begin
2) Opposite inverse mutation
Based on the classic inverse mutation, opposition-based
learning mechanism was imported, and opposite inverse
mutation was proposed. The mutation works as follows: Initialize parameters, set g0

Step1: Set c  1 , Pm denotes mutation probability.
Step2: If c  C , go to Step 3; else, end; Initialize population by a hybrid scheme

Step3: Generate a random number rand between 0, 1 ,
if rand  Pm , select individual ci ci  C  from C as Parent 1 Y
g  times
and go to Step 4; else, go to Step 9.
Step4: Generate two integers r1 and r2 in the length of N
individual ci ci  C  randomly, and r1  r2 . Calculate the fitness value

Step5: According to r1 and r2 , ci ci  C  is divided into
three parts: 0,r1  , r1,r2  and r2,l  .
Roulette wheel selection
Step6: Retain 0,r1  and r2,l  parts, reverse gene order
of r ,r  , generate new part r ,r  .
1 2 1 2

Step7: Compute each gene’s opposite number in r1,r2  ,
Multi-parent precedence Opposite critical-
crossover machine crossover
generate new part r ,r  .
1 2

Step8: Three parts 0,r1  , r1,r2  and r2,l  construct a
new individual c  .
i
Neighbor search mutation Opposite inverse
mutation
Step9: Set c  c  1 , back to Step 2.
where C means the total number of individuals ready for
mutation operation, l denotes the length of machine allocation Set g  g 1
chain.
G. Famework of the Proposed Algorithm
The algorithm is executed in the following steps. The flow
chart was shown as Fig.6. times means the maximal End, output results
evolutionary generation.
Step1: Initialize the parameters used in the proposed Fig. 6. Flow chart of proposed algorithm
algorithm and set g  0 ;
Step2: Initialize the population by hybrid scheme.

13
V. BENCHMARK EXAMPLE VALIDATION [18]. Besides, TABLE VI and Fig.7 represent one minimum
In this section, we adopt the famous examples, the Kacem makespan of 8 8 instance and their Gantt chart respectively.
[14] and Brandimarte [15], to validate our proposed algorithm.
All parameters used in the proposed algorithm were shown in TABLE III. PARAMETERS USED IN THIS PAPER
TABLE III.
Popsize times Pc Pm  
The result of two kinds of benchmark is shown in TABLE
IV and TABLE V respectively. In Kacem examples, we use the 100 100 0.8 0.01 0.8 0.13
proposed algorithm with classical genetic algorithm and the where Popsize denotes the number of initial population.
algorithm proposed by YUAN el al [16] for comparison. For
Brandimarte example, we use the proposed algorithm compare
with algorithm proposed by ZHANG el al [17] and Wang el al

TABLE IV. COMPARISON WITH DIFFERENT ALGORITHM USED KACEM INSTANCE

Classical YUAN el al Proposed algorithm
Problem Factor Best result
GA [16] Best( C max ) Avg( C max )

88 C max 14 16 14/15 14 14
10  10 C max 7 7 7 7 7

TABLE V. COMPARISON WITH DIFFERENT ALGORITHM USED BRANDIMARTE INSTANCE

ZHANG el Wang el al Proposed algorithm
Problems Factor Best result
al [17] [18] Best( C max ) Avg( C max )

MK 01 C max 40 40 40 40 40

MK 04 C max 60 60 60 60 61.6
As shown in TABLE IV, for Kacem 8  8 and 10  10 As shown in TABLE V, for Brandimarte MK 01 and
instances, the minimum makespan obtained by the proposed MK 04 instance, the result obtained by our paper is equal to
algorithm is better or equal to the other algorithm. For example, the other algorithm.
the minimum makespan 14 obtained by us is better or equal to
the other algorithm.

TABLE VI. ONE OF BEST SOLUTION

Process chain 3,4,5,5,8,4,6,1,5,6,1,8,1,7,4,7,7,5,8,2,2,3,2,3,8,6,2
Machine allocation chain 12,4,16,3,17,5,23,5,9,8,2,14,3,25,6,23,6,10,7,20,3,12,3,22,2,21,2

Fig. 7. Gantt chart of TABLE VI

14
[7] Tizhoosh H R. Opposition-based learning: a new scheme for machine
VI. CONCLUSION intelligence [C]. Proceedings of IEEE computational Intelligence for
modelling, Control and Automation, Vienna, Austria, 2005:695-701.
This paper proposes an improved genetic algorithm based [8] Rahnamayan S, Tizhoosh H R, Salama M M A. Opposition-based
on opposition-based learning for FJSP. For the characteristics differential evolution [J]. IEEE Transaction on Evolutionary
of FJSP, the mathematical model was established with the Computation, 2008,12 (1): 64-79.
objective of minimum makespan, process chain and machine [9] LIU Xiao-bing, JIAO Xuan, NING Tao, LIANG XU. Flexible job shop
allocation chain coding method was used. Initialize the scheduling based on double chains quantum genetic algorithm [J].
population by a hybrid scheme. Multi-parent precedence Computer integrated manufacturing Systems. 2015(02)
operation crossover and opposite critical-machine crossover [10] FANG Shui-liang, YAO Yan-fei, ZHAO Shi-kui. Flexible job-shop
were proposed. Modified neighbor search mutation and scheduling with multi-objective based on genetic algorithm [J]. Journal
of machanical & Electrical engineering. 2011(03).
opposite inverse mutation were used. Compared this proposed
[11] CHENG Zi-an, TONG Ying, SHEN Li-juan, el al. Eouble population
algorithm with other algorithms for solving FJSP, some typical hybrid genetic algorithm for solving flexible job shop scheduling
benchmark examples were used for validation and the results problem [J]. Computer engineering and design. 2016(06).
show this proposed algorithm is an effective approach. [12] FANG Shui-liang, YAO Yan-fei, ZHAO Shi-kui. Improved genetic
algorithm for flexible job shop scheduling [J]. Journal of Zhejiang
University (Engineering science). 2012(04).
REFERENCES
[13] LI Tie-ke, WANG Wei-ling, ZHANG Wen-xue. Solving flexible job
[1] HUANG Ming, LIU Pengfei. Research on job shop scheduling problem shop scheduling problem based on cultural genetic algorithm [J].
under mixed production patterns [M]. Beijing:Beijing normal university Computer integrated manufacturing Systems. 2010(04).
publishing group. 2012
[14] Kacemi I, H’amm adi S, Borne P. Approach by localization and multi
[2] LIANG XU, HUANG MING. Modern hybrid intelligent optimization objective evolutionary optimization for flexible job-shop scheduling
algorithm and its application [M]. Beijing: Publishing house of problems[C]∥ IEEE Transactions on Systems, Man and Cybernetics,
eletronics industry.2011 Part C, 2002, 32(1):408-419 .
[3] Wang Jinfeng, Yin Guofu, Lei Qianzhao, el al. Scheduling for the [15] Paolo B. Routing and scheduling in flexible job shop by tabu search [J].
flexible job-shop problem based on an improved genetic algorithm. Annals of Operations Research, 1993, 22 (2):157-183
[J].Modern Manufacturing Engineering. 2014.5:50-54
[16] YUAN Kun, ZHU Jian-ying. Improved genetic algorithm for the flexible
[4] PENG Jiangang, LIU Mingzhou, ZHANG Mingxing, el al. Cloud model job-shop scheduling with multi-object [J]. China Mechanical
evolutionary multi-objective flexible job-shop scheduling based on Engineering, 2007, 18(2):156-160
improved non-dominated sorting [J]. Journal of mechanical engineering.
[17] ZHANG Tienan, HAN Bing, YU Bo. Flexible job-shop scheduling
2014(12).
optimization based on improved genetic algorithm [J]. Systems
[5] Lu Tongtong, Zheng Xiaodong, Zhang Yi, el al. Solving flexible job- Engineering-Theory & Practice, 2011, 31 (3): 505-511(in Chinese).
shop scheduling problem based on improved cellalar genetic algorithm
[18] Wang L, Zhou G, Xu Y, et al. An effective artificial be colony algorithm
[J]. 2015(09).
for the flexible job-shop scheduling problem [J]. International Journal of
[6] WU Fu, ZHANG Juan. Research on multi-objective flexible job-shop Advanced Manufacturing Technology, 2012, 60(1-4): 303-
scheduling problem based on hybrid intelligence algorithm [J]. Modular 315.University Science, 1989.
machine tool & Automatic manufacturing technigue. 2013.5:130-133.

15