You are on page 1of 15

Lecture 19

Artificial Intelligence
CS-3431w (V2)
Instructor: Dr. Syed Mohammad Irteza
Assistant Professor, Department of Computer Science
21 December, 2020
Previous Lecture
• Constraint Satisfaction Problems
• AC-3 Algorithm (Arc Consistency)
• Using Iterative Improvement Algorithms for CSPs

2
Summary
• CSPs are a special kind of problem
• States defined by values of a fixed set of variables
• Goal test defined by constraints on variable values
• Backtracking = DFS with 1 variable assigned per node
• Variable ordering and value selection heuristics help significantly
• Forward checking prevents assignments that guarantee later failure
• Constraint propagation (e.g., arc consistency) does additional work to
constrain values and detect inconsistencies
• Iterative min-conflicts is usually effective in practice
3
Adversarial Search – Games

4
Games versus Search Problems
• “Unpredictable” opponent → Solution is a strategy
• Specifying a move for every possible opponent reply
• Time limits → unlikely to find goal, must approximate
• Plan of attack:
• Computer considers possible lines of play (Babbage, 1846)
• Algorithm for perfect play (Zermelo, 1912; Von Neumann 1944)
• Finite horizon, approximate evaluation (Zuse, 1945; Shannon, 1950)
• First chess program (Turing, 1951)
• Pruning to allow deeper search (McCarthy, 1956)

5
Types of Games
Deterministic Chance

Perfect information Chess, Backgammon,


Checkers, Monopoly
Go,
Othello
Imperfect information Battleships, Bridge,
Blind Tic-Tac-Toe Poker,
Scrabble,
Nuclear War

6
Game Tree (2-player, deterministic, turns)

7
Game Tree (2-player, deterministic, turns)

8
Game Tree (2-player, deterministic, turns)

9
Game Tree (2-player, deterministic, turns)

10
Minimax
• Perfect play for deterministic, perfect information games
• Idea: choose move to position with highest minimax value
= best achievable payoff against best play
• Example: 2-ply game:

11
Minimax
• Perfect play for deterministic, perfect information games
• Idea: choose move to position with highest minimax value
= best achievable payoff against best play
• Example: 2-ply game:

12
Minimax Algorithm

13
Properties of minimax
• Complete: Yes, if tree is finite (chess has specific rules for this)
• Optimal: Yes, against an optimal opponent
• Time complexity: 𝑂 𝑏 𝑚
• Space complexity: 𝑂(𝑏𝑚)

14
Acknowledgement
• I have taken help for these slides from the work of:
• Book Slides (AIMA, Berkeley)

15

You might also like