Gradient Based Methods

Gradient based methods search for the ideal solution using the gradient of the Objective Function. A gradient is a vector function composed of partial derivatives measuring the change of some function with respect to each component. Effectively, a gradient is a derivative of a multi-variable function - it indicates the magnitude and direction of greatest change in a multi-variable function.

A gradient of a single variable function is simply the derivative of that function. While most problems requiring complex optimization techniques have many variables, it is easiest to think about a single-variable function, such as elevation related only to distance along some horizontal line:

A graph that has Horizontal Distance on the x axis and Elevation in feet on the y axis. This graph has two functions that represent the slope and elevation of a mountain

Figure 1: One of many possible elevation profiles of a mountain peak. The slope can be calculated at any point.

The gradient of a mountain's elevation will indicate the magnitude and direction of the elevation change at any given latitude and longitude. In other words, given a specific point, the gradient will tell you how steep the slope is at that point, and which direction it is steepest in. This is very useful for finding the top of the mountain - without being able to see anything but the local value of the gradient, you can make an estimate that the peak is probably in the direction of the slope, and that if the slope is very steep you likely have a long ways to go.

If the entire elevation profile was known ahead of time, finding the peak is trivial. Unfortunately, we do not normally know the entire profile, but instead can only determine its value where we explicitly test it. Stated generally, the shape and behavior of an Objective Function is not known ahead of time.

Rather than testing every single horizontal point to find the highest elevation by brute force, we can an employ an intelligent gradient based search method. Starting at a horizontal distance of zero, we can measure an elevation and slope:

A graph that shows one point each for elevation and slope. An arrow extends to the right from the y axis.

Figure 2: Starting a gradient based search

With the positive slope from our initial condition, we can make an educated guess that the peak is somewhere in the positive direction. We determine where we want to guess and measure our system again at that point:

A graph shows 2 points each for elevation and slope. An arrow extends to the right from the x value of the second set of elevation and slope values.

Figure 3: Iteration number 2

Because our slope is higher, we assume that the peak is farther away and adjust our change in distance accordingly. Our new guess has a negative slope, so we will reverse our search direction.

A graph shows 3 points each for elevation and slope. An arrow extends to the left from the x value of the third set of elevation and slope values.

Figure 4: Iteration number 3

We changed sign on slope again, so we reverse direction again. We can use information from previous guesses to narrow down the search range and make a more intelligent guess.

A graph shows 4 points each for elevation and slope. An arrow extends to the right from the x value of the third set of elevation and slope values.

Figure 5: Iteration number 4

As we continue, the adjustments to our guess get smaller and smaller. Once they are small enough, we can consider the search converged, and the peak found.

A graph shows 5 points each for elevation and slope. An arrow extends to the left from the x value of the fourth set of elevation and slope values.

Figure 6: Iteration number 5

In only a few iterations, we have found an excellent approximation of the highest point, without knowing anything about the elevation or slope outside of our selected guess points.

The search algorithms included in ANS are much more sophisticated than the simple example presented here, but the idea remains the same. Furthermore, the allowable selections are restricted by Design Requirements, which impacts the ideal search direction.