Lecture 12 - Stochastic Optimisation Part 2 Flashcards
What is Hill Climbing?
Hill Climbing is a local search algorithm used in optimisation and artificial intelligence. It is designed to find better solutions by iteratively modifying a current candidate solution and moving to a new one only if it improves the objective function (e.g., fitness, score, cost, etc.).
What are the avantages/disadvantages of Hill Climbing?
Advantages of Hill Climbing
* Simple and intuitive.
* Efficient for well-behaved landscapes with smooth, single-peak optima.
* Doesn’t require gradient info → suitable for black box optimisation.
Limitations
* Local optimum trap: It only accepts improvements — may get stuck in a local maximum and never find the global one.
* No mechanism to backtrack or explore distant areas unless randomness is used more aggressively (e.g., simulated annealing or restarts).
Basic Hill Climbing Algorithm
REFER TO SLIDES
What are the Trade-Off’s of the Basic Hill Climbing Algorithm
- The Trade-Off It Mentions:
○ More samples (n) = better approximation of the steepest direction.
○ But also = higher computational cost.
○ So there’s a balance between exploration quality and resource usage.- This is a fundamental concern in metaheuristics and optimisation design.
What is Steepest Ascent Hill Climbing?
Steepest Ascent Hill Climbing is a local search algorithm that improves on basic Hill Climbing by generating multiple tweaked versions of the current solution, evaluating all of them, and picking the best one — the one that represents the “steepest uphill” move.
What is the difference between Hill Climbing and Steepest Ascent Hill Climbing?
Hill Climbing:
Tweaks once per iteration
Accepts first better solution
more oppotunistic
May miss steepest ascent
=====
Steepest Ascent Hill Climbing:
Tweaks n times per iteration
Picks the best of all tweaked iteration
More informed and selective
Aims to approximate steepest ascent without using gradients
Steepest Ascent Hill Climbing Algorithm - Algorithm 5 and Steepest Ascent Hill Climbing Algorithm with Replacement - Algorithm 6
REFER TO SLIDES
What is the Nomenclature of Three Different Hill Climbing models
Model 1 - Basic Hill Climbing : uses a 1+1 algorithm
Model 2 - Steepest Ascent Hill Climbing : uses a 1 + n algorithm
Model 3 - Steepest Ascent Hill Climbing with Replacement: uses a (1, n) algorithm
What is Model 1 - Basic Hill Climbing : uses a 1+1 algorithm
Starts with one existing solution and generate 1 new candidate solution by tweaking, then compare the two and pick the better one
What is Model 2 - Steepest Ascent Hill Climbing : uses a 1 + n algorithm
Start with one exisitng, generate n solutions by tweaking multiple times
Then select the best among the n candidates + the exisiting
What is Model 3 - Steepest Ascent Hill Climbing with Replacement: uses a (1, n) algorithm
Start with one existing, generate n new solutions but do not include the exisiting, you only select among the n values
What is a Parameterised Model?
A model whose behavior is controlled by a set of parameters
REFER TO NOTES FOR DIAGRAM AND ITS EXPLANATION
Why do we use Real-Valued Parameters?
Why Use Real-Valued Parameters?
- “Numerical parameters are nice to work with.”
This is because real numbers allow for:
* Smooth and continuous modifications (e.g., adding small amounts of noise).
* Use of mathematical operations for tweaking (e.g., v_i ← v_i + noise).
* Easy application of probabilistic tweaks (e.g., Gaussian or uniform random noise).
How does Tweaking work with Parameterised models?
- You can tweak a solution by adding a small random number to one or more parameters.
- This is useful in black box settings where:
- You can’t compute derivatives (gradients),
- But you can still explore the search space by making small adjustments to parameters.
- This is useful in black box settings where:
What is a Hyperparameter?
a parameter whose value is set before the learning process begins, influencing how the model is trained and its overall performance
Why are Hyperparameters important?
Hyper-parameters determine:
* How well the algorithm works.
* How fast it converges.
* Whether it works at all.
=====
They can be thought of as tuning knobs you use to adjust the algorithm’s behaviour depending on:
* The problem domain.
* The shape of the solution space.
The available computational resources.
How are Hyperparameters used in Hill Climbing?
Depends on the size of n:
Small n:
- Fast and fewer evaluations
- May miss best direction
- Lower computation cost
===
Large n:
- Slower, more evaluations
- Better guess fo best direction
- Higher computation cost
What is Initialisation?
Before your algorithm can start tweaking and improving solutions, it needs a starting point.
* This could be:
○ A random vector (common in black-box and stochastic settings).
○ A heuristic-based guess.
○ A hand-crafted initial solution (if you have domain knowledge).
How is Initialisation used in Hill Climbing?
to Initialise a candidate solution
Algorithm 7 - generate a random real number and what does it do
REFER TO NOTES FOR CODE
This algorithm produces a vector v⃗ = [v₁, v₂, …, vₗ] where each element is:
* Chosen randomly between min and max, using a uniform distribution.
Why it matters:
* It gives you a diverse starting point.
* If done well, it helps the search begin in a good region of the solution space.
Random initialisation ensures exploration from different regions if restarts are used.
Algorithm 8 - Bounded Uniform Convolution
REFER TO NOTES FOR CODE
What it does:
* Iterates through each element of a vector.
* With probability p, adds small uniform noise from range [-r, r] to that element.
* Makes sure the new value stays within min and max bounds.
Why it matters:
* Controls the aggressiveness of your tweaks.
* Ensures solutions stay valid (within bounds).
* Introduces stochastic variation without being too disruptive.
What is Exploitation?
Focuses on local improvement
Fine tunes existing good solutions
Helps converge to a nearby/local optimum
What is Exploration?
Searches for new, potentially areas
Jumps to new regions of the search space
Helps discover the global optimum
How is Exploitation and Exploration controlled?
Parameters:
* p: Probability of tweaking each element of the vector.
* r: The half-range of the noise added (how big a tweak can be).
Together, they determine the step size of the algorithm — that is, how far each tweak moves in the solution space.
NOTE: r is especially important here because it directly affects how “aggressive” the movement is.
Typically using small or large step sizes