Extension to More Dimensions
So far, all of the paper bags were two-dimensional. Since the turtle moves along the bag edge, defined by a function like y=f(x), this is a one-dimensional optimization problem. You can extend hill climbing to paper bags of any shape in three, or more dimensions, thereby exploring higher dimensional optimization problems. Instead of a choice between left or right, you then have other additional directions to consider. You can also try gradient descent methods when you have more dimensions. Hill climbing steps in one direction along an axis. Gradient descent combines directions, to get something like north-east, by calculating the gradient and taking the steepest slope down or up. You need to do some mathematics to ...
Get Genetic Algorithms and Machine Learning for Programmers now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.