Scatter Search: Methodology and Applications Manuel Laguna University of Colorado Rafael Martí University of Valencia
Based on Scatter Search: Methodology and Implementations in C Laguna, M. and R. Martí Kluwer Academic Publishers, Boston, 2003. 2
Scatter Search Methodology
Metaheuristic A metaheuristic refers to a master strategy that guides and modifies other heuristics to produce solutions beyond those that are normally generated in a quest for local optimality. A metaheuristic is a procedure that has the ability to escape local optimality 4
Typical Search Trajectory 100 90 80 Objective Function 70 60 50 40 30 20 10 Value Best Value 0 1 4 7 10 13 16 19 22 25 28 31 34 37 40 Iteration 5
Metaheuristic Classification x/y/z Classification x = A (adaptive memory) or M (memoryless( memoryless) y = N (systematic neighborhood search) or S (random sampling) z = 1 (one current solution) or P (population of solutions) Some Classifications Tabu search (A/N/1) Genetic Algorithms (M/S/P) Scatter Search (M/N/P) 6
Scatter Search Diversification Generation Method Repeat until P = PSize P Improvement Method Improvement Method Reference Set Update Method Solution Combination Method Subset Generation Method Stop if no more new solutions RefSet 7
Scatter Search with Rebuilding Diversification Generation Method Repeat until P = PSize P Improvement Method Improvement Method Reference Set Update Method Solution Combination Method Stop if MaxIter reached Subset Generation Method Improvement Method No more new solutions RefSet Diversification Generation Method 8
Tutorial Unconstrained Nonlinear Optimization Problem Minimize 100 10.1 ( 2 ) 2 2 ( ) ( 2 1 90 ) 2 x x + x + x x + ( 1 x ) 2 ( ) ( ) ) 2 2 x 1 + x 1 + 19.8( x 1)( x 1) 2 1 4 1 4 2 3 4 3 2 + Subject to 10 x i 10 for i = 1, K,4 9
Diversification Generation Method Subrange 1 Subrange 2 Subrange 3 Subrange 4-10 -5 0 +5 +10 Probability of selecting a subrange is proportional to a frequency count 10
11 11 Diverse Solutions Diverse Solutions x 1 1.11-9.58 7.42 8.83-6.23 1.64 0.2-3.09-6.08-1.97 x 2 0.85-6.57-1.71-8.45 7.48 3.34-3.64 6.62 0.67 8.13 x 3 9.48-8.81 9.28 4.52 6-8.32-5.3-2.33-6.48-5.63 x 2-6.35-2.27 5.92 3.18 7.8-8.66-7.03-3.12 1.48 8.02 f(x) 835546.2 1542078.9 901878.0 775470.7 171450.5 546349.8 114023.8 7469.1 279099.9 54537.2 Solution 1 2 3 4 5 6 7 8 9 10
Improvement Method Solution x 1 x 2 x 3 x 2 f(x) 1 2.5 5.4 2.59 5.67 1002.7 2-0.52-0.5 0.35-0.14 138.5 3-2.6 5.9 4.23 10 7653.7 4 0.49 0.53 2.47 5.89 213.7 5-3.04 9.45 1.14 0.41 720.1 6-1.4 2.46 0.37-3.94 1646.7 7-0.36-0.31 0.8 1.14 57.1 8-1.63 2.51 0.73 0.56 21.5 9-0.8 0.69-1.16 1.5 11.2 10-2.47 5.32-2.92 8.15 1416.7 Nelder and Mead (1965) 12
Reference Set Update Method (Initial RefSet) b 1 high-quality solutions Objective function value to measure quality b 2 diverse solutions Max-min criterion and Euclidean distances to measure diversity RefSet of size b 13
Initial RefSet High-Quality Solutions Solution number in P x 1 x 2 x 3 x 4 f(x) 35-0.0444 0.0424 1.3577 1.8047 2.1 46 1.133 1.2739-0.6999 0.5087 3.5 34-0.0075 0.0438 1.4783 2.2693 3.5 49 1.1803 1.4606-0.344 0.2669 5.2 38 1.0323 0.9719-0.8251 0.695 5.3 Diverse Solutions Solution x 1 x 2 x 3 x 4 f(x) 37-3.4331 10 1.0756 0.3657 1104.1 30 3.8599 10-4.0468 10 9332.4 45-4.4942 10 3.0653 10 13706.1 83-0.2414-6.5307-0.9449-9.4168 17134.8 16 6.1626 10 0.1003 0.1103 78973.2 14
Subset Generation Method All pairs of reference solutions that include at least one new solution The method generates (b2-b)/2 b)/2 pairs from the initial RefSet 15
Combination Method y 10 9 x 3 = (9,7) r = 2/3 x 3 = x 1 - r(x 2 - x 1 ) x 4 = x 1 + r(x 2 - x 1 ) x 5 = x 2 + r(x 2 - x 1 ) 8 x 1 = (5,7) 7 6 5 4 x 4 = (6.5,5.5) r = 1/2 x 2 = (8,4) 3 2 x 5 = (11,1) r = 1 1 1 2 3 4 5 6 7 8 9 10 11 12 13 x 16
Alternative Combination Method y 10 9 8 x 3 x 1 = (5,7) x 3 = x 1 - r(x 2 - x 1 ) x 4 = x 1 + r(x 2 - x 1 ) x 5 = x 2 + r(x 2 - x 1 ) 7 6 5 4 x 4 x 2 = (8,4) 3 2 x 5 1 1 2 3 4 5 6 7 8 9 10 11 12 13 x 17
Reference Set Update Method Quality 1 2... Best 1 2... Best New trial solution b Worst b Worst RefSet of size b Updated RefSet 18
Static Update Pool of new trial solutions Quality 1 2... Best b Worst RefSet of size b Updated RefSet = Best b from RefSet Pool 19
RefSet after Update x 1 x 2 x 3 x 4 f(x) 1.1383 1.2965 0.8306 0.715 0.14 0.7016 0.5297 1.2078 1.4633 0.36 0.5269 0.287 1.2645 1.6077 0.59 1.1963 1.3968 0.6801 0.446 0.62 0.3326 0.1031 1.3632 1.8311 0.99 0.3368 0.1099 1.3818 1.9389 1.02 0.3127 0.0949 1.3512 1.8589 1.03 0.7592 0.523 1.3139 1.7195 1.18 0.2004 0.0344 1.4037 1.9438 1.24 1.3892 1.9305 0.1252-0.0152 1.45 20
Tutorial 0-11 Knapsack Problem Maximize 10x 1 + 14x 2 + 9x 3 + 8x 4 + 7x 5 + 5x 6 + 9x 7 + 3x 8 S.t. 7x 1 + 12x 2 + 8x 3 + 9x 4 + 8x 5 + 6x 6 + 11x 7 + 5x 8 < 100 x i = { 0, 1} for i = 1,, 8 21
Additional Strategies Reference Set Rebuilding Multi-tier tier Subset Generation Subsets of size > 2 Combination Method Variable number of solutions 22
Rebuilding RefSet Rebuilt RefSet b 1 b 2 Diversification Generation Method Reference Set Update Method 23
2-Tier RefSet Solution Combination Method Improvement Method Try here first RefSet b 1 If it fails, then try here b 2 24
3-Tier RefSet Solution Combination Method Improvement Method RefSet Try here first b 1 If it fails, then try here b 2 Try departing solution here b 3 25
Subset Generation Subset Type 1: all 2-element 2 subsets. Subset Type 2: 3-element subsets derived from the 2-element 2 subsets by augmenting each 2-element 2 subset to include the best solution not in this subset. Subset Type 3: 4-element subsets derived from the 3-element 3 subsets by augmenting each 3-element 3 subset to include the best solutions not in this subset. Subset Type 4: the subsets consisting of the best i elements, for i = 5 to b. 26
Subsets of Size > 2 90% 80% 70% 60% 50% 40% 30% 20% 10% 0% Random Type 1 Type 2 Type 3 Type 4 LOLIB 27
Variable Number of Solutions Quality 1 2... Best Generate 5 solutions Generate 3 solutions Generate 1 solution b Worst RefSet of size b 28
Hybrid Approaches Use of Memory Tabu Search mechanisms for intensification and diversification GRASP Constructions Combination Methods GA Operators Path Relinking 29
Multiobjective Scatter Search This is a fruitful research area Many multiobjective evolutionary approaches exist (Coello( Coello,, et al. 2002) SS can use similar techniques developed for MOEA (multiobjective( evolutionary approches) 30
Multiobjective EA Techniques Independent Sampling Search on f(x) = w i f i (x) Change weights and rerun Criterion Selection Divide reference set into k subsets Admission to i th subset is according to f i (x) 31
Scatter Search Applications and Implementations
Scatter Search Elements Diversification Generator Method Improvement Method Reference Set Initialization Update Rebuild Subset Generation Method Solution Combination Method Problem Independent 33
C Code Objective Illustrate the methods and strategies Use it in different applications Extend the previous version: http://www.uv.es/~rmarti/sscode.html Modularity Versatility Non experts (use as it is with small changes) Experts (can easily introduce important modifications) Ansi C (different platforms and systems) 34
Basic Design Diversification Generation Method Repeat until P = PSize P Improvement Method Improvement Method Reference Set Update Method Solution Combination Method Subset Generation Method Stop if no more new solutions RefSet 35
RefSet Data Structure typedef struct REFSET { int b; /* Size */ double **sol; double *ObjVal; /* Solutions */ /** Objective value of solutions */ int *order; /* Order of solutions */ int *iter; /* Entering iteration */ int NewSolutions; /* =1 if new element has been added */ } REFSET; RefSet b sol ObjVal order iter NewSolutions nvar 36
Main Function int main(void) { SS *pb* pb; /* Pointer to problem data */ int nvar = 10; /* Number of variables */ int b = 10; /* Size of reference set */ int PSize = 100; /* Size of P */ pb = SSProblem_Definition(nvar,b,PSize (nvar,b,psize); /* Insert here the Scatter Search code */ SSFree_DataStructures(pb (pb); return 0; } 37
Basic Design pb = SSProblem_Definition(nvar,b,PSize); SSCreate_P(pb (pb); SSCreate_RefSet(pb (pb); While(pb pb->rs->newsolutions) SSUpdate_RefSet(pb (pb); SSBestSol(pb,sol,&value); SSFree_DataStructures(pb); 38
Advanced Design pb = SSProblem_Definition(nvar,b,PSize); SSCreate_P(pb (pb); SSCreate_RefSet(pb (pb); for(iter=1; Iter<100 100; Iter++) { if(pb->rs rs->newsolutions) SSUpdate_RefSet(pb (pb); else SSRebuild_RefSet(pb (pb); } SSBestSol(pb,sol,&value); SSFree_DataStructures(pb); 39
SSCreate_P while(currentpsize <= pb->p >p->psize) { SSGenerate_Sol(pb,sol); obj_val = sol_value(sol); SSImprove_solution(pb,sol,&obj_val (pb,sol,&obj_val); /* Check whether sol is a new solution */ j=1;equal=0; while(j<currentpsize &&!equal) equal=ssequalsol SSEqualSol(sol,pb->p->sol[j++],pb->nvar); /* Add improved solution to P */ if(!equal){ for(j=1;j<=pb pb->nvar;j++) pb->p >p->sol[currentpsize][j]=sol[j]; ]=sol[j]; pb->p >p->objval[currentpsize++] = obj_val; } } 40
SSCreate_RefSet /* Order solutions in P */ p_order = SSOrder(pb (pb->p->objval, pb->p >p->psize, pb->opt); b1 = pb->rs rs->b / 2; /* Add the first (best)) b1 solutions in P to RefSet */ /* Compute minimum distances from P to RefSet */ for(i=1;i<=pb pb->p->psize;i++) min_dist[i]= SSDist_RefSet(pb,b1,pb (pb,b1,pb->p->sol[i]); >sol[i]); /* Add b-b1 b b1 diverse solutions to RefSet */ for(i=b1+1;i<=pb pb->rs->b;i++) { a=ssmax_dist_index(pb,min_dist SSMax_dist_index(pb,min_dist); /* Copy sol a from P to Refset */ SSUpdate_distances(pb,min_dist,i (pb,min_dist,i); } /* Compute the order in RefSet: order */ pb->rs rs->newsolutions = 1; pb->currentiter = 1; 41
SSUpdate_RefSet pb->rs rs->newsolutions=0; SSCombine_RefSet(pb); pb->currentiter CurrentIter++; for(a=1;a<=pb pb->pool_size;a++) { value=sol_value(pb sol_value(pb->pool[a]); SSImprove_solution(pb,pb->pool[a],&value); SSTryAdd_RefSet(pb,pb->pool[a],value); } pb->pool_size pool_size=0; 42
Advanced Designs Reference Set Update Dynamic / Static 2 Tier / 3 Tier Subset Generation Use of Memory Explicit Memory Attributive Memory Path Relinking 43
An Example The Linear Ordering Problem Given a matrix of weights E = {e ij } mxm, the LOP consists of finding a permutation p of the columns (and rows) in order to maximize the sum of the weights in the upper triangle Applications Maximize Triangulation for Input-Output Economic Tables. Aggregation of individual preferences Classifications in Sports C ( p)= e E m 1 i= 1 m j=+ i 1 p p i j
An Instance 1 2 3 4 3 4 1 2 1 2 3 4 0 12 5 3 4 0 2 6 8 3 0 9 11 4 2 0 3 4 1 2 0 9 8 3 2 0 11 4 5 3 0 12 2 3 4 0 p=(1,2,3,4) c E (p)=12+5+3+2+6+9=37 p*=(3,4,1,2) c E (p*)=9+8+3+11+4+12=47
SS for the LOP Complete the generic code Design specific methods for the problem- dependent elements Diversification Generator Method Improvement Method Combination Method 46
Diversification Generator Use of problem structure to create methods in order to achieve a good balance between quality and diversity. Quality Deterministic constructive method Diversity Random Generator Systematic Generators (Glover, 1998) GRASP constructions. The method randomly selects from a short list of the most attractive sectors. Use of Memory Modifying a measure of attractiveness proposed by Becker with a frequency-based memory measure that discourages sectors from occupying positions that they have frequently occupied 47
Diversity vs. Quality Compare several diversification generators Create a set of 100 solutions with each one 1.6 1.4 1.2 1.0 0.8 d = Standardized Diversity C = Standardized Quality C+ d 0.6 0.4 d 0.2 C 0.0 DG05 DG04 DG02 DG01 DG09 DG08 DG06 DG03 DG07 DG10 Procedure 48
Improvement Method INSERT_MOVE (pj( pj,, i) consist of deleting pj from its current position j to be inserted in position i Apply a first strategy scans the list of sectors in search for the first sector whose movement results in an improvement 0 12 5 3 1 8 3 6 0 3 6 4 4 2 8 5 0 5 7 0 3 Ep ( )= 2 7 2 0 3 6 0 8 0 3 1 0 4 1 9 1 6 2 13 0 4 2 9 4 5 8 1 0 MoveValue = C E (p ) - C E (p) CE (p ) = 78 + (1-4) + (6-0) + (2-6) + (13-4) = 78 + 8 = 86 49
Solution Combination Method The method scans (from left to right) each reference permutation. Each reference permutation votes for its first element that is still s not included in the combined permutation ( incipient element ). The voting determines the next element to enter the first still unassigned position of the combined permutation. The vote of a given reference solution is weighted according to the incipient element s position. Incipient element (3,1,4,2,5) votes for 4 Solution under construction: (1,4,3,5,2) votes for 4 (3,1,2,4,_ ) (2,1,3,5,4) votes for 5 50
Experiments with LOLIB 49 Input-Output Economic Tables GD CK CK10 TS SS Optima deviation Number of optima Run time (seconds onds) 0.15% 0.15% 0.02% 0.04% 0.01% 11 11 27 33 42 0.01 0.10 1.06 0.49 2.35 51
Another Example A commercial SS implementation OptQuest Callable Library (by OptTek) As other context-independent methods separates the method and the evaluation. Output Optimization Procedure Input System Evaluator 52
OptQuest based Applications Solution Generator OptQuest Callable Library User-written Application Solution Evaluator System Evaluator 53
Feasibility and Evaluation User Implementation x x * F(x * ) Constraint Mapping Complex System Evaluator G(x * ) Penalty Function P(x * ) The OptQuest engine generates a new solution Returns to OptQuest 54
Comparison with Genocop Test on 28 hard nonlinear instances 1.0E+13 Average objective function value (Logarithmic scale) 1.0E+12 1.0E+11 1.0E+10 1.0E+09 1.0E+08 1.0E+07 1.0E+06 1.0E+05 Genocop OCL 1.0E+04 1.0E+03 0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 Evaluations 55
Conclusions The development of metaheuristics usually entails a fair amount of experimentation ( skill comes from practice ). Code objectives: Quick Start Benchmark Advanced Designs Scatter Search provides a flexible framework to develop solving methods. 56
Call for Papers European Journal of Operational Research Feature Issue on SCATTER SEARCH METHODS FOR OPTIMIZATION Deadline for submissions: June 30, 2003 http://www.uv.es/~rmarti/ejor.html 57
Questions 58