ScholarQuill logoScholarQuillUniversity Notes
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
Study Tools
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
Contact
ScholarQuill logo
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
ScholarQuill logoScholarQuillUniversity Notes
Study PortalCOMP2121Minimax Algorithm
Ctrl + K
Login
Explore
Search
Semester
Papers
CGPA
    COMP2121

    Artificial Intelligence

    Progress0 / 19 done
    Topics19
    1An Introduction to Artificial Intelligence and its applications towards Knowledge Based Systems2Introduction to Reasoning and Knowledge Representation
    3Informed searching4Uninformed searching5Heuristics in Problem Solving6Local searching algorithms7Minimax algorithm8Alpha-beta pruning9Game-playing in AI
    10General Problem Solver11ELIZA12Student13Macsyma14Learning from examples15Artificial Neural Networks (ANN)16Natural Language Processing17Recent trends and applications of AI algorithms18Python programming for AI19Implementation of AI techniques in Python
    2 min read
    Topic 7 of 19
    Topic Study Note Illustration
    07

    Minimax algorithm

    The Minimax algorithm is used in two-player, turn-based, zero-sum games (like Tic-Tac-Toe, Chess, or Checkers). It helps AI choose the best move assuming the opponent also plays...

    📘 Problem Solving by Searching: Minimax Algorithm


    1. What is the Minimax Algorithm?

    The Minimax algorithm is used in two-player, turn-based, zero-sum games (like Tic-Tac-Toe, Chess, or Checkers). It helps AI choose the best move assuming the opponent also plays optimally.

    It aims to maximize the AI’s gain while minimizing the opponent’s gain — hence the name minimax.


    2. Key Concepts

    Term Explanation
    Maximizer The AI player, trying to get the highest score
    Minimizer The opponent, trying to minimize the AI’s score
    Utility Value Numeric score assigned to terminal states (win = +1, lose = –1, draw = 0)
    Game Tree A tree of all possible moves and their outcomes
    Zero-sum Game One player’s gain is another player’s loss

    3. How Minimax Works

    1. Generate the game tree from the current state.

    2. Evaluate terminal states using a utility function.

    3. Propagate values up the tree:

      • Max nodes choose the maximum value of their children.
      • Min nodes choose the minimum value of their children.
    4. Choose the move that leads to the best value at the root (AI's turn).


    4. Example: Simple Game Tree

              [AI]
              Max
             /    \
          Min     Min
         / \      / \
       +1  0    -1  +1
    
    • At Min nodes: pick the minimum child value → First Min: min(+1, 0) = 0 → Second Min: min(–1, +1) = –1

    • At Max (AI): pick the maximum of 0 and –1 → Best move = 0


    5. Time Complexity

    • Time: O(b^m)

      • b = branching factor (possible moves per turn)
      • m = maximum depth of the game tree
    • Space: O(m) for depth-first implementation


    6. Optimization: Alpha-Beta Pruning

    Minimax can be optimized with Alpha-Beta pruning, which:

    • Eliminates branches that don't need to be explored.
    • Reduces time complexity from O(b^m) to O(b^(m/2)) in the best case.

    ✅ Summary

    Concept Meaning
    Minimax Algorithm for two-player adversarial games
    Maximizer AI’s turn – aims to maximize utility
    Minimizer Opponent’s turn – aims to minimize AI’s score
    Game Tree All possible future game states
    Use Games like Tic-Tac-Toe, Chess, etc.
    Optimized by Alpha-Beta Pruning

    ← Previous topic 6
    Local searching algorithms
    Next topic 8 →
    Alpha-beta pruning

    Past Papers

    Open this section to view and download past papers

    Click on Show Past Papers to load available exam papers.

    Reading Progress
    0%
    2mremaining
    336words
    Beginnerlevel
    On This Page

    No headings found

    Study Toolkit

    Subject Portal

    Artificial Intelligence