Skip to main content

University faculty member — Ph.D. in Artificial Intelligence and Robotics

اللّهُمَّ عَجِّلْ لِوَلِیِّکَ الْفَرَج

Interactive AI Lab

See important AI algorithms come alive and experiment with them: a genetic algorithm that evolves a solution to the N-Queens puzzle generation by generation, an algorithm that uncovers hidden groups in a social network, search algorithms that find their way out of a maze, and chess against an AI that thinks with adversarial search (minimax and alpha-beta) and shows you its thoughts. Everything runs in your browser.

Best fitness Population average Goal

Run console genetic.log
    Generation
    0
    Best fitness
    —
    Attacking pairs
    —
    Average fitness
    —

    How it works

    A genetic algorithm imitates natural evolution: it starts from a population of random solutions, selects the fittest, combines them (crossover), changes them slightly at random (mutation), and repeats generation after generation. In the N-Queens puzzle, N queens must be placed on an N×N board so that no two attack each other. An individual's fitness is the number of queen pairs that do not attack each other; red lines show the attacks that remain.

    This is the classic example from Russell & Norvig, the textbook of my AI course. Try a mutation rate of zero: the population can lose its diversity and get stuck just short of a solution. AI course materials