Slide 1

Slide 1 text

1 Monkeys in the Machine Eric Mann

Slide 2

Slide 2 text

2 Hello. Eric Mann Director of Engineering, Vacasa

Slide 3

Slide 3 text

3 Concevons qu'on ait dressé un million de singes à frapper au hasard sur les touches d'une machine à écrire et que […] ces singes dactylographes travaillent avec ardeur dix heures par jour avec un million de machines à écrire de types variés. […] Au bout d'un an, [leurs] volumes se trouveraient renfermer la copie exacte des livres de toute nature et de toutes langues conservés dans les plus riches bibliothèques du monde. — Émile Borel

Slide 4

Slide 4 text

4 Let us imagine that a million monkeys have been trained to strike at random on the keys of a typewriter and that […] these typing monkeys work hard ten hours a day with a million typewriters of various types. […] At the end of a year, [their] volumes would find themselves containing the exact copy of books of all kinds and all languages kept in the richest libraries in the world. — Émile Borel (via Google Translate)

Slide 5

Slide 5 text

5

Slide 6

Slide 6 text

6 CREATE POPULATION EVALUATE FITNESS MUTATE REPRODUCE Randomly-initialized strings can eventually converge to meet a target string over several iterations of a random optimization algorithm over a large set of candidates. Evaluate how close each candidate is to the optimum Evaluate Fitness Initialize a collection of pseudrandom candidates Create Population Create a new candidate for the next generation Reproduce Mutate the new candidate so we can further optimize Mutate Genetic Algorithms

Slide 7

Slide 7 text

7 Image by GeeksforGeeks

Slide 8

Slide 8 text

8 PHP Demo

Slide 9

Slide 9 text

9 Genetic Algorithms In Review 1 We created a collection of entirely random strings, all the same length as our target text. Initialize Population 2 We measured the distance of each string from the target text. Evaluate Fitness 3 We used our “high fitness” members to create a new, somewhat less random child generation Reproduce 4 We mutated some children to introduce randomness and prevent local maxima. Mutate

Slide 10

Slide 10 text

10 The Traveling Salesman Problem Salesman must travel to all cities once before returning home. The distance between each city is given and is assumed to be the same in either direction. OBJECTIVE - Minimize the total distance traveled on the trip.

Slide 11

Slide 11 text

11 Wikimedia Commons

Slide 12

Slide 12 text

12 Genetic Algorithms Traveling Salesman 1 Create a “population” of randomly-ordered strings representing a route. Initialize Population 2 Measure the total distance traveled while traversing each route. Evaluate Fitness 3 We used our “high fitness” members to create a new, somewhat less random child generation Reproduce 4 Mutate by swapping the order of two cities in the route. Mutate

Slide 13

Slide 13 text

13 PHP Demo

Slide 14

Slide 14 text

14 Wikimedia Commons

Slide 15

Slide 15 text

15 Ant Colony Optimization Traveling Salesman 1 Drop an “ant” at a random city. Random Starting Point 2 The ant visits each city in turn at random, weighted by the attractiveness of each destination. “Attractiveness”-based Route 3 An ant deposits pheromone on each edge it travels, with an amount inversely proportional to the total distance travelled in its route. Calculate Pheromone Trail 4 The total pheromone for the next iteration is part left over from the first and part added to by the ants - repeat all steps until we converge. Evaporate and Repeat

Slide 16

Slide 16 text

16 PHP Demo

Slide 17

Slide 17 text

17 Ant Colony Optimization Traveling Salesman Vehicle Routing Job Ordering “Knapsack Problem” Nanoelectronics Design Image Processing Antenna Optimization Network Routing Protein Folding

Slide 18

Slide 18 text

18 Questions?

Slide 19

Slide 19 text

19 Thank You! [email protected] | 503.925.6266