1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)
-
date post
21-Dec-2015 -
Category
Documents
-
view
213 -
download
1
Transcript of 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)
![Page 1: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/1.jpg)
1
COMP8620 Lecture 5-6
Neighbourhood Methods, and Local Search
(with special emphasis on TSP)
![Page 2: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/2.jpg)
2
Assignment
http://users.rsise.anu.edu.au/~pjk/teaching
• “Project 1”
![Page 3: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/3.jpg)
3
Neighbourhood
• For each solution S S, N(S) S is a neighbourhood
• In some sense each T N(S) is in some sense “close” to S
• Defined in terms of some operation
• Very like the “action” in search
![Page 4: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/4.jpg)
4
Neighbourhood
Exchange neighbourhood:Exchange k things in a sequence or partition
Examples:
• Knapsack problem: exchange k1 things inside the bag with k2 not in. (for ki, k2 = {0, 1, 2, 3})
• Matching problem: exchange one marriage for another
![Page 5: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/5.jpg)
5
2-opt Exchange
![Page 6: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/6.jpg)
6
2-opt Exchange
![Page 7: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/7.jpg)
7
2-opt Exchange
![Page 8: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/8.jpg)
8
2-opt Exchange
![Page 9: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/9.jpg)
9
2-opt Exchange
![Page 10: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/10.jpg)
10
2-opt Exchange
![Page 11: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/11.jpg)
11
3-opt exchange
• Select three arcs
• Replace with three others
• 2 orientations possible
![Page 12: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/12.jpg)
12
3-opt exchange
![Page 13: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/13.jpg)
13
3-opt exchange
![Page 14: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/14.jpg)
14
3-opt exchange
![Page 15: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/15.jpg)
15
3-opt exchange
![Page 16: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/16.jpg)
16
3-opt exchange
![Page 17: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/17.jpg)
17
3-opt exchange
![Page 18: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/18.jpg)
18
3-opt exchange
![Page 19: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/19.jpg)
19
3-opt exchange
![Page 20: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/20.jpg)
20
3-opt exchange
![Page 21: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/21.jpg)
21
3-opt exchange
![Page 22: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/22.jpg)
22
3-opt exchange
![Page 23: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/23.jpg)
23
Neighbourhood
Strongly connected:
• Any solution can be reached from any other(e.g. 2-opt)
Weakly optimally connected
• The optimum can be reached from any starting solution
![Page 24: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/24.jpg)
24
Neighbourhood
• Hard constraints create solution impenetrable mountain ranges
• Soft constraints allow passes through the mountains
• E.g. Map Colouring (k-colouring)– Colour a map (graph) so that no two adjacent
countries (nodes) are the same colour– Use at most k colours– Minimize number of colours
![Page 25: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/25.jpg)
25
Map Colouring
Starting sol Two optimal solutionsDefine neighbourhood as:
Change the colour of at most one vertex
?Make k-colour constraint soft…
![Page 26: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/26.jpg)
26
Iterative Improvement
1. Find initial (incumbent) solution S
2. Find T N(S) which minimises objective
3. If z(T) ≥ z(S)Stop
ElseS = TGoto 2
![Page 27: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/27.jpg)
27
Iterative Improvement
• Best First (a.k.a Greedy Hill-climbing, Discrete Gradient Ascent)– Requires entire neighbourhood to be
evaluated– Often uses randomness to split ties
• First Found– Randomise neighbourhood exploration– Implement first improving change
![Page 28: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/28.jpg)
28
Local Minimum
• Iterative improvement will stop at a local minimum
• Local minimum is not necessarily a global minimum
How do you escape a local minimum?
![Page 29: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/29.jpg)
29
Restart
• Find initial solution using (random) procedure
• Perform Iterative Improvement
• Repeat, saving best
• Remarkably effective• Used in conjunction with many
other meta-heuristics
![Page 30: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/30.jpg)
30
• Results from SAT
![Page 31: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/31.jpg)
31
Variable Depth Search
• Make a series of moves
• Not all moves are cost-decreasing
• Ensure that a move does not reverse previous move
• Very successful VDS: Lin-Kernighan algorithm for TSP (1973)(Originally proposed for Graph Partitioning Problem (1970))
![Page 32: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/32.jpg)
32
Lin-Kernighan (1973) – -path
u v
u v
w
u v
w v’
u v
w v’w’
![Page 33: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/33.jpg)
33
Lin-Kernighan (1973)
• Essentially a series of 2-opt style moves
• Find best -path• Partially implement the path• Repeat until no more paths can be
constructed• If arc has been added (deleted) it cannot
be deleted (added)• Implement best if cost is less than original
![Page 34: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/34.jpg)
34
Dynasearch
• Requires all changes to be independent• Requires objective change to be
cummulative
• e.g. A set of 2-opt changes were no two swaps touched the same section of tour
• Finds best combination of exchanges– Exponential in worst case
![Page 35: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/35.jpg)
35
Variable Neighbourhood Search
• Large Neighbourhoods are expensive
• Small neighbourhoods are less effective
Only search larger neighbourhood when smaller is exhausted
![Page 36: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/36.jpg)
36
Variable Neighbourhood Search
• m Neighbourhoods Ni
• |N1| < |N2| < |N3| < … < |Nm|
1. Find initial sol S ; best = z (S)2. k = 1; 3. Search Nk(S) to find best sol T4. If z(T) < z(S)
S = Tk = 1
elsek = k+1
![Page 37: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/37.jpg)
37
Large Neighbourhood Search
• Partial restart heuristic
1. Create initial solution
2. Remove a part of the solution
3. Complete the solution as per step 1
4. Repeat, saving best
![Page 38: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/38.jpg)
38
LNS – Construct
![Page 39: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/39.jpg)
39
LNS – Construct
![Page 40: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/40.jpg)
40
LNS – Construct
![Page 41: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/41.jpg)
41
LNS – Construct
![Page 42: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/42.jpg)
42
LNS – Construct
![Page 43: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/43.jpg)
43
LNS – Construct
![Page 44: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/44.jpg)
44
LNS – Construct
![Page 45: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/45.jpg)
45
LNS – Construct
![Page 46: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/46.jpg)
46
LNS – Construct
![Page 47: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/47.jpg)
47
LNS – Construct
![Page 48: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/48.jpg)
48
LNS – Construct
![Page 49: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/49.jpg)
49
LNS – Destroy
![Page 50: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/50.jpg)
50
LNS – Destroy
![Page 51: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/51.jpg)
51
LNS – Destroy
![Page 52: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/52.jpg)
52
LNS – Destroy
![Page 53: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/53.jpg)
53
LNS – Construct
![Page 54: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/54.jpg)
54
LNS – Construct
![Page 55: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/55.jpg)
55
LNS
• The magic is choosing which part of the solution to destroy
• Different problems (and different instances) need different heuristic
![Page 56: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/56.jpg)
56
Speeding Up 2/3-opt
• For each node, store k nearest neighbours
• Only link nodes if they appear on list
• k = 20 does not hurt performance much
• k = 40 0.2% better
• k = 80 was worse
• FD-trees to help initialise
![Page 57: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/57.jpg)
57
Advanced Stochastic Local Search
• Simulated Annealing
• Tabu Search
• Genetic algorithms
• Ant Colony optimization
![Page 58: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/58.jpg)
58
Simulated Annealing
• Kirkpatrick, Gelatt & Vecchi [1983]
• Always accept improvement in obj• Sometimes accept increase in obj
P(accept increase of Δ) = e Δ/T
• T is temperature of system• Update T according to “cooling schedule”• (T = 0) == Greedy Iterative Improvement
![Page 59: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/59.jpg)
59
Simulated Annealing
• Nice theoretical result:
As number of iters ∞, probability of finding the optimal solution 1
• Experimental confirmation: On many problem, long runs yield good results
• Weak optimal connection required
![Page 60: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/60.jpg)
60
Simulated Annealing
1. Generate initial S
2. Generate random T N(S)
3. Δ = z (T) – z (S)
4. if Δ < 0
S = T ; goto 2
5. if rand() < e Δ/T
S = T ; goto 2
![Page 61: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/61.jpg)
61
Simulated Annealing
Initial T• Set equal to max [acceptable] Δ
Updating T
• Geometric update: Tk+1 = Tk
usually in [0.9, 0.999]
Don’t want too many changes at one temperature (too hot):
If (numChangesThisT > maxChangesThisT)
updateT()
![Page 62: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/62.jpg)
62
Simulated AnnealingUpdating T• Many other update schemes• Sophisticated ones look at mean, std-dev of Δ
Re-boil (== Restart)• Re-initialise T
0-cost changes• Handle randomly
Adaptive parameters• If you keep falling into the same local minimum,
maxChangesThisT *= 2, orinitialT *= 2
![Page 63: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/63.jpg)
63
Tabu Search
• Glover [1986]
• Some similarities with VDS
• Allow cost-increasing moves
• Selects best move in neighbourhood
• Ensure that solutions don’t cycle by making return to previous solution “tabu”
• Effectively a modified neighbourhood
• Maintains more memory than just best sol
![Page 64: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/64.jpg)
64
Tabu Search
Theoretical result (also applies to SA):
• As k ∞ P(find yourself at an optimal sol) gets larger relative to other solutions
![Page 65: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/65.jpg)
65
Tabu Search
Basic Tabu Search:
1. Generate initial solution S, S* = S
2. Find best T N(S)
3. If z(T) ≥ z(S)
Add T to tabu list
4 S = T
5 if z(S) < z(S*) then S* = S
6 if stopping condition not met, goto 2
![Page 66: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/66.jpg)
66
Tabu Search
Tabu List:
• List of solutions cannot be revisited
Tabu Tenure
• The length of time a solution remains tabu
• = length of tabu list
• Tabu tenure t ensures no cycle of length t
![Page 67: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/67.jpg)
67
Tabu Search
Difficult/expensive to store whole solution• Instead, store the “move” (delta between S
and T) • Make inverse move tabu
– e.g. 2-opt adds 2 new arcs to solution– Make deletion of both(?) tabu
But• Cycle of length t now possible• Some non-repeated states tabu
![Page 68: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/68.jpg)
68
Tabu Search
Tabu List:• List of moves that cannot be undone
Tabu Tenure• The length of time a move remains tabu
Stopping criteria• No improvement for <param> iterations• Others…
![Page 69: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/69.jpg)
69
Tabu Search
• Diversification– Make sure whole solution space is sampled– Don’t get trapped in small area
• Intensification– Search attractive areas well
• Aspiration Criteria– Ignore Tabu restrictions if very attractive (and
can’t cycle)– e.g.: z(T) < best
![Page 70: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/70.jpg)
70
Tabu Search
• Diversification– Penalise solutions near observed local minima– Penalise solution features that appear often– Penalties can “fill the hole” near a local min
• Intensification– Reward solutions near observed local minima– Reward solution features that appear often
• Use z'(S) = z(S) + penalties
![Page 71: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/71.jpg)
71
Tabu Search – TSP
• TSP Diversification– Penalise (pred,succ) pairs seen in local
minima
• TSP Intensification– Reward (pred,succ) pairs seen in local minima
• z'(S) = z(S) + Σij wijcount(i,j)– count(i,j): how many times have we seen (i,j)– wij: weight depending on diversify/intensify
cycle
![Page 72: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/72.jpg)
72
Adaptive Tabu Search
• If t (tenure) to small, we will return to the same local min
• Adaptively modify t– If we see the same local min, increase t– When we see evidence that local min
escaped (e.g. improved sol), lower t
• … my current favourite
![Page 73: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/73.jpg)
73
Tabu Search
1. Generate initial solution S ; S* = S
2. Generate V* N(S)– Not tabu, or meets aspiration
criterea
3. Find T V* which minimises z'
4. S = T5. if z(S) < z(S*) then S* = S6. Update tabu list, aspiration criterea, t7. if stopping condition not met, goto 2
![Page 74: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/74.jpg)
74
Path Relinking
Basic idea:• Given 2 good solutions, perhaps a better solution lies
somewhere in-between• Try to combine “good features” from two solutions• Gradually convert one solution to the other
![Page 75: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/75.jpg)
75
Path Re-linking
TSP: 1 2 3 4 5 6
1 2 3 5 6 4
1 3 2 5 6 4
1 3 5 2 6 4
1 3 5 6 4 21 3 5 6 4 2
![Page 76: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/76.jpg)
76
Genetic Algorithms
• Simulated Annealing and Tabu Search have a single “incumbent” solution(plus best-found)
• Genetic Algorithms are “population-based” heuristics – solution population maintained
![Page 77: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/77.jpg)
77
Genetic Algorithms
• Problems are solved by an evolutionary process resulting in a best (fittest) solution (survivor).
• Evolutionary Computing – 1960s by I. Rechenberg
• Genetic Algorithms– Invented by John Holland 1975– Made popular by John Koza 1992
• Nature solves some pretty tough questions – let’s use the same method
…begs the question… if homo sapien isthe answer, what was the question??
![Page 78: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/78.jpg)
78
Genetic Algorithms
Vocabulary• Gene – An encoding of a single part of the
solution space (often binary)• Genotype – Coding of a solution• Phenotype – The corresponding solution• Chromosome – A string of “Genes” that
represents an individual – i.e. a solution.• Population - The number of
“Chromosomes” available to test
![Page 79: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/79.jpg)
79
VocabularyGenotype: coded solutionsPhenotype: actual solutions
Measure fitness
1001110 10000010011110 0010101 1111111
Search space Solution space
Note: in some evolutionary algorithms there is no clear distinction between genotype and phenotype
Genotypes Phenotypes
78
64
30
21
127
![Page 80: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/80.jpg)
80
Vocabulary
Biology Computation
Chromosome or individual
Bitstring that represents a candidate solution
Gene A single bit (or a block of bits, in some cases)
Crossover Random exchange of genetic material between chromosomes
Mutation Random change of a certain bit in a chromosome
Genotype Bit configuration of a chromosome
Phenotype Solution decoded from a chromosome
![Page 81: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/81.jpg)
81
Crossover
![Page 82: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/82.jpg)
82
Mutation
• Alter each gene independently with a prob pm
(mutation rate)
• 1/pop_size < pm < 1/ chromosome_length
![Page 83: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/83.jpg)
83
Reproduction
• Chromosomes are selected to crossover and produce offspring
• Obey the law of Darwin: Best survive and create offspring.
• Roulette-wheel selection• Tournament Selection• Rank selection• Steady state selection
![Page 84: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/84.jpg)
84
Roulette Wheel Selection
Fitness
Chr. 1 3
Chr. 2 1
Chr. 3 2
P(select) Chr. 1Chr. 2Chr. 3
Main idea: better individuals get higher chance– Chances proportional to fitness– Assign to each individual a part of the roulette wheel– Spin the wheel n times to select n individuals
![Page 85: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/85.jpg)
85
Tournament Selection
• Tournament competition among N individuals (N=2) are held at random.
• The highest fitness value is the winner.
• Tournament is repeated until the mating pool for generating new offspring is filled.
![Page 86: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/86.jpg)
86
Rank Selection
• Roulette-wheel has problem when the fitness value differ greatly
• In rank selection the – worst value has fitness 1, – the next 2,......,– best has fitness N.
![Page 87: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/87.jpg)
87
Rank Selection vs Roulette
P(accept) P(accept)2%
5%8%
10%
75%
Roulette Wheel Rank
7%13%
20%
27%
33%
![Page 88: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/88.jpg)
88
Crossover
• Single –site crossover
• Multi-point crossover
• Uniform crossover
![Page 89: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/89.jpg)
89
Single-site
• Choose a random point on the two parents
• Split parents at this crossover point
• Create children by exchanging tails
• Pc typically in range (0.6, 0.9)
![Page 90: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/90.jpg)
90
n-point crossover
• Choose n random crossover points• Split along those points• Glue parts, alternating between parents• Generalisation of 1 point (still some positional
bias)
![Page 91: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/91.jpg)
91
Uniform crossover
• Assign 'heads' to one parent, 'tails' to the other• Flip a coin for each gene of the first child• Make an inverse copy for the second child• Inheritance is independent of position
![Page 92: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/92.jpg)
92
Genetic Algorithm
![Page 93: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/93.jpg)
93
Memetic Algorithm
• Memetic Algorithm = Genetic Algorithm +Local Search
• E.g.: – LS after mutation– LS after crossover
![Page 94: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/94.jpg)
94
Demo
• http://www.rennard.org/alife/english/gavintrgb.html
![Page 95: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/95.jpg)
95
Ant Colony Optimization
• Another “Biological Analogue”
• Observation: Ants are very simple creatures, but can achieve complex behaviours
• Use pheromones to communicate
![Page 96: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/96.jpg)
96
Ant Colony Optimization
• Ant leaves a pheromone trail
• Trails influence subsequent ants
• Trails evaporate over time
• E.g. in TSP– Shorter Tours leave more pheromone– Evaporation helps avoid premature
intensification
![Page 97: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/97.jpg)
97
ACO for TSP
• pk(i,j) is prob. moving from i to j at iter k
, parameters
otherwise0
),( if][][
][][
),( ,,
,,i
Nhhi
khi
jik
ji
k
Njic
c
jipi
![Page 98: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/98.jpg)
98
ACO for TSP
• Pheromone trail evaporates at rate
• Phermone added proportional to tour quality
ijkk tijij
)(1
otherwise 0
tour ),(if ,
jiL
Q
kk
ji
![Page 99: 1 COMP8620 Lecture 5-6 Neighbourhood Methods, and Local Search (with special emphasis on TSP)](https://reader030.fdocuments.in/reader030/viewer/2022032521/56649d575503460f94a3526d/html5/thumbnails/99.jpg)
99
References
• Emile Aarts and Jan Karel Lenstra (Eds), Local Search in Combinatorial Optimisation Princeton University Press, Princeton NJ, 2003
• Holger H. Hoos and Thomas Stützle, Stochastic Local Search, Foundations and Applications, Elsevier, 2005