Local Search
Local Search
Known
x optimum
x
x x
Heuristic x dv
x
optimum
x
x
GAME OF LIFE
Cellular automata (by J. H. Conway 1970)
Rules
Every cell is either Alive or Dead and has 8 neighbors
Alive cell
change to Dead if too lonely (<2) or too crowded (>3)
Dead cell
Change to Alive if having exactly three neighbors
2,3 ≠3
< 2 or > 3
A D
3
SIMULATION BY GAME OF LIFE
after
Compare
Judge ourselves through comparison with others (neighbors)
Looks, wealth, humor, intelligence…
Imitate
Imitate ONLY those neighbors who are superior to themselves
Few animals may imitate (humans/birds)
𝑝𝑔
APPLICATIONS OF SWARM INTELLIGENCE
Find optimal solutions
Optimizing parameters as meta method
e.g. PSO + ANN
Evolution for a group of particles
flock of birds, school of fishes, … (bees)
Simple rules for each particle
SIMULATED ANNEALING
f(x)
f’(x) > 0
x+dx x
SIMULATED ANNEALING (CONT’D)
人工智慧
dE ↑, P(accept) ↓ more difficult to escape
T↑, P(accept)↑ easier to escape
T = 0, P(accept) = 0
do not escape from local minimum any longer
Cooling schedule
reducing T from initial temperature
Tnew = Told – dT
Tnew = C·Told (0< C < 1)
SIMULATED ANNEALING (CONT’D)
Has been successfully used for placing VLSI
components, scheduling problems and other large
combinatorial problems where values need to be
人工智慧
assigned to a large number of variables to
maximize (or minimize) some function of those
variables.
Example: knapsack problem
Solutions representing whether the objects are
picked are selected randomly (e.g. (0, 1, 1, 0, 1, 0, 1,
0, 0, 1))
E(x) is the total value of the picked objects (It can
also be defined as some other measurement)
Use random test to make small changes for the
solutions
DISCUSSION ON SIMULATED ANNEALING
Compared with gradient descent (GD)
E(x) always decreases (dx = -eE’(x) → dE < 0)
Arrive at local optimum
GD allows ONLY x to have continuous & differentiable
variables since it needs to compute E’(x)
Simulated annealing allows the state to jump out of
the local optimum when dE > 0
Simulated annealing allows x to have discrete
variables
GENETIC ALGORITHMS
A method based on biological evolution.
Create chromosomes which represent possible
solutions to a problem.
A fitness value for each chromosome is
determined.
The best chromosomes in each generation are
bred with each other to produce a new
generation.
Reproduction is done by applying crossover over
two or more chromosomes
Mutation is applied so as to make random
changes to particular genes.
INTRODUCTION
Local Search
Find solutions in a extremely large search space
Making small changes to potential solutions to a
problem until an optimal solution is identified
GA is a form of local search
Based on evolution
Borrow terms from genetics
Chromosome, crossover, mutation, fitness
REPRESENTATION
Chromosome (染色體)
A string of bits
Each bit is known as a gene
Formulated as a solution to a problem
Population
A set of chromosomes
Creatures might have a number of chromosomes
GENETIC ALGORITHM
Cloning
asexual reproduction
single parent
p/1-p
MUTATION
GA is similar to Hill Climbing…
Generating possible solutions to a problem and moving
toward a better solution until no better solution can be
found
Does not perform well with problems with local optima
Mutation is introduced to avoid this.
Applicable to 10 queens
WHY GA WORKS?
Schema S (pattern of chromosomes)
**1011****, 010**1****, *****10*00
dL(S): defining length
Number of cutting positions between the highest bit
and the lowest bit for the pattern
3, 5, 4 respectively
O(S): order
Number of fixed bits for the pattern
4, 4, 4 respectively (for defined bits)
Shorter, low order schema whose fitness is higher
than the average fitness
→ has higher chance to survive!
SCHEMA THEOREM
Current
generation
S = 11010******************************
m(S) = 3 (occurring 3 times: C4, C5, C10)
f(C4) = 10, f(C5) = 22, f(C10) = 40 → f(S) = (10+22+40)/3 = 24 (average)
SCHEMA THEOREM – CONT’D
f ( S , i ) d L (S )
m( S , i + 1) 1 − pc (1 − pm ) m( S , i )
O(S )
a (i ) L( S ) − 1