
Explore why genetic algorithms complement deep learning and learn to implement them from scratch in Python, using a fitness function, crossover, mutation, and selection.
Plan to implement a genetic algorithm in Python from scratch, without libraries, evolving from theory to a complete practical algorithm, including fitness function, crossover, mutation, population, selection, and database integration.
Compare evolutionary algorithms and genetic algorithms, with genetic algorithms as a branch of evolutionary algorithms. Learn the flow: initialize a population, evaluate, run generations, and apply selection, crossover, mutation.
Apply genetic algorithms to a transport optimization case study, selecting the most profitable products that fit a truck's 3 cubic meter capacity and maximize value.
Define a product class in Python, initialize attributes (name, space, price), instantiate objects, and build a 14-item products list for the genetic algorithms.
Create the individual class to represent solutions in a genetic algorithm using a chromosome. The chromosome uses zeros and ones to indicate loaded products, creating a random initial population.
Evaluate the fitness function to measure chromosome quality and maximize profits by selecting products within the truck capacity.
Explore how crossover, a genetic operator in genetic algorithms, combines chromosomes from two parents at a one-point cut point to create diverse children and drive evolution.
Implement and test crossover in a genetic algorithm by combining two individuals' chromosomes at a randomly chosen cutoff point, generating child chromosomes and evolving to the next generation.
Learn how mutation introduces diversity in a genetic algorithm by randomly flipping bits in a chromosome, using small probabilities after crossover, with practical Python implementation.
Initialize the population by creating multiple random individuals, each with a binary chromosome representing a solution, and set the population size to determine how many individuals participate.
Evaluate each population member with the fitness function to compute total price and used space. Sort by score and place best at the first position for the next 20-member population.
Explore implementing the next step of a genetic algorithm by evaluating and ordering the population, and updating the best solution when a higher scoring individual is found.
Implement a function to sum the score evaluations of all individuals in the population, returning total fitness to guide parent selection for crossover and mutation.
Select the best individuals by their high values to form the next generation, while preserving diversity with probabilistic selection using the roulette wheel method.
Implement roulette method to choose parents in a genetic algorithm, using a random value and sum of evaluations to favor better solutions while preserving diversity for crossover and mutation.
Build a new generation in a genetic algorithm by applying crossover and mutation, evaluate the population, and select parents to create evolving generations.
Implement a visualize generation function for a Python genetic algorithm to display partial results, evaluate individuals, and highlight the best in each generation across multiple runs.
Implement a full genetic algorithm by initializing the population, evaluating fitness, selecting parents, applying crossover and mutation, and running generations to find the best solution.
Visualize genetic algorithm progress by plotting the best solution per generation on a line graph from zero to 100 generations, and explore how changing population size and generations affects results.
Install MySQL, Anaconda, and PyCharm on your machine, connect Python to a local database with MySQL Workbench, and set up environments to integrate the genetic algorithm.
Create a products database and a products table with product_id as auto_increment primary key, plus product_name, price, and quantity, then insert and verify sample data.
Learn to connect a genetic algorithm to a MySQL database, fetch product data, and run a GA across generations to optimize truck loading, with plotting of results.
Plan to apply genetic algorithms in Python using pre-built libraries, compare to from-scratch implementations, and solve transportation profit maximization and airline ticket price minimization.
Explore solving a transport optimization problem with the deap library, comparing its genetic algorithm results to a from-scratch approach, covering fitness functions, cost, population, crossover, mutation, and selection.
Finish implementing a genetic algorithm with the deap library to optimize product transportation, using booleans for loading decisions, a 20-member population, 100 generations, and full statistics.
Explore the mlrose library to solve optimization problems with genetic algorithms, including setting up data, defining a fitness function, and tuning population size and mutation probability to maximize outcomes.
Explore a flight schedule optimization case study to minimize airline costs for six travelers meeting in Rome, selecting the cheapest outbound and return flights across six european cities.
We define people and airports, build a flights dictionary by origin and destination, and load flight data to minimize price for Rome routes.
Encode each person’s two flights as integers to represent the schedule and minimize the total price. Outline a fitness function and plan the genetic algorithm steps with the deep library.
solve the flight schedule problem with the deap library in python by defining toolbox, fitness, and individuals to minimize total price using crossover, mutation, and an order-based star ornaments selection.
Use a genetic algorithm with Melrose library to solve the flight schedule problem. Define a fitness function for a 12-length solution (six people, two flights each) and compare results.
Review genetic algorithms in Python from scratch, discuss core issues, and apply to transport and flight schedule problems using new libraries and solver maximization and minimization.
Explore genetic algorithms in Python and broader artificial intelligence topics through AI Expert Academy’s online courses, featuring monthly new content, certificates, and a unique demonstration method for deeper understanding.
Genetic algorithms are an important area of Artificial Intelligence responsible for solving complex real world problems. There are several practical applications of this type of algorithm, which can be applied to problem solving in everyday business situations. A classic example is solving the problem of teacher schedule in schools, in which there are different combinations of schedules and classes and the goal is to build the schedule dynamically according to the number of classes and the availability of each teacher. Other examples are: telecommunications companies can design new optical networks, carriers can better plan the delivery route for goods, investors can choose the best investments; among several others.
In this course, you will learn everything you need to enter the world of genetic algorithms! What makes this course unique is that you will learn the basic intuition and especially, the step-by-step implementation without using pre-built libraries. In other words, we are going to implement genetic algorithms from scratch using Python. If you have never heard about this subject, at the end of the course you will have all the theoretical and practical basis to solve your own problems or the problems of the company you work for!
In part 1, we are going to implement a genetic algorithm from scratch to solve a very common problem that is related to transportation of products. Let's suppose we need to load some products on the truck, but we need to select the most profitable products and also take into account that there is not enough space on the truck to load them all. So, the goal of the genetic algorithm will be to choose the best set of products to maximize the profit of the company. At the end we will integrate our algorithm with a database in MySql, so it will be easier to know how to deal with commercial applications!
In part 2 (after you learn the whole intuition and implement genetic algorithms from scratch), it's time to learn how to work with libraries to solve the same problem. In addition to the case study of product transportation, we will also solve another problem that is related to finding the lowest prices of airline tickets for people traveling in group. We will solve both problems using two libraries: DEAP (Distributed Evolutionary Algorithms in Python) and MLROSe. The interesting is that we will be able to compare the results of the libraries with the results of our genetic algorithm implemented from scratch.
This can be considered the first course on genetic algorithms, and after completing it, you can move on to more advanced materials. At the end you will have the practical background to develop some simple projects and take more advanced courses. During the lectures, the code will be implemented step by step using Google Colab, which will ensure that you will have no problems with installations or configurations of software on your local machine.