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.

Expanded at each depthFrom the goal (bidirectional)

Run console 8-puzzle.log
    Nodes expanded
    0
    Largest frontier (memory)
    —
    Solution (moves)
    —
    Cost
    —
    Solvable?
    —

    How it works

    Uninformed (blind) search knows nothing about how far a state is from the goal: it can only tell the goal when it sees it, and the algorithms differ only in the order they expand nodes. Breadth-first goes layer by layer and finds the shortest solution, but its frontier grows like b^d. Depth-first dives down one branch: very little memory, but its solution can be absurdly long. Depth-limited search stops at a fixed depth; iterative deepening tries limits 0, 1, 2 … and gets the best of both — the shortest solution with the memory of depth-first — at the price of re-expanding the shallow levels (see the chart). Uniform-cost search expands the cheapest path first and stays optimal when moves cost different amounts. Bidirectional search runs from both ends and meets in the middle: about 2·b^(d/2) nodes instead of b^d.

    The 8-puzzle has 9!/2 = 181,440 reachable states; the other half can never be reached, because a move never changes the parity of inversions. Press “Make it unsolvable” and see which algorithms can tell there is no solution (completeness). Compare with A* in the “Search Algorithms” tab, which uses a heuristic. AI course materials