An Introduction to Simulated Annealing Kevin Cannons November 24, 2005.

Slides:



Advertisements
Similar presentations
Decision Support Andry Pinto Hugo Alves Inês Domingues Luís Rocha Susana Cruz.
Advertisements

Neural and Evolutionary Computing - Lecture 4 1 Random Search Algorithms. Simulated Annealing Motivation Simple Random Search Algorithms Simulated Annealing.
Simulated Annealing Premchand Akella. Agenda Motivation The algorithm Its applications Examples Conclusion.
1 Optimization Algorithms on a Quantum Computer A New Paradigm for Technical Computing Richard H. Warren, PhD Optimization.
CHAPTER 8 A NNEALING- T YPE A LGORITHMS Organization of chapter in ISSO –Introduction to simulated annealing –Simulated annealing algorithm Basic algorithm.
Applying Machine Learning to Circuit Design David Hettlinger Amy Kerr Todd Neller.
Simulated Annealing Student (PhD): Umut R. ERTÜRK Lecturer : Nazlı İkizler Cinbiş
Planning under Uncertainty
Local search algorithms
Local search algorithms
Two types of search problems
ISQED’2015: D. Seemuth, A. Davoodi, K. Morrow 1 Automatic Die Placement and Flexible I/O Assignment in 2.5D IC Design Daniel P. Seemuth Prof. Azadeh Davoodi.
Optimization via Search CPSC 315 – Programming Studio Spring 2009 Project 2, Lecture 4 Adapted from slides of Yoonsuck Choe.
MAE 552 – Heuristic Optimization Lecture 6 February 6, 2002.
Nature’s Algorithms David C. Uhrig Tiffany Sharrard CS 477R – Fall 2007 Dr. George Bebis.
Placement 1 Outline Goal What is Placement? Why Placement?
Reconfigurable Computing (EN2911X, Fall07)
Simulated Annealing 10/7/2005.
Review Best-first search uses an evaluation function f(n) to select the next node for expansion. Greedy best-first search uses f(n) = h(n). Greedy best.
1 Simulated Annealing Terrance O ’ Regan. 2 Outline Motivation The algorithm Its applications Examples Conclusion.
Simulated Annealing Van Laarhoven, Aarts Version 1, October 2000.
D Nagesh Kumar, IIScOptimization Methods: M1L4 1 Introduction and Basic Concepts Classical and Advanced Techniques for Optimization.
Introduction to Simulated Annealing 22c:145 Simulated Annealing  Motivated by the physical annealing process  Material is heated and slowly cooled.
Optimization via Search CPSC 315 – Programming Studio Spring 2008 Project 2, Lecture 4 Adapted from slides of Yoonsuck Choe.
Simulated Annealing G.Anuradha. What is it? Simulated Annealing is a stochastic optimization method that derives its name from the annealing process used.
By Rohit Ray ESE 251.  Most minimization (maximization) strategies work to find the nearest local minimum  Trapped at local minimums (maxima)  Standard.
Register-Transfer (RT) Synthesis Greg Stitt ECE Department University of Florida.
Optimization of thermal processes2007/2008 Optimization of thermal processes Maciej Marek Czestochowa University of Technology Institute of Thermal Machinery.
Introduction to Monte Carlo Methods D.J.C. Mackay.
1 IE 607 Heuristic Optimization Simulated Annealing.
Swarm Intelligence 虞台文.
Boltzmann Machine (BM) (§6.4) Hopfield model + hidden nodes + simulated annealing BM Architecture –a set of visible nodes: nodes can be accessed from outside.
1 Simulated Annealing Contents 1. Basic Concepts 2. Algorithm 3. Practical considerations.
Simulated Annealing.
Mathematical Models & Optimization?
Thursday, May 9 Heuristic Search: methods for solving difficult optimization problems Handouts: Lecture Notes See the introduction to the paper.
Local Search Algorithms
A Computational Study of Three Demon Algorithm Variants for Solving the TSP Bala Chandran, University of Maryland Bruce Golden, University of Maryland.
Local Search Pat Riddle 2012 Semester 2 Patricia J Riddle Adapted from slides by Stuart Russell,
B. Stochastic Neural Networks
Simulated Annealing G.Anuradha.
Introduction to Simulated Annealing Study Guide for ES205 Yu-Chi Ho Xiaocang Lin Aug. 22, 2000.
Introduction to Simulated Annealing Study Guide for ES205 Xiaocang Lin & Yu-Chi Ho August 22, 2000.
Simulated Annealing. Difficulty in Searching Global Optima starting point descend direction local minima global minima barrier to local search.
A local search algorithm with repair procedure for the Roadef 2010 challenge Lauri Ahlroth, André Schumacher, Henri Tokola
Local search algorithms In many optimization problems, the state space is the space of all possible complete solutions We have an objective function that.
Optimization Problems
Ramakrishna Lecture#2 CAD for VLSI Ramakrishna
A study of simulated annealing variants Ana Pereira Polytechnic Institute of Braganca, Portugal Edite Fernandes University of Minho,
Metaheuristics for the New Millennium Bruce L. Golden RH Smith School of Business University of Maryland by Presented at the University of Iowa, March.
1 Contents 1. Basic Concepts 2. Algorithm 3. Practical considerations Simulated Annealing (SA)
Optimization Problems
Scientific Research Group in Egypt (SRGE)
CSCI 4310 Lecture 10: Local Search Algorithms
Simulated Annealing Chapter
Department of Computer Science
Heuristic Optimization Methods
Van Laarhoven, Aarts Version 1, October 2000
By Rohit Ray ESE 251 Simulated Annealing.
Subject Name: Operation Research Subject Code: 10CS661 Prepared By:Mrs
Maria Okuniewski Nuclear Engineering Dept.
Optimization Problems
CSE 589 Applied Algorithms Spring 1999
Introduction to Simulated Annealing
Xin-She Yang, Nature-Inspired Optimization Algorithms, Elsevier, 2014
More on HW 2 (due Jan 26) Again, it must be in Python 2.7.
More on HW 2 (due Jan 26) Again, it must be in Python 2.7.
Simulated Annealing & Boltzmann Machines
Stochastic Methods.
Reconfigurable Computing (EN2911X, Fall07)
Presentation transcript:

