OPTIMIZATION Flashcards
choosing the best option from a set of possible options
Optimization
a search algorithm that maintains a single node and searches by moving to a neighboring node.
local search
a function that we use to maximize the value of the solution.
objective function
a function that we use to minimize the cost of the solution
cost function
the state that is currently being considered by the function
current state
a state that the current state can transition to
neighbor state
one type of a local search algorithm
hill climbing
In this algorithm, the neighbor states are compared to the current state, and if any of them is better, we change the current node from the current state to that neighbor state.
hill climbing
hill climbing pseudocode
function Hill-Climb(problem):
current = initial state of problem
repeat:
neighbor = best valued neighbor of current
if neighbor not better than current:
return current
current = neighbor
a state that has a higher value than its neighboring states
local maximum (plural: maxima)
a state that has the highest value of all states in the state-space.
global maximum
a state that has a lower value than its neighboring states.
local minimum (plural: minima)
a state that has the lowest value of all states in the state-space.
global minimum
problem with hill climbing
they may end up in local minima and maxima
multiple states of equal value are adjacent, forming a plateau whose neighbors have a worse value
flat local maximum/minimum
where multiple states of equal value are adjacent and the neighbors of the plateau can be both better and worse
shoulder
hill climbing variants
Steepest-ascent
Stochastic
First-choice
Random-restart
Local Beam Search
choose the highest-valued neighbor
Steepest-ascent
choose randomly from higher-valued neighbors
stochastic
choose the first higher-valued neighbor
First-choice
conduct hill climbing multiple times
random-restart
chooses the k highest-valued neighbors
local beam search
allows the algorithm to “dislodge” itself if it gets stuck in a local maximum.
Simulated annealing
simulated annealing algorithm
starts with a high temperature, being more likely to make random decisions, and, as the temperature decreases, it becomes less likely to make random decisions, becoming more “firm.” This mechanism allows the algorithm to change its state to a neighbor that’s worse than the current state, which is how it can escape from local maxima.