1 / 19

Willy’s Bane

Willy’s Bane. A simulated annealing approach to the travelling salesman problem. Brian Babcock Trevor Blanarik. Travelling Salesman. We need to visit a set of cities, each only once, using the shortest path possible.

usoa
Download Presentation

Willy’s Bane

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. Willy’s Bane A simulated annealing approach to the travelling salesman problem Brian BabcockTrevor Blanarik

  2. Travelling Salesman • We need to visit a set of cities, each only once, using the shortest path possible. • There are several approaches to this problem, we chose to use simulated annealing.

  3. Simulated Annealing • Named after metallurgic annealing • Metal is heated until glowing and then gradually cooled. • Randomly switches two cities • ‘Temperature’ slowly reduces toward zero • May accept a worse solution, depends on current temperature • A high temperature will accept a very large uphill change – a low temperature will not

  4. Sequential • Set up a single simulated annealing run using a single temperature and cooling rate • Simulated annealing ends when a better result has not been found after 100 iterations • Resulting path is printed to a Drawing file

  5. Parallel • SMP, sizeup • Same as the sequential version, except each thread uses a different temperature. • After a run of SA, each thread checks to see if its new path is shorter than the current best path. • Shared variable • Threads exit when every thread has failed at least three times in a row • Acts like several SAs wrapped in a hill-climbing algorithm

  6. Metrics Inputs: 50 Cities on a grid 500 x 1000 units. A fixed initial configuration is created with a seed of 1 for the random number generator. Initial length = 20038.51133626955

  7. Metrics

  8. Metrics Varying cooling schedules

  9. Metrics Varying cooling schedules

  10. Initial Random Tour Length = 20038

  11. Sequential Result Length = 5861

  12. SMP 1 Thread Length = 5988.244

  13. SMP 2 Threads Length = 5749.68

  14. SMP 4 Threads Length = 5526.10

  15. SMP 8 Threads Length = 4802.435

  16. What We Learned • A group of parallel threads acts like a ‘search party’ – they keep each other on the right track, toward the optimal answer. • Sometimes 2 threads will arrive at the very same solution, independently of each other. • Choosing 2 cities to swap at random, rather than choosing 2 neighboring cities is much faster and gets much better answers.

  17. What We Learned • Time can be pretty unpredictable with an algorithm like this – since every move is random, the algorithm could end up in a local optimum early on, and end quickly. • Or, it could gradually find better answers and take a very long time. • Having more threads tends to help it converge to a much better solution, but often at the expense of time.

  18. Future Work • Cluster version • Communication required to keep shared ‘best path’ variable updated. • Different cooling rates • A speedup version which parallelizes the SA loop

  19. Sources • Nourani, Yaghout, and Bjarne Andresen. "A comparison of simulated annealing      cooling strategies." J. Phys. A: Math 31 (1998): 8373–8385. • SREENIVAS, T H, K GANAPATHY SUBRAMANIAM, and D. JANAKI RAM. "Parallel Simulated      Annealing Algorithms." JOURNAL OF PARALLEL AND DISTRIBUTED COMPUTING 37      (1996): 207-212.

More Related