Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 15

THEORETICAL ANALYSIS

OF
WHALE OPTIMIZATION ALGORITHM

PRESENTED BY
GROUP K
COURSE: DESIGN AND ANALYSIS OF
ALGORITHM
• SHEHU ZARA'U ABDU 13/33440/U/1
• UMAR HUDU MUHAMMAD 13/33444/U/6
• FRANCIS M YUSUF 12/28274/U/1
• A. Y. ABDULAZEEZ 13/34814/U/6
• ABDULLAHI KAFAYAH I. 14/36121D/1
• NASIRU ABDULKADIR MUHAMMAD 14/36295D/6
 Whale Optimization Algorithm (WOA) (History and main idea)

 Inspiration and Foraging Behaviour


 The Basic Concepts of the Whale Optimization Algorithm (Encircling prey)
 The WOA Algorithm
 Theoretical Analysis of WOA (Operations Performed)

 Time Complexity
 Best Case
 Worst Case

 Time Complexity in Big O.


 Best Case in Big O.
 Worst Case in Big O.

 References
Whale Optimization Algorithm
(WOA) (History and main idea)
 The whale optimization algorithm (WOA)

is a novel meta-heuristics algorithm

proposed by Mirjalili at el.

 WOA is population based method

 WOA simulate bubble-net attacking

method of the humpback whales when

they are hunting their preys.


Inspiration and foraging
behaviour
 Whales are considered biggest

mammals in the world.

 They are intelligent due to the spindle

cells in their brain.

 The whales are living in groups and they

are able to develop their own dialect.

 There are 7 types of whales and the

humpback whale is one of these types.


Inspiration and foraging
behaviour (Cont.)
 It has a special hunting mechanism

which is called bubble-net feeding

method.

 The foraging behaviour is done by

creating a special bubbles in a spiral

shape or (9 shape) path.


The WOA Algorithm
Initialize the whales population Xi (i = 1, 2, ..., n)
Calculate the fitness of each search agent
X*=the best search agent
while (t < maximum number of iterations)
for each search agent
Update a, A, C, l, and p
if1 (p<0.5)
if2 (|A| < 1)
Update the position of the current search agent by the Eq.(2)
else if2 (|A|≥ 1)
Select a random search agent(Xrand)
Update the position of the current search agent by the Eq.(8)
end if2
else if1 (p≥0.5)
Update the position of the current search by the Eq.(5)
end if1
end for
Check if any search agent goes beyond the search space and amend it
Calculate the fitness of each search agent
Update X* if there is a better solution
t=t+1
end while
return X*
Theoretical Analysis of WOA (Operations Performed)

The primitive operations performed on WOA are as follows:

 Assignment
 Comparison
 Arithmetic
 Return from a method

Example of how primitive operations are been carried out.


Identifying the operations performed on WOA
n comparison & n assignment
Initialize the whales population Xi (i = 1, 2, ..., n)
Calculate the fitness of each search agent n assignment
X*=the best search agent
while (t < maximum number of iterations) n comparison
for each search agent
Update a, A, C, l, and p n comparison
if1 (p<0.5)
if2 (|A| < 1) n comparison
Update the position of the current search agent by the Eq.(2)
else if2 (|A|≥ 1) n comparison
Select a random search agent(Xrand)
Update the position of the current search agent by the Eq.(8)
end if2
else if1 (p≥0.5)
Update the position of the current search by the Eq.(5) n comparison
end if1
end for
Check if any search agent goes beyond the search space and amend it
Calculate the fitness of each search agent
Update X* if there is a better solution
t=t+1 n assignment & n addition
end while
return X*

1 return
Time Complexity, Best Case and Worst Case of WOA
• Time Complexity
Initialize the whales population Xi (i = 1, 2, ..., n)
Calculate the fitness of each search agent Comparison = 6n
X*=the best search agent
while (t < maximum number of iterations)
Assignment = 2n + 1
for each search agent Addition =n
Update a, A, C, l, and p
if1 (p<0.5) Return =1
if2 (|A| < 1)
Update the position of the current search agent by the Eq.(2) Total time = c1.6n + c2.(2n + 1) + c3.n + c4.1
else if2 (|A|≥ 1)
Select a random search agent(Xrand)
Where c1,c2,c3 & c4 are the constant time
Update the position of the current search agent by the Eq.(8) required for the operator comparison, assignment
end if2
else if1 (p≥0.5) addition and return respectively.
Update the position of the current search by the Eq.(5)
end if1
end for
Check if any search agent goes beyond the search space and amend it
Calculate the fitness of each search agent
Update X* if there is a better solution
t=t+1
end while
return X*

