Fan Yang 6.338 Final Project Professor Edelman Outline 2 - - PowerPoint PPT Presentation

fan yang 6 338 final project professor edelman outline
SMART_READER_LITE
LIVE PREVIEW

Fan Yang 6.338 Final Project Professor Edelman Outline 2 - - PowerPoint PPT Presentation

Fan Yang 6.338 Final Project Professor Edelman Outline 2 Introduction I. The Traveling Salesman Problem A. Simulated Annealing B. Genetic Algorithm C. II. Methods III. Results Running Time A. Parallel Speedup B. Optimization C. Rate of


slide-1
SLIDE 1

Fan Yang 6.338 Final Project Professor Edelman

slide-2
SLIDE 2

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
slide-3
SLIDE 3

3

slide-4
SLIDE 4

Find the shortest route that goes through a set

  • f nodes (cities).

Traveling Salesman Problem

4

Figure 1: An example of the traveling salesman problem.

slide-5
SLIDE 5

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

slide-6
SLIDE 6

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

slide-7
SLIDE 7

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

slide-8
SLIDE 8

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

slide-9
SLIDE 9

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

slide-10
SLIDE 10

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

slide-11
SLIDE 11

11

slide-12
SLIDE 12

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)

  • (183, 39)
slide-13
SLIDE 13

13

slide-14
SLIDE 14

Running time results

14

Figure 2: Simulated annealing algorithm running time. The running time decreases as the number of processors increases.

slide-15
SLIDE 15

Figure 3: Genetic algorithm running time. The running time decreases as the number of processors increases.

Running time results

15

slide-16
SLIDE 16

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.

slide-17
SLIDE 17

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.
slide-18
SLIDE 18

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.

slide-19
SLIDE 19

Optimization results

19

Figure 7: Genetic algorithm distance results. The distance of the shortest route decreases as the number of processors increases.

slide-20
SLIDE 20

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

slide-21
SLIDE 21

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

slide-22
SLIDE 22

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

slide-23
SLIDE 23

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

slide-24
SLIDE 24

 Good parallel speedup in both algorithms  Genetic algorithm achieves slightly better

results

  • More mutations in each iteration is better

 Higher rate of convergence improves route

  • ptimization results but also increases the

running time.

24

slide-25
SLIDE 25

25