final project presentation - massachusetts institute of...
TRANSCRIPT
![Page 1: Final Project Presentation - Massachusetts Institute of ...courses.csail.mit.edu/18.337/2010/projects/slides/... · C. Optimization D. Rate of Convergence IV. Conclusion . 3 . Find](https://reader034.vdocuments.site/reader034/viewer/2022042116/5e9400b62639c63e8738add3/html5/thumbnails/1.jpg)
Fan Yang 6.338 Final Project
Professor Edelman
![Page 2: Final Project Presentation - Massachusetts Institute of ...courses.csail.mit.edu/18.337/2010/projects/slides/... · C. Optimization D. Rate of Convergence IV. Conclusion . 3 . Find](https://reader034.vdocuments.site/reader034/viewer/2022042116/5e9400b62639c63e8738add3/html5/thumbnails/2.jpg)
Outline 2
I. Introduction A. The Traveling Salesman Problem B. Simulated Annealing C. Genetic Algorithm
II. Methods III. Results
A. Running Time B. Parallel Speedup C. Optimization D. Rate of Convergence
IV. Conclusion
![Page 3: Final Project Presentation - Massachusetts Institute of ...courses.csail.mit.edu/18.337/2010/projects/slides/... · C. Optimization D. Rate of Convergence IV. Conclusion . 3 . Find](https://reader034.vdocuments.site/reader034/viewer/2022042116/5e9400b62639c63e8738add3/html5/thumbnails/3.jpg)
3
![Page 4: Final Project Presentation - Massachusetts Institute of ...courses.csail.mit.edu/18.337/2010/projects/slides/... · C. Optimization D. Rate of Convergence IV. Conclusion . 3 . Find](https://reader034.vdocuments.site/reader034/viewer/2022042116/5e9400b62639c63e8738add3/html5/thumbnails/4.jpg)
Find the shortest route that goes through a set of nodes (cities).
Traveling Salesman Problem 4
Figure 1: An example of the traveling salesman problem.
![Page 5: Final Project Presentation - Massachusetts Institute of ...courses.csail.mit.edu/18.337/2010/projects/slides/... · C. Optimization D. Rate of Convergence IV. Conclusion . 3 . Find](https://reader034.vdocuments.site/reader034/viewer/2022042116/5e9400b62639c63e8738add3/html5/thumbnails/5.jpg)
Simulated Annealing
1. Start with a state with some initial energy 2. Reduce the energy at each iteration via state
transitions (neighbor functions & acceptance function)
3. Terminate after some iteration count or low energy threshold achieved
5
![Page 6: Final Project Presentation - Massachusetts Institute of ...courses.csail.mit.edu/18.337/2010/projects/slides/... · C. Optimization D. Rate of Convergence IV. Conclusion . 3 . Find](https://reader034.vdocuments.site/reader034/viewer/2022042116/5e9400b62639c63e8738add3/html5/thumbnails/6.jpg)
Serial Simulated Annealing Algorithm
Initialization: Generate a random candidate route and calculate energy for the route.
Repeat following steps: Neighbor function: Generate a neighbor route by
exchanging a pair of cities. Acceptance function: Evaluate the neighbor route for
acceptance - if accepted, replace current route with neighbor route
6
![Page 7: Final Project Presentation - Massachusetts Institute of ...courses.csail.mit.edu/18.337/2010/projects/slides/... · C. Optimization D. Rate of Convergence IV. Conclusion . 3 . Find](https://reader034.vdocuments.site/reader034/viewer/2022042116/5e9400b62639c63e8738add3/html5/thumbnails/7.jpg)
Parallel Simulated Annealing Algorithm
1. On each thread: Initialization: Generate a random candidate route
and calculate energy for the route. Repeat following steps:
if ITERATION_COUNT != CONVERGING_COUNT Neighbor function: Generate a neighbor route by exchanging a pair of
cities. Acceptance function: Evaluate the neighbor route for acceptance - if
accepted, replace current route with neighbor route Else
MPI_BARRIER: share the best result among threads by sending all the results to root and have root broadcast the best result
2. MPI_BARRIER: return the best result among all the threads
7
![Page 8: Final Project Presentation - Massachusetts Institute of ...courses.csail.mit.edu/18.337/2010/projects/slides/... · C. Optimization D. Rate of Convergence IV. Conclusion . 3 . Find](https://reader034.vdocuments.site/reader034/viewer/2022042116/5e9400b62639c63e8738add3/html5/thumbnails/8.jpg)
Genetic Algorithm
1. Start with a population of routes 2. At each iteration, replace the worst routes with the
children of the best routes 3. Terminate after some iteration count
8
![Page 9: Final Project Presentation - Massachusetts Institute of ...courses.csail.mit.edu/18.337/2010/projects/slides/... · C. Optimization D. Rate of Convergence IV. Conclusion . 3 . Find](https://reader034.vdocuments.site/reader034/viewer/2022042116/5e9400b62639c63e8738add3/html5/thumbnails/9.jpg)
Serial Genetic Algorithm
Initialization: Generate N random candidate routes and calculate fitness value for each route.
Repeat following steps: Selection: Select two best candidate routes. Reproduction: Reproduce two routes from the best
routes. Generate new population: Replace the two worst
routes with the new routes.
9
![Page 10: Final Project Presentation - Massachusetts Institute of ...courses.csail.mit.edu/18.337/2010/projects/slides/... · C. Optimization D. Rate of Convergence IV. Conclusion . 3 . Find](https://reader034.vdocuments.site/reader034/viewer/2022042116/5e9400b62639c63e8738add3/html5/thumbnails/10.jpg)
Parallel Genetic Algorithm
1. On each thread: Initialization: Generate N random candidate routes and
calculate fitness value for each route. Repeat following steps:
if ITERATION_COUNT != CONVERGING_COUNT Selection: Select two best candidate routes. Reproduction: Reproduce two routes from the best routes. Generate new population: Replace the two worst routes with the
new routes. Else
MPI_BARRIER: share the best result among threads by sending all the results to root and have root broadcast the best result
2. MPI_BARRIER – return the best result among all the thread
10
![Page 11: Final Project Presentation - Massachusetts Institute of ...courses.csail.mit.edu/18.337/2010/projects/slides/... · C. Optimization D. Rate of Convergence IV. Conclusion . 3 . Find](https://reader034.vdocuments.site/reader034/viewer/2022042116/5e9400b62639c63e8738add3/html5/thumbnails/11.jpg)
11
![Page 12: Final Project Presentation - Massachusetts Institute of ...courses.csail.mit.edu/18.337/2010/projects/slides/... · C. Optimization D. Rate of Convergence IV. Conclusion . 3 . Find](https://reader034.vdocuments.site/reader034/viewer/2022042116/5e9400b62639c63e8738add3/html5/thumbnails/12.jpg)
Methods
C with MPI on Beowulf cluster (using 1 to 8 nodes)
Genetic Algorithm: Iterations: 100,000
population count: 1000
Simulated Annealing Iterations: 1,000,000
Start temperature: 10.0
Cooling constant: 0.9999
For each condition, we conducted a total of 10 trials.
Distances were computed as Euclidean distances.
12
CITIES COORDINATES (X, Y)
a (110, 54)
b (236, 110)
c (153, 151)
d (227, 49)
e (307, 176)
f (220, 211)
g (341, 90)
h (149, 91)
i (335, 40)
j (371, 150)
k (218, 161)
l (334, 239)
m (148, 227)
n (49, 128)
o (183, 39)
![Page 13: Final Project Presentation - Massachusetts Institute of ...courses.csail.mit.edu/18.337/2010/projects/slides/... · C. Optimization D. Rate of Convergence IV. Conclusion . 3 . Find](https://reader034.vdocuments.site/reader034/viewer/2022042116/5e9400b62639c63e8738add3/html5/thumbnails/13.jpg)
13
![Page 14: Final Project Presentation - Massachusetts Institute of ...courses.csail.mit.edu/18.337/2010/projects/slides/... · C. Optimization D. Rate of Convergence IV. Conclusion . 3 . Find](https://reader034.vdocuments.site/reader034/viewer/2022042116/5e9400b62639c63e8738add3/html5/thumbnails/14.jpg)
Running time results 14
Figure 2: Simulated annealing algorithm running time. The running time decreases as the number of processors increases.
![Page 15: Final Project Presentation - Massachusetts Institute of ...courses.csail.mit.edu/18.337/2010/projects/slides/... · C. Optimization D. Rate of Convergence IV. Conclusion . 3 . Find](https://reader034.vdocuments.site/reader034/viewer/2022042116/5e9400b62639c63e8738add3/html5/thumbnails/15.jpg)
Figure 3: Genetic algorithm running time. The running time decreases as the number of processors increases.
Running time results 15
![Page 16: Final Project Presentation - Massachusetts Institute of ...courses.csail.mit.edu/18.337/2010/projects/slides/... · C. Optimization D. Rate of Convergence IV. Conclusion . 3 . Find](https://reader034.vdocuments.site/reader034/viewer/2022042116/5e9400b62639c63e8738add3/html5/thumbnails/16.jpg)
Parallel speedup results 16
Figure 4: Simulated annealing algorithm parallel speedup. There is a near-linear parallel speedup. The curve approximates an ideal linear line at all points.
![Page 17: Final Project Presentation - Massachusetts Institute of ...courses.csail.mit.edu/18.337/2010/projects/slides/... · C. Optimization D. Rate of Convergence IV. Conclusion . 3 . Find](https://reader034.vdocuments.site/reader034/viewer/2022042116/5e9400b62639c63e8738add3/html5/thumbnails/17.jpg)
Parallel speedup results 17
Figure 5: Genetic algorithm parallel speedup. There is a near-linear parallel speedup. The scalability deteriorates slightly at 7-8 processors.
![Page 18: Final Project Presentation - Massachusetts Institute of ...courses.csail.mit.edu/18.337/2010/projects/slides/... · C. Optimization D. Rate of Convergence IV. Conclusion . 3 . Find](https://reader034.vdocuments.site/reader034/viewer/2022042116/5e9400b62639c63e8738add3/html5/thumbnails/18.jpg)
Optimization results 18
Figure 6: Simulated annealing algorithm distance results. The distance of the shortest route decreases as the number of processors increases. The anomaly at processor #5 is most likely due to an outlier in the raw data points, which is also indicated by the large standard deviation.
![Page 19: Final Project Presentation - Massachusetts Institute of ...courses.csail.mit.edu/18.337/2010/projects/slides/... · C. Optimization D. Rate of Convergence IV. Conclusion . 3 . Find](https://reader034.vdocuments.site/reader034/viewer/2022042116/5e9400b62639c63e8738add3/html5/thumbnails/19.jpg)
Optimization results 19
Figure 7: Genetic algorithm distance results. The distance of the shortest route decreases as the number of processors increases.
![Page 20: Final Project Presentation - Massachusetts Institute of ...courses.csail.mit.edu/18.337/2010/projects/slides/... · C. Optimization D. Rate of Convergence IV. Conclusion . 3 . Find](https://reader034.vdocuments.site/reader034/viewer/2022042116/5e9400b62639c63e8738add3/html5/thumbnails/20.jpg)
Figure 8: Simulated annealing algorithm convergence running time. There is a gradual increase in running time as the rate of convergence increases. The running time exceeds the serial implementation at a convergence rate of 35%.
Rate of convergence: running time results 20
![Page 21: Final Project Presentation - Massachusetts Institute of ...courses.csail.mit.edu/18.337/2010/projects/slides/... · C. Optimization D. Rate of Convergence IV. Conclusion . 3 . Find](https://reader034.vdocuments.site/reader034/viewer/2022042116/5e9400b62639c63e8738add3/html5/thumbnails/21.jpg)
Figure 9: Genetic algorithm convergence running time. There is a gradual increase in running time as the rate of convergence increases. The running time exceeds the serial implementation at a convergence rate of 15%.
Rate of convergence: running time results 21
![Page 22: Final Project Presentation - Massachusetts Institute of ...courses.csail.mit.edu/18.337/2010/projects/slides/... · C. Optimization D. Rate of Convergence IV. Conclusion . 3 . Find](https://reader034.vdocuments.site/reader034/viewer/2022042116/5e9400b62639c63e8738add3/html5/thumbnails/22.jpg)
Figure 10: Simulated annealing convergence distance results. The distance of the shortest route decreases as we increase the rate of convergence. The shortest distance plateaus beginning at a 10% rate of convergence.
Rate of convergence: optimization results 22
![Page 23: Final Project Presentation - Massachusetts Institute of ...courses.csail.mit.edu/18.337/2010/projects/slides/... · C. Optimization D. Rate of Convergence IV. Conclusion . 3 . Find](https://reader034.vdocuments.site/reader034/viewer/2022042116/5e9400b62639c63e8738add3/html5/thumbnails/23.jpg)
Figure 11: Genetic algorithm convergence distance results. The distance of the shortest route decreases as we increase the convergence rate. The shortest distance plateaus beginning at a 5% rate of convergence.
Rate of convergence: optimization results 23
![Page 24: Final Project Presentation - Massachusetts Institute of ...courses.csail.mit.edu/18.337/2010/projects/slides/... · C. Optimization D. Rate of Convergence IV. Conclusion . 3 . Find](https://reader034.vdocuments.site/reader034/viewer/2022042116/5e9400b62639c63e8738add3/html5/thumbnails/24.jpg)
Good parallel speedup in both algorithms Genetic algorithm achieves slightly better
results o More mutations in each iteration is better
Higher rate of convergence improves route optimization results but also increases the running time.
24
![Page 25: Final Project Presentation - Massachusetts Institute of ...courses.csail.mit.edu/18.337/2010/projects/slides/... · C. Optimization D. Rate of Convergence IV. Conclusion . 3 . Find](https://reader034.vdocuments.site/reader034/viewer/2022042116/5e9400b62639c63e8738add3/html5/thumbnails/25.jpg)
25