• Best Case • Worst Case


Assignment = 3 Assignment = 2n + 1
Comparison = 6 Comparison = 6n
Return =1 Assignment = n
Return =1
Total time = c1.3 + c2.6 + c3.1 Total time = c1.(2n + 1) + c2.6n + c3.n + c4.1
Big O Notation of WOA
• Time Complexity in big O.
Initialize the whales population Xi (i = 1, 2, ..., n) Comparison = 6n
Calculate the fitness of each search agent
Assignment = 2n + 1
X*=the best search agent
while (t < maximum number of iterations) Addition =n
for each search agent Return =1
Update a, A, C, l, and p
if1 (p<0.5) Total time = c1.6n + c2.(2n+1) + c3.n + c4.1
if2 (|A| < 1)
Update the position of the current search agent by the Eq.(2)
else if2 (|A|≥ 1) Where c1,c2,c3 & c4 are the constant time required for
Select a random search agent(Xrand) the operator comparison, assignment addition and
Update the position of the current search agent by the Eq.(8) return respectively.
end if2
else if1 (p≥0.5) g(n) = c n
Update the position of the current search by the Eq.(5)
end if1
end for
Check if any search agent goes beyond the search space and amend it
Calculate the fitness of each search agent
Update X* if there is a better solution
t=t+1
end while
return X*

Answer: O(n) f(n) = c1(6n) + c2(2n +1) + C3.n + c4.1


Why? Because when g(n) = n and
for some c (say c=10000),
We satisfy that f(n) ≤ c.g(n), for n ≥ n0. So, O(n)
n0
Big O Notation of WOA (Cont.)

• Best Case time complexity in big O.


Initialize the whales population Xi (i = 1, 2, ..., n) Assignment = 3
Calculate the fitness of each search agent
X*=the best search agent Comparison = 6
while (t < maximum number of iterations) Return =1
for each search agent
Update a, A, C, l, and p
Total time = c1.3 + c2.6 + c3.1
if1 (p<0.5)
if2 (|A| < 1)
Update the position of the current search agent by the Eq.(2)
else if2 (|A|≥ 1)
Select a random search agent(Xrand)
Update the position of the current search agent by the Eq.(8) g(n) = 1
end if2
else if1 (p≥0.5)
Update the position of the current search by the Eq.(5)
end if1
end for
Check if any search agent goes beyond the search space and amend it
Calculate the fitness of each search agent
Update X* if there is a better solution
t=t+1
f(n) = c1.3 + c2.6 + C3.1
end while
return X*
n0
Answer: O(1)
Why? Because when g(n) = 1 and for some c (say c=10000),
We satisfy that f(n) ≤ c.g(n), for n ≥ n0. So, O(1)
Big O Notation of WOA (Cont.)
• Worst Case time complexity in big O.
Initialize the whales population Xi (i = 1, 2, ..., n) Assignment = 2n + 1
Calculate the fitness of each search agent
X*=the best search agent Comparison = 6n
while (t < maximum number of iterations) Assignment = n
for each search agent Return =1
Update a, A, C, l, and p
if1 (p<0.5) Total time = c1(2n+1) + c2.6n + c3.n + c4.1
if2 (|A| < 1)
Update the position of the current search agent by the Eq.(2)
else if2 (|A|≥ 1)
Select a random search agent(Xrand) g(n) = c n
Update the position of the current search agent by the Eq.(8)
end if2
else if1 (p≥0.5)
Update the position of the current search by the Eq.(5)
end if1
end for
Check if any search agent goes beyond the search space and amend it
Calculate the fitness of each search agent
Update X* if there is a better solution
t=t+1
end while
return X*
f(n) = c1(2n + 1) + c2(6n) + C3.n + c4.1

Answer: O(n)
Why? Because when g(n) = n and
for some c (say c=10000), n0
We satisfy that f(n) ≤ c.g(n), for n ≥ n0. So, O(n)
References
• Levitin, A. (2007). Introduction to the design and analysis of algorithm, 3rd Edition.
Pearson.
• S. Mirjalili, A. Lewis, The Whale Optimization Algorithm. Advances in Engineering
Software, 95, (2016) pp.51–67.

You might also like