Heuristic Optimisation Flashcards
(86 cards)
Define:
representation of problem
Encodes the alternative solutions for further manipulation
Define:
objective of problem
The purpose to be achieved
Define:
evaluation function for a problem
Tells us how good soln is (given rep)
OR how good compared to another solution
Representation of SAT
String of binary variables of length n
Representation of TSP
Permutation of 1,…n
Representation of NLP
Real numbers in [0,10] with 7 digits?
Evaluation func of TSP
Sum of distances along route
Evaluation func of NLP
Value of obj function for solution
Give 4 things to consider when choosing evaluation function
- Soln that meets objective should also have best evaluation
- Soln fails to meet objective cannot be evaluated to be better than a soln that meets the objective
- Objective may suggest evaluation function (or not)
- Feasible reigion of search space must be considered
Define:
optimisation problem
global solution
Given a search space S with its feasible part F ss S, find x in F s.t.
eval(x) <=eval(y) for all y in F (minimisation)
Such x is called global solution.
Give 4 reasons for using heuristics
- Avoid combinatorial explosion
- Rarely need optimal soln, good approximations are usually sufficient
- Approximations may not be very good in worst case, but worst case is very rare
- Helps with understanding of problem
Define:
distance function on search space S along with some axioms it may satisfy
dist: S x S -> reals
- d(x,x)=0
- d(x,y)=d(y,x)
- d(x,z) <= d(x,y) + d(y,z)
Define:
neighbourhood for epsilon>0 for dist function d
N(x) = {y in S : dist(x,y)
Define:
Manhattan distance
which problem is this used on?
dist(x,y) = sum from i=1 to n of |x_i - y_i|
NLP
Define:
Hamming distance
which problem is this used on?
Number of bit positions with different truth assignments (between two bit strings)
SAT
Define:
neighbourhood as a mapping
m: S to 2^S
neighbourhood given by m(x)
Define:
2-swap mapping
which problem is this used on?
The 2-swap mapping generates for any potential soln x the set of potential solns obtained by swapping two cities in x
TSP
Define:
2-interchange mapping
which problem is this used on?
The 2-interchange mapping generates for any potential soln x the set of potential solns obtained by replacing two non-adjacent edges AB and CD with AC and BD
TSP
Define:
1-flip mapping
which problem is this used on?
The 1-flip mapping flips exactly on bit of a potential soln x (with the representation of x as a Boolean string w/string entries 0 or 1)
SAT
Define:
local optimum
x in F is a local optimum wrt neighbourhood N(x) if
eval(x) <= eval(y) for all y in N(x)
Give analogy for hill-climbing algorithm
Height: quality of nodes
Peaks: optimal solutions
Orientation: evaluating neighbouring positions
Define:
basic hill-climbing algorithm
- Evaluation intial pt x. If obj met, RETURN x. Else set x as CURRENT PT.
- Loop till soln found:
a) Generate all neighbours of x. Select best (or
randomly on of best) y
b) If x is at least as good as y, RETURN x.
Else set y as CURRENT PT.
Define:
iterative hill-climbing algo
Hill-climbing algo restarted a predefined number of times.
Give 5 properties of hill-climbing (all bad)
- can get stuck in local maxima (so backtrack)
- plateaus are a problem (when eval func is flat) - make big jumps
- no info about how far local opt found is from global opt
- soln depends on initial configuration
- finding upper bound for computational time generally not possible