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

Algorithm-1

The document discusses various optimization techniques including Hill Climbing, Simulated Annealing, and Genetic Algorithms. It provides examples of each method, illustrating their processes and outcomes through tables and calculations. Key metrics such as function values, probabilities, and expected counts are presented to demonstrate the effectiveness of these algorithms in finding optimal solutions.

Uploaded by

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

Algorithm-1

The document discusses various optimization techniques including Hill Climbing, Simulated Annealing, and Genetic Algorithms. It provides examples of each method, illustrating their processes and outcomes through tables and calculations. Key metrics such as function values, probabilities, and expected counts are presented to demonstrate the effectiveness of these algorithms in finding optimal solutions.

Uploaded by

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

Hill Climbing

Initial
1 2 3
4 8
7 6 5 Md=4
Md=6
1 2 3 1 2 3
1 2
4 8 4 8 5
4 8 3
7 6 5 7 6 Md=3
7 6 5
1 2 3 1 2 3
Md=5
4 8 4 8 5
7 6 5 7 6
Md=2
Md=3 1 2 3 1 2 3
4 8 5 4 5
7 6 7 8 6
1 2 3 Md=0 1 2 3 1 2 1 2 3 1 3
4 5 6 4 5 4 5 3 4 5 4 2 5
7 8 7 8 6 7 8 6 7 8 6 7 8 6
Goal Md=1 Md=2 Md=3 Md=3
Hill Climbing
• A,C,G,H,K isn't the shortest path A
9

B
C D
1
8 4
0

E F G
K
8 8 5
g

H
4
Hill Climbing
A

B C D
2 3 1

E L G F Q H P
3 4 4 2 5 1 7

T N M U O
5 5 4 7 6

R S R
4 4 4
Hill Climbing
Open List Closed List X Open List Closed List X
[A] [] A [A] [ ] A
[D1,B2,C3] [A] D1 [C3, B2, D1] [A] C3
[H1,Q5,P7] [A,D1] H1 [G4,F2] [A,C3] G4
[O6, U7] [A, D1, H1] O6 [N5,M4] [A,C3,G4] N5
[R4] [A, D1, H1, O6, R4] R4 [R4,S4] [A,C3,G4,N5] R4
[ ] [A, D1, H1, O6, R4] ----- [] [A,C3,G4,N5,R4] -----
• F(X)= -X^3 + 60X^2 -900X – 100
• A solution X is represented as string 5 bits neighborhood consist in flipping
random a bit
• The initial solution is 10011 (X=19, F(X)= -2399).
• There are two scenarios
• First T min= 200 T max= 500
• Second T min= 100 T max= 200
• Cooling g(T)= 0.9 T
Simulated anneling
T Move X decimal F(X) ∆F P Rn Move
500 1 00011 3 -2287 1122 0.8 0.16 Yes 00011

450 3 00111 7 -3803 -1516 --------- --------- yes 00111


405 5 00110 6 -3556 247 0.54 0.36 Yes 00110

364.5 2 01110 14 -3684 -128 --------- --------- Yes 01110


328.1 4 01100 12 -3988 -304 ------------- --------- Yes 01100
295.2 3 01000 8 -3972 16 0.95 0.87 yes 01000
265.7 4 01010 10 -4100 -128 ----------- ---------- yes 01010
239.1 5 01011 11 -4071 29 0.89 0.96 No 01010
215.2 1 11011 26 -516 3584 0 0.5 No 01010
193.7
Genetic No Initial
populatio
n
X value F(X) Probabilit
y
% Expected
count
Actual
count

• 𝐹 𝑋 = 𝑋2 1 01100 12 144 0.1247 12.47 0.49 1


• Select population 2 11001 25 625 0.5411 54.11 2.16 2
3 00101 5 25 0.0216 2.16 0.008 0
of size 4 4 10011 19 361 0.3126 31.26 1.25 1
X between 0 to 31 Sum 1155 1 100 4 4
Ava 288.75 0.25 25 1 1
Select 5,12,19,25 Max 625 0.5411 54.11 2.16 2
No Mating Crossover Offspring X value F(X)
pool point after
crossover
1 01100 4 01101 13 169
2 11001 4 11000 24 576
3 11001 2 11011 27 729
4 10011 2 10001 17 289
Sum 1763
Ava 440.63
Max 729

You might also like