An Introduction to Simulated Annealing Kevin Cannons November 24, 2005

Cannons1 Presentation Goals ●Motivate the importance of simulated annealing (SA) ●Explain the simulated annealing algorithm ●Provide an example of solving a real-world problem with SA

Cannons2 Motivation ●Optimization problems are a very important and practical class of problems ●The best known algorithms for many optimization problems run in exponential time ●Simulated annealing can provide decent solutions to numerous difficult problems in reasonable time ► Travelling salesman problem ► Graph coloring problem ► And many more

Cannons3 Optimization Problems Background Cost Solution

Cannons4 Potential Solution Techniques ●Analyze every potential solution? ► Often an exponential number of solutions Cost Solution

Cannons5 Potential Solution Techniques ●Hill Climbing/Iterative Improvement? ► Algorithm: ■Start with a random solution ■Analyze nearby solutions and accept a solution in the neighbourhood if it has a lower cost than the current solution ■Stop when the current solution has no neighbours with a lower cost Cost Solution

Cannons6 Potential Solution Techniques ●Hill Climbing/Iterative Improvement? ► Algorithm: ■Start with a random solution ■Analyze nearby solutions and accept a solution in the neighbourhood if it has a lower cost than the current solution ■Stop when the current solution has no neighbours with a lower cost Cost Solution Initial Solution

Cannons7 Potential Solution Techniques ●Hill Climbing/Iterative Improvement? ► Algorithm: ■Start with a random solution ■Analyze nearby solutions and accept a solution in the neighbourhood if it has a lower cost than the current solution ■Stop when the current solution has no neighbours with a lower cost Cost Solution

Cannons8 Potential Solution Techniques ●Hill Climbing/Iterative Improvement? ► Algorithm: ■Start with a random solution ■Analyze nearby solutions and accept a solution in the neighbourhood if it has a lower cost than the current solution ■Stop when the current solution has no neighbours with a lower cost Cost Solution

Cannons9 Potential Solution Techniques ●Hill Climbing/Iterative Improvement? ► Algorithm: ■Start with a random solution ■Analyze nearby solutions and accept a solution in the neighbourhood if it has a lower cost than the current solution ■Stop when the current solution has no neighbours with a lower cost Cost Solution

Cannons10 Potential Solution Techniques ●Hill Climbing/Iterative Improvement? ► Algorithm: ■Start with a random solution ■Analyze nearby solutions and accept a solution in the neighbourhood if it has a lower cost than the current solution ■Stop when the current solution has no neighbours with a lower cost Cost Solution Final Solution

