Unit-4 Module - 2
Unit-4 Module - 2
B. Search Algorithms
1. Breadth-First Search (BFS):
o Explores all possible decisions level by level.
o Use Case: Finding shortest paths in graphs.
2. A Search*:
o Combines heuristic estimation with search for optimal solutions.
o Use Case: Pathfinding in robotics.
C. State Machines
1. Definition:
o Models decision-making as transitions between states based on input.
o Example:
▪ Traffic light control systems: Red → Green → Yellow.
D. Decision Trees
1. Definition:
o A tree-like structure where each node represents a decision point.
o Example:
▪ In medical diagnosis, symptoms lead to potential treatments.
2. Real-Time Example:
o Autonomous drones using decision trees for obstacle avoidance.
2. Checkers (Draughts)
Overview:
• Origin: Dates back to ancient Egypt (around 3000 BCE).
• Board: Played on an 8x8 board with alternating dark and light squares.
• Players: Two.
• Objective: Capture all opponent’s pieces or block them from making legal moves.
Rules:
1. Movement:
o Pieces move diagonally forward one square to an empty space.
2. Capturing:
o A piece can capture an opponent’s piece by jumping over it into an empty square
beyond.
3. Kinging:
o When a piece reaches the opponent's back row, it becomes a "king" and can move
diagonally both forward and backward.
4. Winning:
o Achieved by capturing all opponent’s pieces or blocking them.
AI and Checkers:
• Checkers was solved by AI (e.g., Chinook), proving a perfect strategy exists.
• Techniques Used:
o Minimax algorithm.
o Alpha-beta pruning.
o Endgame databases.
3. Chess
Overview:
• Origin: India, around the 6th century (as Chaturanga).
• Board: 8x8 grid.
• Players: Two.
• Objective: Checkmate the opponent’s king.
Rules:
1. Piece Movement:
o Pawn: Moves forward; captures diagonally.
o Rook: Moves horizontally or vertically.
o Knight: Moves in an L-shape.
o Bishop: Moves diagonally.
o Queen: Moves any number of squares in any direction.
o King: Moves one square in any direction.
2. Special Moves:
o Castling, En Passant, Pawn Promotion.
3. Checkmate:
o The game ends when the king cannot escape capture.
AI and Chess:
• Chess has been a key area of AI research.
• IBM’s Deep Blue defeated world champion Garry Kasparov in 1997.
• Techniques Used:
o Minimax algorithm.
o Heuristics for board evaluation.
o Endgame tablebases.
4. Othello (Reversi)
Overview:
• Origin: Late 19th century (Reversi); modern Othello in 1971.
• Board: 8x8 grid.
• Players: Two.
• Objective: Have the majority of pieces of your color on the board at the end.
Rules:
1. Game Start:
o Four discs (two black, two white) are placed in the center in a diagonal pattern.
2. Placing Pieces:
o Players take turns placing their discs to sandwich opponent's discs between their
own.
o Sandwiched discs are flipped to the current player’s color.
3. Legal Moves:
o Must capture at least one of the opponent’s discs.
4. Winning:
o The player with the most discs of their color at the end wins.
AI and Othello:
• Strategies involve maximizing mobility and controlling corners.
• AI programs like Edax demonstrate strategic dominance.
• Techniques Used:
o Heuristic evaluation.
o Minimax search with alpha-beta pruning.
5. Go
Overview:
• Origin: China, over 2500 years ago.
• Board: 19x19 grid (smaller boards like 9x9 and 13x13 are also used).
• Players: Two.
• Objective: Surround more territory than the opponent.
Rules:
1. Placing Stones:
o Players alternately place stones on intersections of the board.
2. Capturing:
o Stones are captured when surrounded with no empty "liberties."
3. Scoring:
o Points are awarded for surrounded territory and captured stones.
4. Winning:
o The player with the highest score wins.
AI and Go:
• Go is exponentially more complex than chess due to the larger board and open-ended
strategies.
• Breakthrough: AlphaGo by DeepMind defeated world champion Lee Sedol in 2016.
• Techniques Used:
o Deep reinforcement learning.
o Monte Carlo tree search.
6. Backgammon
Overview:
• Origin: Ancient Mesopotamia, around 3000 BCE.
• Board: 24 triangular points divided into four quadrants.
• Players: Two.
• Objective: Move all checkers to your home board and bear them off before your opponent.
Rules:
1. Dice Rolls:
o Determine the number of moves.
2. Checker Movement:
o Move checkers based on dice rolls, adhering to rules about open points and blocks.
3. Hitting:
o Land on an opponent’s blot to send it to the bar.
4. Winning:
o By bearing off all your checkers first.
AI and Backgammon:
• Backgammon combines strategy and luck.
• TD-Gammon, developed by IBM, was a breakthrough AI program using reinforcement
learning.
Comparison Table
These games serve as benchmarks for testing AI's strategic reasoning. While classical methods
excel in structured games like chess and checkers, modern AI techniques like deep learning and
reinforcement learning have expanded capabilities to complex domains like Go and Backgammon.
Application of AI in Video Games
9. Example Scenario
• Game: Open-world RPG.
• Objective: AI simulates a town with lifelike NPCs.
• AI Features:
o NPCs have schedules (e.g., merchants opening shops, guards patrolling).
o Adaptive quest system where NPCs react to player choices.
• AI Techniques:
o FSM for NPC routines.
o Decision trees for quest outcomes.