1 / 16

CS621: Artificial Intelligence

CS621: Artificial Intelligence. Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 7: Traveling Salesman Problem as search; Simulated Annealing; Comparison with GA. 4-city TSP. d ij not necessarily Equal to d ji. 2. 1. d 12. d 23. d 23. d 31. d 14. 4. 3. d 34.

Download Presentation

CS621: Artificial Intelligence

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS621: Artificial Intelligence Pushpak BhattacharyyaCSE Dept., IIT Bombay Lecture 7: Traveling Salesman Problem as search; Simulated Annealing; Comparison with GA

  2. 4-city TSP dij not necessarily Equal to dji 2 1 d12 d23 d23 d31 d14 4 3 d34

  3. TSP: State Representation 1 2 3 4 1 1 0 0 0 2 0 0 1 0 3 0 1 0 0 4 0 0 0 1 Position (α) City (i) `i’ varies over cities `α’ varies over positions

  4. Objective Functions Minimize F = F1 + F2 F1 = k1 ∑i ((∑α xiα) – 1)2 + k2 ∑β ((∑j xjβ) – 1)2 1(a) 1(b) F2 = k3 ∑i ∑j ∑α dij (xiα xi,α+1 + xiα xi,α-1) 2

  5. Travelling Salesperson problem through Simulated Annealing, State representation Position City 1 3 4 2 State

  6. State/Node expansion 1 Parent State 3 4 2 3  2 4  2 1 1 Children States 4 3 2 2 4 3

  7. State-Energy diagram

  8. Metropolis Algorithm • Initialize: Start with a random state matrix S. Compute the objective function value at S. Call this the energy of the state E(S). • The states are transformed by the application of an operator (for TSP, inversion of adjacent cities) • Compute change the energy ΔE=Enew-Eold • if ΔE <=0, accept the new state Snew • Else, accept Snew with probability (‘T’ is the “temperature” and KB,the Boltzmann constant)

  9. Metropolis Algorithm (contd) 6) Continue 2-5 until there is no appreciable change in energy 7) The current state may be one of the local minima 8) Increase the temperature and continue 2-7 until the global minimum is reached

  10. How to probabilistically accept a state? • Suppose the probability =p • Generate a random number from a uniform distribution [0,1] • Number generated is in the range [0-p]: Accept the new state, else continue search from the old state itself

  11. Why? • The significance of p (= ) is that if the states are generated infinite number of times then a proportion p of them will be the concerned new state (0,0) (1,1) Uniform distribution Of [0,1] (0,0) (0,1) (0,p)

  12. Why? (contd) • If numbers in the range [0,1] are generated randomly, p% of them will be in the range [0,p]. Hence this process can simulate the state generation process (0,0) (1,1) Uniform distribution Of [0,1] (0,0) (0,1) (0,p)

  13. Compare with Roulette Wheel Algorithm for Selection Acknowledgement: http://www.edc.ncl.ac.uk/highlight/rhjanuary2007g02.php/

  14. Roulette Wheel Selection Let i = 1, where i denotes chromosome index; Calculate P(xi) using proportional selection; sum = P(xi); choose r ~ U(0,1); whilesum < rdo i = i + 1; i.e. next chromosome sum = sum + P(xi); end returnxias one of the selected parent; repeatuntil all parents are selected

  15. Significance of “temperature” • We have a pseudo temperature T • As T increases so does • T is a parameter in the algorithm • When stuck in the local minima, we increase the temperature • The probability of going to a higher energy state increases • Shaken out of local minima • Similar to annealing of metal

  16. Annealing of Metal The metal should have a stable crystal structure so that it is not brittle For this it is repeatedly heated and then cooled slowly

More Related