Cannons11 Potential Solution Techniques ●Hill Climbing/Iterative Improvement? ► Algorithm: ■Start with a random solution ■Analyze nearby solutions and accept a solution in the neighbourhood if it has a lower cost than the current solution ■Stop when the current solution has no neighbours with a lower cost Cost Solution Initial Solution

Cannons12 Potential Solution Techniques ●Hill Climbing/Iterative Improvement? ► Algorithm: ■Start with a random solution ■Analyze nearby solutions and accept a solution in the neighbourhood if it has a lower cost than the current solution ■Stop when the current solution has no neighbours with a lower cost Cost Solution

Cannons13 Optimization Problems ●Hill Climbing/Iterative Improvement? ► Algorithm: ■Start with a random solution ■Analyze nearby solutions and accept a solution in the neighbourhood if it has a lower cost than the current solution ■Stop when the current solution has no neighbours with a lower cost Cost Solution Final Solution

Cannons14 Optimization Problems ●Hill Climbing/Iterative Improvement? ► Disadvantages: ■Gets trapped in local minima ■Identified local minimum depends on the initial solution ► Improvements? ■Run the algorithm several times with different starting points ■Occasionally allow transitions to solutions which increase the cost Cost Solution Second Minimum Found First Minimum Found

Cannons15 Optimization Problems ●Hill Climbing/Iterative Improvement? ► Disadvantages: ■Gets trapped in local minima ■Identified local minimum depends on the initial solution ► Improvements? ■Run the algorithm several times with different starting points ■Occasionally allow transitions to solutions which increase the cost Cost Solution

Cannons16 Optimization Problems ●Hill Climbing/Iterative Improvement? ► Disadvantages: ■Gets trapped in local minima ■Identified local minimum depends on the initial solution ► Improvements? ■Run the algorithm several times with different starting points ■Occasionally allow transitions to solutions which increase the cost

Cannons17 What is Simulated Annealing? ●General purpose optimization technique ► Introduced by Kirkpatrick et al in 1983 ●Converges asymptotically to a global minimum ► Not as impressive as it sounds ■With infinite time, a global minimum could be found with a hill climbing method ► Does work well in practise for many problems ■Final solution typically has a cost close to the true minimum ●Inspired by the physical annealing of solids ► Temperature increased to a level where the solid melts ► Temperature is then slowly decreased until the substance reaches a low energy state

Cannons18 Metropolis Algorithm ●At the heart of the SA technique ●Developed by Metropolis et al in 1953 ●Models the movement of atoms as they evolve towards equilibrium at a particular temperature

Cannons19 Metropolis Algorithm ●Ingredients: ► i = current solution ► n = proposed solution ► E k = energy (or cost) of solution k ►  E = E n - E i ► T = current temperature

Cannons20 Metropolis Algorithm ●Simple, three-step algorithm: 1. Generate solution n by making a small change to solution i 2. Compute  E = E n - E i 3. if  E < 0 then P accept = 1 else P accept = ●Above steps are performed Q times ► If Q = , system will reach equilibrium Ingredients: i = current solution n = proposed solution E k = energy (or cost) of solution k  E = E n - E i T = current temperature

Cannons21 Metropolis Algorithm ●What does the P accept = function look like?

Cannons22 Metropolis Algorithm ●What does the P accept = function look like?

Cannons23 Metropolis Algorithm ●What does the P accept = function look like?

Cannons24 Metropolis Algorithm ●What does the P accept = function look like?

Cannons25 Metropolis Algorithm ●What does the P accept = function look like?

Cannons26 Simulated Annealing ●Simulated annealing is just repeated executions of the Metropolis algorithm at slowly decreasing temperatures ●Four-step algorithm: 1.Select an initial solution, i, and temperature, T 2.while (the system hasn’t “frozen”) 3. i = MetropolisAlg(i,T) 4. T = LowerTemp(T) end

Cannons27 Example: Integrated Circuit Layout ●Common example problem (Rutenbar 1989) ●Given a logic circuit: ► A set of components ► A list of connections between the components ●Goal: ► Place the components on an integrated circuit (IC) board ► Minimize the wire needed to connect the components A B C D E F G H A B C D E F G H Connected Logic CircuitPlacement on IC board

