Dig Deep or Search Wide: Finding the Optimal Solution with Newton’s Method and the Whale Optimisation Algorithm
There are countless ways to find an optimal solution, and in this post, we’ll explore two approaches: Newton’s Method and the Whale Optimisation Algorithm (WOA). Let’s start with Newton’s Method. By precisely calculating the slope and curvature at its current position, Newton’s Method moves rapidly toward a point where the slope is zero (a stationary point). Under the right conditions, it can find a minimum or maximum at remarkable speed. However, depending on the starting point, it may fail to converge altogether—and even when it does find an answer, there is no guarantee that it is the true global optimum. Let’s look closely at how Newton’s Method works and why these limitations are inevitable.
Newton's Method
In a multivariate setting, the update rule for Newton’s Method is given by:
$$\mathbf{x}_{k+1} = \mathbf{x}_k - H(\mathbf{x}_k)^{-1} \nabla f(\mathbf{x}_k)$$
Ideally, we want to find the point where the gradient is zero (\(\nabla f(\mathbf{x}) = \mathbf{0}\)), but for complex functions, solving this system of equations directly is rarely feasible. Instead, Newton’s Method iteratively approaches the solution from the current position \(\mathbf{x}_k\) through the following steps.
First, we take the first-order partial derivatives with respect to each variable to form the gradient (\(\nabla f\)) and compute the slope at the current point. Next, we differentiate those expressions a second time to construct the Hessian matrix (H), which captures the curvature. Finally, to head straight toward the point where the slope of the local quadratic approximation is zero, we multiply the gradient by the inverse Hessian (\(H^{-1}\))—adjusting both the direction and step size—to take one step to the next position (\(\mathbf{x}_{k+1}\)).
Looking at this process, the prerequisites for Newton’s Method become clear. First, the function must be twice differentiable. Second, the inverse of the Hessian matrix must exist. If a problem fails to meet these conditions, Newton’s Method cannot be used to find a solution. There is also one practical constraint: even when the inverse exists, if the number of variables grows large and computing the inverse is prohibitively expensive, the method becomes impractical to apply.
Beyond these constraints, because Newton’s Method relies strictly on local slope and curvature, it can only see the immediate surroundings of its current position. As a result, depending on the starting point, it may diverge or settle into a nearby local optimum—or even a saddle point—with no way of knowing whether a better solution exists elsewhere.
Whale Optimisation Algorithm
While Newton’s Method relies on derivatives to precisely zero in on a solution, the Whale Optimisation Algorithm—as its name suggests—is inspired by the hunting behaviour of humpback whales. At a high level, the concept is remarkably simple. A pod of whales searches widely across a given space, gradually tightening its circle around the best prey (candidate optimal solution) found so far.
There are two main reasons to use WOA. First, because it requires no derivatives, it can be widely applied even to non-differentiable or highly complex functions. Second, since multiple whales sweep across a broad area simultaneously, it is less likely to get trapped in local optima and is well-suited for identifying strong candidates for the global optimum.
At first glance, it may seem flawless, yet this algorithm has clear limitations of its own. Because numerous whales must repeatedly evaluate the function, the computational cost grows rapidly when each evaluation is expensive or the search space is vast, making it practically difficult to apply. Furthermore, since it relies on stochastic search, it cannot mathematically guarantee the exact optimal solution. If you’d like to dive into the detailed equations and mechanics behind the algorithm, check out the original paper below.
Comments
Join the discussionNo comments yet. Be the first to comment.
Learning
This series serves as my personal learning log. Here, I document fundamental concepts, hands-on experiences, and the insights I gain from my studies.