Heuristic Optimisation Flashcards
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
What is the difference between exploitation and exploration in algortihms. Give an example of an extreme of each.
Exploitation uses the solns that you already have to find/make new solns.
Exploration searches the rest of the search space without using current soln.
Hill-climbing: exploitation
Random search: Exploration
Give four reasons why some problems are difficult to solve.
- Size of search space large
- Problem is v. complicated (&solns to simplified model useless)
- Eval func varies w/time, so set of solns required
- Heavy constraints (hard to construct feasible soln)
Define:
Boolean Satisfiability Problem (SAT)
Task is to make a compound statement of Boolean variables, i.e. a Boolean function
F:{0,1}^n -> {0,1}
evaluate to TRUE.
Size of search space for SAT on n>0 variables
2^n
Define:
Travelling Salesperson Problem
Travelling salesperson must visit every city in their territory exactly once and return to their hometown covering the lowest cost.
OR
Given cost of travel between all pairs of cities, the itinerary for the minimum cost is sought.
Define:
Symmetric TSP
Cost of getting from A to B is same as cost from B to A
Give:
Size of search space for symmetric TSP on n cities
n!/(2n)=(n-1)!/2
Define:
Nonlinear Programming Problem
Problem of maximising objective function subject to several constraint functions, such that at least one of these functions is not linear.
Give:
Size of search space for NLP on n variables each with 6 digit precision
10^(7n)
What are the two modelling approaches to solving a problem? Which do we use in HO?
What are advantages and disadvantages of each?
Simplify model and use traditional optimiser:
Problem -> Model approx -> Soln precise (Model approx)
Adv: can be solved exactly w/traditional optimisation methods
Disadv: soln of simplified model could be far from soln of original prob
Keep exact model and find near-opt soln (using non-trad optimiser):
Problem -> Model precise -> Soln approx (Model precise)
Adv: keeps original complexity of problem and solns are normally close to perfect soln
Disadv: soln sometimes far from global soln (rare)
^ Used in HO