Cannons28 Example: Integrated Circuit Layout ●When using SA (to solve any problem), four ingredients must be determined: 1. Solutions: The properties that any valid solution must have 2. Move Set: The allowable alterations that can be made to the current solution to generate the next potential solution 3. Cost Function: Measures the “goodness” of a solution 4. Cooling Schedule: Specifies how the temperature is changed ■Initial temperature ■When to lower the temperature ■Amount by which to decrease the temperature ■When annealing should conclude

Cannons29 Example: Integrated Circuit Layout 1. Solutions ► Simplify by restricting components on the IC to a grid ► A valid solution is an assignment of components to the grid such that: ■There is no more than one component per grid location ■No component is repeated ■All components in the logic circuit are present A B C D E F G H A B C D E F G H Connected Logic CircuitPlacement on IC board

Cannons30 Example: Integrated Circuit Layout 1. Solutions ► Simplify by restricting components on the IC to a grid ► A valid solution is an assignment of components to the grid such that: ■There is no more than one component per grid location ■No component is repeated ■All components in the logic circuit are present A B C D E F G H H F B D E G A C Connected Logic CircuitPlacement on IC board

Cannons31 Example: Integrated Circuit Layout 2. Move Set ► Generate a new solution by swapping the position of two components A B C D E F G H A B C D E F G H Connected Logic CircuitPlacement on IC board

Cannons32 Example: Integrated Circuit Layout 2. Move Set ► Generate a new solution by swapping the position of two components A B C D E F G H A B C D E F G H Connected Logic CircuitPlacement on IC board

Cannons33 Example: Integrated Circuit Layout 2. Move Set ► Generate a new solution by swapping the position of two components A B C D E F G H A C B D E F G H Connected Logic CircuitPlacement on IC board

Cannons34 Example: Integrated Circuit Layout 2. Move Set ► Generate a new solution by swapping the position of two components A B C D E F G H A C B D E F G H Connected Logic CircuitPlacement on IC board

Cannons35 Example: Integrated Circuit Layout 3. Cost Function ► Estimate of the total wire length on the board ■Consider each pair of components that are connected in the logic circuit ■Draw a box around the components on the board ■The amount of wire needed to connect those two components is 0.5  (Box Perimeter) ■Total wire length is the sum of the pairwise lengths A B C D E F G H A B C D E F G H Connected Logic CircuitPlacement on IC board

Cannons36 Example: Integrated Circuit Layout 3. Cost Function ► Estimate of the total wire length on the board ■Consider each pair of components that are connected in the logic circuit ■Draw a box around the components on the board ■The amount of wire needed to connect those two components is 0.5  (Box Perimeter) ■Total wire length is the sum of the pairwise lengths A B C D E F G H A B C D E F G H Connected Logic CircuitPlacement on IC board

Cannons37 Example: Integrated Circuit Layout 4. Cooling Schedule ► T init is set so that P accept = 95% ► Metropolis algorithm performs 100M iterations at each temperature ■M = the number of components ► T new =  T old,  < 1 ► SA halts when the results returned by the Metropolis algorithm improve by less than 1% over three consecutive temperatures

Cannons38 Example: Integrated Circuit Layout ●Results (Rutenbar 1989): ► SA algorithm described was implemented and run on an instance of the problem ■Approximately 800 components to place on the IC board Cost Temperature

Cannons39 Mathematically Modelling SA ●Ideas that underlie SA are mathematically rigorous (Trosset 2001) ●Typically model SA algorithm as a number of Markov chains ► One Markov chain for each temperature ●Allows for interesting mathematical proofs: ► Guaranteed asymptotic convergence to a global minimum ► Maximum rate of cooling which allows equilibrium to be reached

Cannons40 Summary Motivated the importance of simulated annealing ► Can find decent solutions to challenging problems in a reasonable amount of time

Cannons41 Summary Motivated the importance of simulated annealing ► Can find decent solutions to challenging problems in a reasonable amount of time Explained the simulated annealing algorithm ► Repeated executions of the Metropolis algorithm for decreasing temperature levels

Cannons42 Summary Motivated the importance of simulated annealing ► Can find decent solutions to challenging problems in a reasonable amount of time Explained the simulated annealing algorithm ► Repeated executions of the Metropolis algorithm for decreasing temperature levels Provided an example of solving a real-world problem with SA ► Integrated circuit board layout

