ebook img

Genetic Algorithms vs. Simulated Annealing PDF

16 Pages·2015·0.45 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Genetic Algorithms vs. Simulated Annealing

SSoouutthheerrnn MMeetthhooddiisstt UUnniivveerrssiittyy SSMMUU SScchhoollaarr Computer Science and Engineering Research Computer Science and Engineering 5-1996 GGeenneettiicc AAllggoorriitthhmmss vvss.. SSiimmuullaatteedd AAnnnneeaalliinngg:: AA CCoommppaarriissoonn ooff AApppprrooaacchheess ffoorr SSoollvviinngg tthhee CCiirrccuuiitt PPaarrttiittiioonniinngg PPrroobblleemm Theodore W. Manikas Southern Methodist University, [email protected] James T. Cain University of Pittsburgh - Main Campus, [email protected] Follow this and additional works at: https://scholar.smu.edu/engineering_compsci_research Part of the Digital Circuits Commons, Electrical and Electronics Commons, Hardware Systems Commons, and the VLSI and Circuits, Embedded and Hardware Systems Commons RReeccoommmmeennddeedd CCiittaattiioonn Manikas, Theodore W. and Cain, James T., "Genetic Algorithms vs. Simulated Annealing: A Comparison of Approaches for Solving the Circuit Partitioning Problem" (1996). Computer Science and Engineering Research. 1. https://scholar.smu.edu/engineering_compsci_research/1 This document is brought to you for free and open access by the Computer Science and Engineering at SMU Scholar. It has been accepted for inclusion in Computer Science and Engineering Research by an authorized administrator of SMU Scholar. For more information, please visit http://digitalrepository.smu.edu. Genetic Algorithms vs(cid:2) Simulated Annealing(cid:3) A Comparison of Approaches for Solving the Circuit Partitioning Problem by Theodore W(cid:2) Manikas James T(cid:2) Cain Technical Report (cid:2)(cid:3)(cid:4)(cid:5)(cid:6)(cid:5) May (cid:5)(cid:2)(cid:2)(cid:3) Department of Electrical Engineering The University of Pittsburgh Pittsburgh(cid:7) PA (cid:5)(cid:8)(cid:9)(cid:3)(cid:5) Abstract An important stage in circuit design is placement(cid:2) where components are assigned to physical locations on a chip(cid:3) A popular contemporary method for placement is the use of simulated annealing(cid:3) While this approach has been shown to produce good placement solutions(cid:2) recent workin genetic algorithms has produced promising results(cid:3) Thepurposeofthisstudyistodeterminewhichapproachwillresultinbetterplacement solutions(cid:3) A simpli(cid:4)ed model of the placement problem(cid:2) circuit partitioning(cid:2) was tested on three circuits with both a genetic algorithm and a simulated annealing algorithm(cid:3) When comparedwith simulated annealing(cid:2) the genetic algorithmwasfound toproduce similar results for one circuit(cid:2) and better results for the other two circuits(cid:3) Based on these results(cid:2) genetic algorithms mayalso yield better results thansimulated annealing when applied to the placement problem(cid:3) Group A Group B Figure (cid:2)(cid:3) Graph representation of circuit partitioning(cid:4) (cid:0) Introduction Animportantstage incircuitdesignis placement(cid:5) wherecomponentsare assigned to physical locations on a chip(cid:4) A popular contemporary method for placement is the use of simulated annealing (cid:6)Sechen(cid:7)(cid:2)(cid:8)(cid:9)(cid:4) While this approach has produced good results(cid:5) recent work in ge(cid:2) netic algorithms has also produced promising results (cid:6)Cohoon (cid:7)(cid:10)(cid:8)(cid:5) Shahookar (cid:7)(cid:11)(cid:8)(cid:5) Sait (cid:7)(cid:12)(cid:8)(cid:9)(cid:4) The purpose of this study is to determine which approach(cid:5) genetic algorithms or simulated annealing(cid:5) will result in better placement solutions(cid:4) A simple model of the placement problem is the circuit partitioning problem(cid:4) A circuit may be represented by a graph G(cid:13)(cid:6)V(cid:5)E(cid:9)(cid:5) where the vertex set V represents the components of the circuit(cid:5) and edge set E represents the interconnections between components(cid:4) The par(cid:14) titioningprocess splitsthe circuitintogroups ofrelativelyequalsizes(cid:4) Theobjectiveisassign components to groups such that the number of interconnections between groups is minimal(cid:4) An example of a circuit partition is shown in Figure (cid:2)(cid:4) The number of interconnections between groups is called a cutsize(cid:5) thus the goal is to minimize the cutsize(cid:4) Partitioning was tested on three circuits using both genetic algorithm and simulated annealing approaches(cid:4) This report describes the method used for this experiment(cid:5) and discusses the results(cid:4) (cid:2) (cid:0) Method Both a genetic algorithm and simulated annealing approach were tested on a set of circuits(cid:2) This chapter explains both approaches(cid:3) and describes the method used for testing these approaches(cid:2) (cid:0)(cid:2)(cid:3) Genetic Algorithm A genetic algorithm (cid:4)Holland(cid:5)(cid:6)(cid:7)(cid:8) is an iterative procedure that maintains a population of individuals(cid:9) these individuals are candidate solutions to the problem being solved(cid:2) Each iteration of the algorithm is called a generation(cid:2) During each generation(cid:3) the individuals of the current population are rated for their e(cid:10)ectiveness as solutions(cid:2) Based on these ratings(cid:3) a new population of candidate solutions is formed using speci(cid:11)c genetic operators(cid:2) Each individual is represented by a string(cid:3) or chromosome(cid:9) each string consists of characters (cid:4)genes(cid:8) which have speci(cid:11)c values (cid:4)alleles(cid:8)(cid:2) The ordering of characters on the string is signi(cid:11)cant(cid:9) the speci(cid:11)c positions on the string are called loci(cid:2) A genetic algorithm for partitioning(cid:3) based on Bui(cid:12)s approach(cid:5)(cid:13)(cid:7)(cid:3) was used for this study (cid:4)Figure (cid:14)(cid:8)(cid:2) A graph partitioning solution is encoded as a binary string of C genes(cid:3) where C (cid:15) total numberof components(cid:2) Each gene represents a component(cid:3) and the allele represents the group (cid:4)(cid:16) or (cid:17)(cid:8)(cid:3) where the component is assigned(cid:2) For example(cid:3) the chromosome (cid:5)(cid:16)(cid:16)(cid:17)(cid:17)(cid:17)(cid:7) represents a graph of (cid:11)ve components(cid:18) components (cid:17) and (cid:14) are in partition (cid:16)(cid:3) while compo(cid:19) nents (cid:20)(cid:3) (cid:21) and (cid:6) are in partition (cid:17)(cid:2) The following sections explain the steps of the genetic algorithm(cid:2) Create Initial Population A population of P chromosomes are randomly generated to create an initial population(cid:2) C (cid:0) Individuals are created by generating a random number in the range (cid:17) to (cid:14) (cid:14)(cid:9) each individual must represent a valid partitioning solution(cid:2) A valid partitioning solution is balanced(cid:18) each group has approximately the same number of components(cid:2) Select Parents Each individual has a (cid:2)tness value(cid:3) which is a measure of the quality of the solution represented by the individual(cid:2) The formula from Bui(cid:5)(cid:13)(cid:7) is used to calculate the (cid:11)tness value F for individual i(cid:18) (cid:14) GENETIC ALGORITHM begin create initial population of size P repeat select parent (cid:2) and parent (cid:3) from the population o(cid:4)spring (cid:5) crossover(cid:6)parent (cid:2)(cid:7)parent (cid:3)(cid:8) mutation(cid:6)o(cid:4)spring(cid:8) update population until stopping criteria met report the best answer end Figure (cid:3)(cid:9) Genetic algorithm(cid:10) Cw (cid:0)Cb Fi (cid:5) (cid:6)Cw (cid:0)Ci(cid:8)(cid:11) (cid:12) where Cw is the largest cutsize in the population(cid:7) Cb is the smallest cutsize in the popu(cid:13) lation(cid:7) and Ci is the cutsize of individual i(cid:10) Each individual is considered for selection as a parent(cid:14) the probability of selection of a particular individual is proportional to its (cid:15)tness value(cid:10) Bui(cid:16)(cid:17)(cid:18) recommends that the probabilitythat thebest individualischosenshould be (cid:19) timestheprobabilitythatthe worst individual is chosen(cid:10) Thus(cid:7) the P chromosomes are sorted in ascending order according to their (cid:15)tness values(cid:7) and a probability distribution function is created(cid:10) The probability factor r is found by (cid:0) r (cid:5) (cid:19)P(cid:0)(cid:0) Assume that the probabilities assigned to each individual is a geometric progression(cid:7) where the sum of all these probabilities S is given by (cid:0) P(cid:0)(cid:2) (cid:2)(cid:0)rP S (cid:5) (cid:2)(cid:11)r(cid:11)r (cid:11)(cid:2)(cid:2)(cid:2)(cid:11)r (cid:5) (cid:2)(cid:0)r Therefore(cid:7) the probability that chromosome i is selected(cid:7) Prfig(cid:7) is found by (cid:12) Parent 1 0 1 1 0 1 0 1 Parent 2 1 1 0 1 0 1 1 Offspring 1 0 1 1 1 0 1 1 Offspring 2 0 1 1 0 1 0 0 Figure (cid:2)(cid:3) Crossover example(cid:4) i(cid:0)(cid:0) r Prfig (cid:5) S Crossover After two parents are selected(cid:6) crossover is performed on the parents to create two o(cid:2)(cid:3) spring(cid:4) A chromosome split point is randomly selected(cid:6) and is used to split each parent chromosome in half(cid:4) The (cid:7)rst o(cid:8)spring is created by concatenating the left half of the (cid:7)rst parent and the right half of the second parent(cid:6) while the second o(cid:8)spring is created by con(cid:9) catenating the left half of the (cid:7)rst parent and the complement of the right half of the second parent(cid:4) An example of crossover is shown in Figure (cid:2)(cid:4) Mutation Each o(cid:8)spring must meet the same constraints as its parents(cid:3) the number of ones and zeroes in the bit pattern should be nearly equal(cid:4) However(cid:6) the crossover operation may produce an o(cid:8)spring that do not meetthis requirement(cid:4) An o(cid:8)spring is alteredvia mutation(cid:6) which randomly adjusts bits in the o(cid:8)spring so that its bit pattern is valid(cid:4) The mutation procedure determinesthe value b(cid:6) which is the absolute value of the di(cid:8)erence in the number of ones and zeroes(cid:4) A bit location on the o(cid:8)spring is randomly selected(cid:6)then starting at that location(cid:6) b bits are complemented(cid:10)zeroes becomeones(cid:6) ones become zeroes(cid:11)(cid:4) This operation results in o(cid:8)spring that represent valid partitions(cid:4) Update Population (cid:12) The creation of two o(cid:2)spring increases the size of the population to P (cid:3)(cid:4)(cid:5) Since we want to maintain a constaint population size of P(cid:6) two individuals will need to be eliminatedfrom the population(cid:5) The goal of the algorithm is to converge to the best quality solution(cid:6) thus the two individuals with the lowest (cid:7)tness values are removed from the population(cid:5) Stopping Criteria Bui(cid:8)(cid:9)(cid:10) uses a swing value W to determine when the algorithm stops(cid:5) If there is no improvement after W generations(cid:6) then the algorithm stops(cid:5) No improvement means that there are no changes in the maximum (cid:7)tness value of the population(cid:5) The (cid:7)nal solution is the individual with the highest (cid:7)tness value(cid:5) (cid:0)(cid:2)(cid:0) Simulated Annealing Simulated annealing (cid:11)Kirkpatrick(cid:8)(cid:12)(cid:10)(cid:13) is an iterative procedure that continuously updates one candidate solution until a termination condition is reached(cid:5) A simulated annealing algorithmfor circuitpartitioningwas created(cid:6) and isshown inFigure(cid:14)(cid:5) Acandidate solution is randomly generated(cid:6) and the algorithm starts at a high starting temperature T(cid:0)(cid:5) The following sections explain the steps of the simulated annealing algorithm(cid:5) Calculate Gain The gain of a partitioning solution is calculated by use of the ratio cut formula (cid:11)Wei(cid:8)(cid:15)(cid:10)(cid:13)(cid:16) cutsize Gain (cid:17) jAj(cid:2)jBj where jAj (cid:17) the number of vertices in group A(cid:6) and jBj (cid:17) the number of vertices in group B(cid:5) Accepting Vertex Moves M is the number of move states per iteration(cid:5) For each move state(cid:6) a vertex is randomly selected as a candidate to movefrom its original group to the other group(cid:5) When a vertexV is randomly selected for movementfrom one partition to another(cid:6) its score(cid:6) or acceptance of (cid:18) begin T (cid:0) T(cid:0) tstop (cid:0) ts Current Gain (cid:0) Calculate Gain(cid:2)(cid:3) while tstop (cid:2) (cid:4) do Accept Move (cid:0) FALSE for i (cid:0) (cid:5) to M do randomly select vertex V to move from one partition to another New Gain (cid:0) Calculate Gain(cid:2)(cid:3) (cid:0) (cid:6)Gain (cid:0) New Gain Current Gain if Accept Gain Change(cid:2)(cid:6)Gain(cid:7)T(cid:3) then Current Gain (cid:0) New Gain Accept Move (cid:0) TRUE else return V to original partition if Accept Move then tstop (cid:0) ts else (cid:0) tstop (cid:0) tstop (cid:5) T (cid:0) T (cid:0)(cid:3) end Figure (cid:8)(cid:9) Simulated annealing algorithm(cid:10) (cid:11) Accept Gain Change(cid:2)(cid:0)Gain(cid:3)T(cid:4) begin if move results in unbalanced partition then reject move else if (cid:0)Gain (cid:2) (cid:2) then accept move else R (cid:3) random number (cid:4)(cid:2) (cid:2) R (cid:2) (cid:5)(cid:6) (cid:0)(cid:0)Gain Y (cid:3) e T if R (cid:2) Y then accept move else reject move end Figure (cid:7)(cid:8) Simulated annealing scoring function move(cid:9) is evaluated according to the function shown in Figure (cid:7)(cid:10) A move is always rejected if it will result in an unbalanced partition(cid:9) while a move is always accepted if it will improve the solution(cid:10) Otherwise(cid:9) a move is randomly accepted(cid:9) with the probability of acceptance dependent on the system temperature T(cid:10) The higher the temperature(cid:9) the greater the prob(cid:11) ability that an inferior move will be selected(cid:10) This process allows the candidate solution to exploremoreregions of the solution space at the earlystages of the algorithm(cid:10) The objective is to keep the solution from converging to a local optimum(cid:10) Stopping Criteria After each iteration(cid:9) the temperature T is scaled by a cooling factor (cid:3)(cid:9) where (cid:2) (cid:2) (cid:3) (cid:2) (cid:5)(cid:10) The algorithm stops if there have been no changes to the solution after ts iterations(cid:10) (cid:0) Experiment and Results Three circuits were selected for data sets(cid:12) the graphical representations of these circuits are shown in Figures (cid:13)(cid:9) (cid:14)(cid:9) and (cid:15)(cid:10) For the genetic algorithm(cid:9)the population size P and swing value W were varied during testing(cid:10) For simulated annealing(cid:9) the starting temperature T(cid:0)(cid:9) cooling factor (cid:3)(cid:9) number of movestate M(cid:9) and stopping value ts(cid:10) were varied during testing(cid:10) Each set of parameter combinations forms a treatment(cid:12) there were approximately (cid:16)(cid:2) trials (cid:13) Circuit P W (cid:2) f(cid:3)(cid:4)(cid:2)(cid:5)(cid:4)(cid:2)(cid:3)(cid:4)(cid:6)(cid:5)g f(cid:6)(cid:4)(cid:3)(cid:4)(cid:2)(cid:5)g (cid:6) f(cid:2)(cid:3)(cid:4)(cid:7)(cid:5)(cid:4)(cid:3)(cid:5)(cid:4)(cid:2)(cid:5)(cid:5)g f(cid:6)(cid:4)(cid:3)(cid:4)(cid:2)(cid:5)g (cid:7) f(cid:2)(cid:3)(cid:4)(cid:7)(cid:5)g f(cid:6)(cid:4)(cid:3)(cid:4)(cid:2)(cid:5)g Table (cid:2)(cid:8) Experimental parameter ranges for the genetic algorithm(cid:9) Circuit T(cid:0) (cid:2) M ts (cid:2) f(cid:2)(cid:5)(cid:5)(cid:5)g f(cid:5)(cid:9)(cid:10)(cid:4)(cid:5)(cid:9)(cid:11)(cid:4)(cid:5)(cid:9)(cid:11)(cid:11)(cid:3)g f(cid:3)(cid:4)(cid:2)(cid:5)(cid:4)(cid:6)(cid:5)g f(cid:7)(cid:4)(cid:3)(cid:4)(cid:2)(cid:5)g (cid:6) f(cid:2)(cid:5)(cid:5)(cid:5)(cid:4)(cid:3)(cid:5)(cid:5)(cid:5)(cid:4)(cid:2)(cid:5)(cid:5)(cid:5)(cid:5)g f(cid:5)(cid:9)(cid:10)(cid:4)(cid:5)(cid:9)(cid:11)(cid:4)(cid:5)(cid:9)(cid:11)(cid:11)(cid:3)g f(cid:3)(cid:4)(cid:2)(cid:5)(cid:4)(cid:6)(cid:5)g f(cid:7)(cid:4)(cid:3)(cid:4)(cid:2)(cid:5)g (cid:7) f(cid:2)(cid:5)(cid:5)(cid:5)g f(cid:5)(cid:9)(cid:11)(cid:11)(cid:3)g f(cid:6)(cid:5)g f(cid:7)(cid:4)(cid:3)g Table (cid:6)(cid:8) Experimental parameter ranges for simulated annealing(cid:9) per treatment(cid:9) The parameter ranges used for each circuit are shown in Table (cid:2) for the genetic algorithm(cid:4) and in Table (cid:6) for the simulated annealing algorithm(cid:9) For each graph(cid:4) the mean cutsizes of the genetic algorithm and simulated annealing are compared(cid:9) We want to estimate the di(cid:12)erences between the means with a (cid:11)(cid:3)(cid:13) degree of con(cid:14)dence(cid:9) According to Freund(cid:15)(cid:11)(cid:16)(cid:4) if x(cid:17)(cid:0) and x(cid:17)(cid:2) are the values of the means of independent (cid:2) random samples of size n(cid:0) and n(cid:2) from the normal populations with known variances (cid:3)(cid:0) and (cid:2) (cid:3)(cid:2)(cid:4) then (cid:2) (cid:2) (cid:2) (cid:2) (cid:3)(cid:0) (cid:3)(cid:2) (cid:3)(cid:0) (cid:3)(cid:2) (cid:18)x(cid:17)(cid:0) (cid:2)x(cid:17)(cid:2)(cid:19)(cid:2)z(cid:0)(cid:2)(cid:2)(cid:3) (cid:20) (cid:4) (cid:5)(cid:0) (cid:2)(cid:5)(cid:2) (cid:4) (cid:18)x(cid:17)(cid:0) (cid:2)x(cid:17)(cid:2)(cid:19)(cid:20)z(cid:0)(cid:2)(cid:2)(cid:3) (cid:20) sn(cid:0) n(cid:2) sn(cid:0) n(cid:2) is a (cid:18)(cid:2)(cid:2)(cid:2)(cid:19)(cid:2)(cid:5)(cid:5)(cid:13) con(cid:14)dence interval for the di(cid:12)erence between the population means(cid:9) For a (cid:11)(cid:3)(cid:13) con(cid:14)dence interval(cid:4) (cid:18)(cid:2) (cid:2) (cid:2)(cid:19) (cid:21) (cid:5)(cid:6)(cid:11)(cid:3)(cid:4) so (cid:2) (cid:21) (cid:5)(cid:6)(cid:5)(cid:3)(cid:4) and (cid:2)(cid:7)(cid:6) (cid:21) (cid:5)(cid:6)(cid:5)(cid:6)(cid:3)(cid:9) From the z(cid:22)tables for standard normal distribution (cid:18)Table III in Freund(cid:15)(cid:11)(cid:16)(cid:19)(cid:4) z(cid:3)(cid:3)(cid:3)(cid:2)(cid:4) (cid:21) (cid:2)(cid:6)(cid:11)(cid:23)(cid:9) For this study(cid:4) index(cid:2) refers to the geneticalgorithm(cid:4) whileindex (cid:6) refers to the simulatedannealing method(cid:9) Table (cid:7) shows the results(cid:4) which are used to calculate the con(cid:14)dence intervals(cid:9) A bar graph that compares the mean cutsizes is shown in Figure (cid:23)(cid:9) For data set (cid:2)(cid:4) the (cid:11)(cid:3)(cid:13) con(cid:14)dence interval is Circuit x(cid:17)(cid:0) (cid:3)(cid:0) n(cid:0) x(cid:17)(cid:2) (cid:3)(cid:2) n(cid:2) (cid:2) (cid:7)(cid:9)(cid:5)(cid:5)(cid:24) (cid:5)(cid:9)(cid:5)(cid:23)(cid:3) (cid:6)(cid:24)(cid:5) (cid:24)(cid:9)(cid:10)(cid:23)(cid:5) (cid:5)(cid:9)(cid:23)(cid:2)(cid:10) (cid:24)(cid:5)(cid:5) (cid:6) (cid:3)(cid:9)(cid:7)(cid:7)(cid:7) (cid:2)(cid:9)(cid:2)(cid:6)(cid:25) (cid:6)(cid:24)(cid:5) (cid:24)(cid:9)(cid:11)(cid:25)(cid:10) (cid:5)(cid:9)(cid:6)(cid:25)(cid:25) (cid:2)(cid:23)(cid:6)(cid:5) (cid:7) (cid:23)(cid:9)(cid:23)(cid:24)(cid:5) (cid:2)(cid:9)(cid:2)(cid:3)(cid:11) (cid:2)(cid:5)(cid:5) (cid:10)(cid:9)(cid:10)(cid:25)(cid:3) (cid:5)(cid:9)(cid:3)(cid:23)(cid:7) (cid:24)(cid:5) Table (cid:7)(cid:8) Table of results(cid:9) (cid:10)

Description:
5-1996. Genetic Algorithms vs. Simulated Annealing: A. Comparison of Approaches for Solving the Circuit. Partitioning Problem. Theodore W. Manikas.
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.