Design & Analysis of Algorithms Combinatory optimization SCHOOL OF COMPUTING Pasi Fränti
Local search Stochastic variations of local search Genetic algorithms Swarm Intelligence Optimization techniques
Here decision tree picture!!! Optimization techniques in context
Local search
Select one and move Main principle of local search
Structure of local search
Representation of solution Neighborhood function Search strategy Components of local search
Study neighbor solutions Movement in neighborhood
Accept only better solutions Hill climbing
Local and global maxima
Combining local search and hill-climbing
Represent solution as bit string (x 1 x 2,…x n ), where x i {0,1}. Problem instance: w i = (2,3,5,7,11), S=15. Solution with elements 2,3 and 7 is represented as Local search for knapsack
Single bit change: 0 1 or 1 0 S=15 W=[2, 3, 5, 7, 11] Move in knapsack
Two operations: 0 1 or 1 0 Swap bit location Extended neighborhood S=15 W=[2, 3, 5, 7, 11] 10011
Getting stuck into local maximum S=15 W=[2, 3, 5, 7, 11]
Prevents search to return previously visited solutions Select the next best Tabu! S=15 W=[2, 3, 5, 7, 11] Tabu search
Tabu search (2 nd iteration) S=15 W=[2, 3, 5, 7, 11]
Traveling salesman problem... p i-1 p i p i+1 p i-1 p i+1 p i p i p i-1 p i+1 p i p i+1 p i-1 p i+1 p i p i-1 p i+1 p i-1 p i ... Permute local changes in given route
Local search algorithm for TSP
TSP example E F G H A4 + = 2 + 6 E F H G A = 11 min! E G F H A + = 3 + 3 E G H F A = 2 + 5 E H G F A + = 2 + 5 E H F G A + 2= 1 + 6
Genetic algorithm
Genetic algorithm (GA) Needs more material!
Generate a set of initial solutions. REPEAT Generate new solutions by crossover. Mutate the new solutions (optional). Evaluate the candidate solutions. Retain best candidates and delete the rest. UNTIL stopping criterion met. Main structure of GA
Permuting pairs for crossover Elitist approach using zigzag scanning among the best solutions
Optimizing chess playing Revise
Tic-tac-toe example
Evaluation function for tic-tac-toe
Minmax example Redraw
Minmax playing: Min’s move
Minimax maximizes the worst-case outcome for max Minmax playing: Max’s move
Chess Game tree
Beyond the horizon
Evaluating Chess position
Positional factors
Initial value range
Result of optimization
Swarm intelligence
Social intelligence: individual behavior maybe naive but joint effect can be intelligent. Decentralized: no central control of the individuals of the colony Self-organized: individual adapts to environment and other members of colony Robust: Task is completed even if some individuals fail Swarm intelligence (SI)
Ant colony optimization (ACO) Main principle: Emitting pheromone between nest and food Joint efforts to carry loads Solving TSP by ants: Sending ants to make randomized tours Short links chosen more often than long ones Good tracks are marked by pheromone Tracks with high pheromone chosen more often
Ant colony optimization Initialization: Generate randomized tours. Smaller links chosen more often than longer ones Simulate pheromone: Subtract cost of the links in best solution (-1) Increase the ones in the worst solution (+1) Tours are evaluated using the original graph.
Ant colony optimization (1 st round)
Ant colony optimization (2 nd round)