Cannons43 References L. Ingber. Simulated annealing: practice versus theory. Mathl. Comput. Modelling, 18(11):29-57, S. Kirkpatrick, C. D. Gelatt, and M. P. Vecchi. Optimization by simulated annealing. Science, 220: , P. J. M. van Laarhoven and E. H. L. Aarts. Simulated Annealing: Theory and Applications. D. Reidel Publishing Company, N. Metropolis, A. W. Rosenbluth, M. N. Rosenbluth, and A. H. Teller. Equation of state calculations by fast computing machines. The Journal of Chemical Physics, 21(6): , R. A. Rutenbar. Simulated annealing: an overview. IEEE Circuits and Devices Magazine, 5(1):19-26, M. W. Trosset. What is simulated annealing? Optimization and Engineering, 2: , 2001.

Cannons44 Questions?

Cannons45

Cannons46 Mathematically Modelling SA T = T init T = T q T = T final … … Stat e 1 Stat e 2 Stat e 3 Stat e S … Stat e 1 Stat e 2 Stat e 3 Stat e S … Stat e 1 Stat e 2 Stat e 3 Stat e S …

Cannons47 Optimization Problems ●Share a common set of ingredients (Edmonds 2005) ► Instances: The set of potential inputs for the problem ► Solutions: Each instance has an exponential number ► Cost of a Solution: Each solution has a value associated with it ●Goal: ► Find a valid solution to an instance which minimizes (or maximizes) the cost function

Cannons48 Disadvantages ●Long run-time ► Must decrease the temperature carefully and slowly to ensure convergence ■Slower the cooling, the better the chance of finding an optimal solution ●Not always trivial to fine tune for specific problems ► Ex. Designing the move set ●Some problems don’t have solution spaces that are well-suited for annealing ●Suffered from over-hype

Cannons49 Summary ●During this presentation Motivated the importance of simulated annealing ■Can find decent solutions to challenging problems in a reasonable amount of time Explained the simulated annealing algorithm ■Repeated execution of the Metropolis algorithm for decreasing temperature levels

Cannons50 Potential Solution Techniques ●Hill Climbing/Iterative Improvement? ► Algorithm: ■Start with a random solution ■Take small steps in the direction that decreases the solution cost ■Stop taking steps when they can no longer provide a solution with a lower cost Cost Solution

Cannons51 Example: Integrated Circuit Layout 1. Solutions ► Simplify by restricting components on the IC to a grid ► A valid solution is an assignment of components to the grid such that: ■There is no more than one component per grid location ■No component is repeated ■All components in the logic circuit are present A B C D E F G H A B C D E F G A Connected Logic CircuitPlacement on IC board

Cannons52 Example: Integrated Circuit Layout 2. Move Set ► Generate a new solution by swapping the position of two components A B C D E F G H A C B D E F G H Connected Logic CircuitPlacement on IC board

Cannons53 Example: Integrated Circuit Layout 2. Move Set ► Generate a new solution by swapping the position of two components A B C D E F G H A C B DF G H Connected Logic CircuitPlacement on IC board E

Cannons54 Example: Integrated Circuit Layout 2. Move Set ► Generate a new solution by swapping the position of two components A B C D E F G H A C B DF G H Connected Logic CircuitPlacement on IC board E

Cannons55 Example: Integrated Circuit Layout 3. Cost Function ► Example: ■Wire needed to connect Component A to Component C  Wire AC = 0.5  ( ) = 3 A B C D E F G H A B C D E F G H Connected Logic CircuitPlacement on IC board 1 2

Cannons56 Example: Integrated Circuit Layout 3. Cost Function ► Example: ■Wire needed to connect Component A to Component C  Wire AC = 0.5  ( ) = 3 ■Wire needed to connect Component A to Component D  Wire AD = 0.5  ( ) = 4 A B C D E F G H A B C D E F G H Connected Logic CircuitPlacement on IC board 2 2

Cannons57 Example: Integrated Circuit Layout 3. Cost Function ► Example: ■Wire needed to connect Component A to Component C  Wire AC = 0.5  ( ) = 3 ■Wire needed to connect Component A to Component D  Wire AD = 0.5  ( ) = 4 ■Etc. ■Total Wire Length = …. A B C D E F G H A B C D E F G H Connected Logic GatesPlacement on IC board