
Study graph algorithms and meta-heuristics in Python, including breadth-first search, a-star, genetic algorithms, and particle swarm optimization. Tackle problems like n-queens, Sudoku, and traveling salesman with optimization and reinforcement learning.
Explore why graph algorithms underpin AI, showing how many problems reduce to path finding, with examples from games, robotics, and game trees, and highlight A* and BFS as key tools.
Explore breadth-first search, a graph traversal algorithm that visits vertices level by level using a queue, reveals shortest paths with unweighted edges, and highlights memory considerations.
Learn a concrete breadth-first search implementation using a node class with an adjacency list, a visited flag, and a queue to visit graph vertices and neighbors.
Explore breadth-first search applications across pathfinding, maximum flow via Edmonds-Karp, Python garbage collection with reference counting, and chain algorithm–assisted traversal for heap memory.
Learn how web crawlers use a breakfast search to crawl web, modeling sites as a directed graph of links, parsing html sources, following urls, and ranking pages with page rank.
Implement a simple web crawler in Python using the requests library and regular expressions to fetch HTML, extract links, and perform a breadth-first search while avoiding revisits.
Explore depth-first search, a graph traversal that visits each vertex once by going as far as possible before backtracking, using iterative stacks or recursion with linear time and memory complexity.
Construct a node class with a name, adjacency list, and visited flag, then implement depth-first search with a stack to traverse the graph from a starting vertex.
Depth-first search implemented with recursion uses the system stack to visit vertices via adjacency lists, printing nodes and recursing on unvisited neighbors.
Visualize depth-first search as recursive calls, tracing stack frames from vertex a through b, d, e, then backtracking to a and c to complete the search.
Compare memory usage of graph traversal approaches, focusing on breadth search and first search. Breadth search uses linear memory, while first search uses logarithmic memory on balanced trees.
Explore depth-first search applications in graphs, including pathfinding, topological ordering, and identifying strongly connected components. See how cycle detection helps avoid deadlocks in operating systems.
Introduce the maze problem and backtracking on a 2D board with obstacles, from the top-left to bottom-right, contrasting brute-force search with graph algorithms like shortest-path or star search.
Implement the maze problem from scratch in Python with a Maze class, a 2d maze and solution matrix, solving from top-left to bottom-right via backtracking (0 obstacles, 1 valid).
Shows solving a maze with recursion and stack memory visualization, moving right or down from the top left to the bottom right, while marking visited cells and backtracking.
Explore the A* search algorithm, its cost function f(x)=g(x)+h(x), and how admissible and consistent heuristics guide shortest-path planning with Manhattan and Euclidean distances in grids with obstacles.
Illustrates A* search on a grid, with diagonal moves costing 14 and straight moves 10, from a red start to a green goal, updating g and h to compute f.
implement a star search on a directed weighted graph, using nodes with positions and neighbors, edges with weights, and a heap to manage f = g + h.
Implement the a* search algorithm by initializing start and goal, maintaining explored set and heap, computing f = g + h with Euclidean distance, updating predecessors, and reconstructing shortest path.
Test whether the A* search algorithm works by defining a main function and a graph with vertices, edges, weights, and coordinates, then find and display the shortest path.
Demonstrate pathfinding on a grid with obstacles by comparing breadth first search, a star search with euclidean distance, and baskas algorithm that computes shortest paths from start to all vertices.
Explore why NP-hard problems like the traveling salesman resist exact solutions and how meta-heuristic approaches yield fast, approximate results using genetic algorithms, simulated annealing, tabu search, and swarm optimization.
Explore simulated annealing, a metaheuristic that avoids local optima by accepting bad moves via the metropolis function at high temperature and cooling to reach the global optimum.
explains simulated annealing to maximize and minimize a simple one-dimensional function on [-2, 2], detailing temperature-based acceptance, cooling, and state updates before tackling complex problems like the traveling salesman.
Implement the simulated annealing loop by generating the next state, computing actual and new energies, and applying the metropolis acceptance with temperature cooling to maximize the function.
Run and validate the Python simulated annealing implementation, testing the interval [-2, 2] with a temperature range from 100 to 1e-5, and explain acceptance probability and cooling dynamics.
This course is about the fundamental concepts of artificial intelligence and meta-heuristics with Python. This topic is getting very hot nowadays because these learning algorithms can be used in several fields from software engineering to investment banking. Learning algorithms can recognize patterns which can help detecting cancer for example. We may construct algorithms that can have a very good guess about stock price movement in the market.
### PATHFINDING ALGORITHMS ###
Section 1 - Breadth-First Search (BFS)
what is breadth-first search algorithm
why to use graph algorithms in AI
Section 2 - Depth-First Search (DFS)
what is depth-first search algorithm
implementation with iteration and with recursion
depth-first search stack memory visualization
maze escape application
Section 3 - A* Search Algorithm
what is A* search algorithm
what is the difference between Dijkstra's algorithm and A* search
what is a heuristic
Manhattan distance and Euclidean distance
### META-HEURISTICS ###
Section 4 - Simulated Annealing
what is simulated annealing
how to find the extremum of functions
how to solve combinatorial optimization problems
travelling salesman problem (TSP)
solving the Sudoku problem with simulated annealing
Section 5 - Genetic Algorithms
what are genetic algorithms
artificial evolution and natural selection
crossover and mutation
solving the knapsack problem and N queens problem
Section 6 - Particle Swarm Optimization (PSO)
what is swarm intelligence
what is the Particle Swarm Optimization algorithm
### GAMES AND GAME TREES ###
Section 7 - Game Trees
what are game trees
how to construct game trees
Section 8 - Minimax Algorithm and Game Engines
what is the minimax algorithm
what is the problem with game trees?
using the alpha-beta pruning approach
chess problem
Section 9 - Tic Tac Toe with Minimax
Tic Tac Toe game and its implementation
using minimax algorithm
using alpha-beta pruning algorithm
### REINFORCEMENT LEARNING ###
Markov Decision Processes (MDPs)
reinforcement learning fundamentals
value iteration and policy iteration
exploration vs exploitation problem
multi-armed bandits problem
Q learning algorithm
learning tic tac toe with Q learning
### PYTHON PROGRAMMING CRASH COURSE ###
Python programming fundamentals
basic data structures
fundamentals of memory management
object oriented programming (OOP)
NumPy
In the first chapters we are going to talk about the fundamental graph algorithms - breadth-first search (BFS), depth-first search (DFS) and A* search algorithms. Several advanced algorithms can be solved with the help of graphs, so in my opinion these algorithms are crucial.
The next chapters are about heuristics and meta-heuristics. We will consider the theory as well as the implementation of simulated annealing, genetic algorithms and particle swarm optimization - with several problems such as the famous N queens problem, travelling salesman problem (TSP) etc.
Thanks for joining the course, let's get started!