0% found this document useful (0 votes)
7 views

Chapter 6. Heuristic Algorithms - Local Search

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Chapter 6. Heuristic Algorithms - Local Search

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

08/01/2024

CHAPTER 6: HEURISTIC ALGORITHM -


LOCAL SEARCH

Assoc. Prof. Dr. DO NGOC HIEN


Department of Industrial Systems Engineering (ISE )
Faculty of Mechanical Engineering (FME)
HoChiMinh City University of Technology (HCMUT)

1 Phone:
Email: hienise97@hcmut.edu.vn

DISPATCHING RULES

1
08/01/2024

2
08/01/2024

3
08/01/2024

4
08/01/2024

DIFFICULTY IN SEARCHING GLOBAL OPTIMA

barrier to local search


starting
point
descend
direction
local minima

global minima

5
08/01/2024

11

12

6
08/01/2024

Example (Application of SA Algorithm)


Consider the following instance of 1||wjTj.
Jobs 1 2 3 4
pj 8 12 6 10
dj 11 15 9 12
wj 2 3 7 6
The neighbourhood of a schedule is defined as all schedules that can be
obtained through adjacent pairwise interchanges.
Choose βk = (0.8)k.
Start with 3, 1, 4, 2 as the initial sequence.
Terminate the procedure after four iterations
Use the following numbers as uniform random numbers: U1 = 0.90, U2 =
0.37, U3 = 0.82, U4 = 0.27.

Sequence S0 = S1 = 3,1,4,2 is chosen as a first schedule. The value of the


objective function is ∑wjTj (3,1,4,2) = 141 >> G(S0) = G(S1).
 There are three schedules in the neighbourhood of S1, namely 1,3,4,2 ;
3,4,1,2 and 3,1,2,4. The respective values of the objective function are
13
170, 113 and 183.
 Selection of the best sequence results in S2 = 3, 4, 1, 2. The aspiration
criterion is changed to 113 >> G(S0) = G(S2).

Example (Application of SA Algorithm)


Consider the following instance of 1||wjTj.

Sequence So = S2 = 3,4,1,2 is selected (Objective value is 113)


The value of the objective function (S1) is ∑wjTj (3,1,4,2) = 141 >>
G(So) = G(S2).
 There are three schedules in the neighbourhood of S2, namely
4,3,1,2 ; 3,1,4,2 and 3,4,2,1. The respective values of the objective
function are 162, 141 and 137.
 Selection of the best sequence results in Sc = 3, 4, 2, 1. The
aspiration criterion is changed to 137  G(Sc) > G(S2) = G(So)
 Generate a random number U3 = Uniform (0,1) = 0.82.
 Calculate:

Due to P(S3, Sc) < U3, S3 = S2 = 3,4,1,2


• k = 3, STOP.
The “best” sequence So= 3,4,1,2. The Objective value: 113

14

7
08/01/2024

SOLVE THE PROBLEM! IN 10 MINUTES


APPLICATION OF SIMULATED ANNEALING ALGORITHM

Consider the following instance of 1||wjTj


Jobs 1 2 3 4
Pj 08 10 07 10
Dj 22 17 10 26
Wj 02 03 04 01

Apply simulated annealing to this instance.


 Neighbor generation by inserting neighborhood.
 Choose βk = (0.9)k.
 Start with 3, 1, 4, 2 as the initial sequence.
 Terminate the procedure after four iterations
 Use the following numbers as uniform random 15
numbers: U1 = 0.91, U2 = 0.27, U3 = 0.83, U4 = 0.17.

16

8
08/01/2024

17

18

9
08/01/2024

19

20

10
08/01/2024

Example (Application of Tabu-Search)


Consider the following instance of 1||wjTj.

 The neighbourhood of a schedule is defined as all schedules that can be


obtained through adjacent pairwise interchanges.
 The tabu-list is a list of pairs of jobs (j, k) that were swapped within the
last two moves and cannot be swapped again. Initially, the tabu-list is
empty.
 Sequence S1 = 2, 1, 4, 3 is chosen as a first schedule. The value of the
objective function is ∑wjTj (2, 1, 4, 3) = 500.
 There are three schedules in the neighbourhood of S1, namely 1,2,4,3 ;
2,4,1,3 and 2,1,3,4. The respective values of the objective function are
480, 436 and 652.
 Selection of the best non-tabu sequence results in S2 = 2, 4, 1, 3. The
