Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.


C++ Machine Learning Algorithms Inspired by Nature

via Udemy


Study the Genetic Algorithm, Simulated Annealing, Ant Colony Optimization, Differential Evolution by Coding from Scratch

What you'll learn:
  • Genetic Algorithm in C++
  • Simulated Annealing
  • Differential Evolution
  • Ant Colony Optimization

This online course is for students and software developers who want to level up their skills by learning interesting optimization algorithms in C++.

You will learn some of the most famous AI algorithms by writing it in C++ from scratch, so we will not use any libraries. We will start with the Genetic Algorithm (GA), continue with Simulated Annealing (SA) and then touch on a less known one: Differential Evolution. Finally, we will look at Ant Colony Optimization (ACO).

The Genetic Algorithm is the most famous one in a class called metaheuristics or optimization algorithms. You will learn what optimization algorithms are, when to use them, and then you will solve two problems with the Genetic Algorithm(GA). The second most famous one is Simulated Annealing.

However, nature gives us fascinating sources of inspiration, such as the behaviour of ants, so that Ant Colony Optimization is an interesting algorithm as well.

We will solve continuous problems(find the maximum/minimum of a continuous function) and discrete problems, such as the Travelling Salesperson Problem (TSP), where you have to find the shortest path in a network of cities, or the Knapsack Problem.


  • understand basic C++

  • any C++ IDE(I am using Visual Studio)

  • understanding of algorithms

  • understand mathematics

I recommend that you do the examples yourself, instead of passively watching the videos.

Here's a brief outline of what you will learn:

  • What optimization algorithms are

  • Genetic Algorithm theory:

    • General structure

    • How crossover is done

    • How mutation is done

  • Genetic Algorithm on a continuous problem:

    • Challenges particular to continuous problems: decoding the bits ("chromosomes") into a float value

    • Crossover: tournament selection and single point crossover

    • Mutation

  • Genetic Algorithm on the TSP (Travelling Salesperson Problem):

    • Creating a fitness function for the TSP

    • Challenge particular to this problem:how to do crossover?

    • Mutation

  • Simulated Annealing:

    • Basic Theory

    • Optimizing Himmelblau's function

    • The knapsack problem

  • Differential Evolution:

    • Theory and different strategies

    • Code example on one strategy, the standard one (DE/rand/1/bin)

  • Ant Colony Optimization:

    • Theory and Inspiration

    • Example on the Travelling Salesperson Problem

Sign up now and let's get started!

Taught by

Serban Stoenescu


4 rating at Udemy based on 40 ratings

Start your review of C++ Machine Learning Algorithms Inspired by Nature

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.