Chapter 1 Writing Your First Genetic Algorithm
Genetic Algorithms in Elixir — by Sean Moriarity (9 / 101)
👈 How Does Elixir Fit In? | TOC | Understanding Genetic Algorithms 👉
In a world of competition, people are always searching for the best. The best job, the best diet, the best financial plan, and so on. Unfortunately, with so many options, it’s impossible to make the best decisions all the time. Fortunately, humans have evolved to navigate the complexity of everyday life and make informed decisions that ultimately lead to success.
While your brain is naturally wired to make informed decisions, computers are not. Computers are naive — they can only do what you program them to do. So how do you program a computer to make informed decisions, and why is this even necessary?
Consider this example: you’re tasked with designing the shipping route for a large shipping company. You’re given a list of fifteen cities and your job is to pick the shortest route between them to save the company money on gas and travel expenses. At first, you might think it’s best to calculate every possible path between the cities — there’re only fifteen. Unfortunately, the number of possible paths is 130,766,744,000,000 — that’s 130 trillion. This problem is an example of the traveling salesman problem. The goal of the traveling salesman problem is to find the shortest route between a designated number of cities.