aspiration criterion is changed to 436. 21
 The tabu-list is updated and contains now the pair (1,4).

Example (Application of Tabu-Search)


Consider the following instance of 1||wjTj.
 The values of the objective functions of the
neighbors of S2 are:

 Note that the second move is tabu. However, the first


move is anyhow better than the second. The first move
results in a schedule that is worse than the best one so
far. The best one is the current one, which therefore is a
local minimum.
 Nevertheless, S3 = 4, 2, 1, 3
 the tabu-list is updated and contains now {(2, 4), (1, 4)}.
 Neighbors of S3 with the corresponding values of the
objective functions are:
22

11
08/01/2024

Example (Application of Tabu-Search)


Consider the following instance of 1||wjTj.

S3 = 4, 2, 1, 3

 Now, although the best move is to 2, 4, 1, 3 (S2), this move is tabu.


 Therefore, S4 is chosen to be 4, 1, 2, 3.
 Updating the tabu-list results in {(1, 2), (2, 4)} and the pair (1,4)
drops fromthe tabu-list as the length of the list is kept to 2.
 Neighbors of S4 and their corresponding objective function values are:

 The schedule 4, 2, 1, 3 is tabu, but the best move is to the schedule


1, 4, 2, 3.
 So S5 = 1, 4, 2, 3.
 The corresponding value of the objective is better than the aspiration
criterion. So the aspiration criterion becomes 408. The tabulist is 23
updated by adding (1,4) and dropping (2,4).
 S5 is a global minimum, but tabu-search, being unaware of this, continues.

SOLVE THE PROBLEM! IN 10 MINUTES


APPLICATION OF TABU-SEARCH
Consider the following instance of 1||wjTj

Jobs 1 2 3 4
Pj 08 10 07 10
Dj 22 17 10 26
Wj 02 03 04 01

Apply the Tabu search heuristic on this instance


with initial sequence 3,2,1,4; the length of the tabu-
list is 2; neighbor generation by swapping pair of
jobs.
Determine the best sequence and objective value for
four iterations. 24

12
08/01/2024

25

26

13
08/01/2024

27

28

14
08/01/2024

29

30

15
08/01/2024

31

32

16
08/01/2024

33

GA – LINEAR ORDER CROSSOVER (LOX) OPERATOR


LOX typically follows four steps, namely:
Step 1: Select at random a subsequence of jobs from one parent.
Step 2: Start generating a new offspring by copying the subsequence
into the corresponding positions of the new offspring.
Step 3: Delete the jobs that are already in this subsequence from the
second parent. The remaining subsequence in the second parent
contains the jobs that the new offspring still needs.
Step 4: Place the jobs in this remaining subsequence in the unfilled
positions of the new offspring from left to right in the order that they
appeared in the second parent.

34

17
08/01/2024

35

36

18
08/01/2024

37

38

19
08/01/2024

39

40

20
08/01/2024

41

GENETIC ALGORITHM
VÍ DỤ:

FIXED SIZE

42

21
08/01/2024

GENETIC ALGORITHM
VÍ DỤ (TT)

43

GENETIC ALGORITHM - VÍ DỤ (TT)

44

22
08/01/2024

GENETIC ALGORITHM
VÍ DỤ (TT)

45
GENETIC ALGORITHM - VÍ DỤ
(TT)

46

23
08/01/2024

GENETIC ALGORITHM
VÍ DỤ (TT)

47

GENETIC ALGORITHM – VD (TT)

48

24
08/01/2024

BÀI THỰC HÀNH!


Có 6 sản phẩm (công việc) cần được gia công trên 1 máy CNC. Thời gian gia công (giờ
máy), thời gian tới hạn và trọng số của các công việc được cho như trong Bảng sau:

Công việc

A B C D E F

pj 6 9 4 7 8 10

dj 12 20 15 12 18 22

Mục tiêu hướng đến là cực tiểu thời gian trễ cực đại (1||Lmax).
Anh/Chị hãy sử dụng giải thuật Di truyền (GA) xác định thứ tự điều độ công việc tốt nhất
trên máy qua 2 bước lặp. Tập đám đông có 06 thứ tự điều độ (tập ban đầu được chọn
ngẫu nhiên). Thực hiện lai tạo theo LOX – Linear Order Crossover với 3 thực thể.
49

50

25
08/01/2024

51

52

26

You might also like