A comprehensive collection of three assignments exploring fundamental Artificial Intelligence concepts including constraint satisfaction, game theory, and search algorithms.
This repository contains coursework from an Introduction to Artificial Intelligence course, implementing core AI algorithms and problem-solving techniques. The assignments progress from constraint-based problem solving to adversarial game playing with advanced search strategies.
- Constraint Satisfaction Problems (CSP)
- Search Algorithms (AC-3, Backtracking, Minimax, Alpha-Beta Pruning)
- Game Theory and Adversarial Search
- Heuristic Methods and Optimization Techniques
IntroductionToArtificialIntelligence/
βββ assignment 1/
β βββ assignment 1.pdf # Problem statement
β βββ assignment_1_deidier_esposito.pdf # Solution report
β
βββ assignment 2/
β βββ assignment 2.pdf # Problem statement
β βββ assignment_2_report_deidier_esposito.pdf # Solution report
β βββ deliverables.zip # Submission package
β βββ src/
β βββ csp.py # CSP implementation
β βββ map_coloring.py # Map coloring problem
β βββ sudoku.py # Sudoku solver
β βββ sudoku_easy.txt
β βββ sudoku_medium.txt
β βββ sudoku_hard.txt
β βββ sudoku_very_hard.txt
β
βββ assignment 3/
β βββ assignment 3.pdf # Problem statement
β βββ assignment_3_deidier_esposito.pdf # Solution report
β βββ deliverables.zip # Submission package
β βββ imgs/ # Documentation images
β βββ src/
β βββ tic_tac_toe_minimax.py # Tic Tac Toe with Minimax
β βββ tic_tac_toe_alpha_beta_pruning.py # Tic Tac Toe with Alpha-Beta Pruning
β βββ tic_tac_toe_minimax_variant.py # Alternative Minimax implementation
β βββ bucket_game.py # Game theory problem
β βββ halving_game.py # Game theory problem
β
βββ LICENSE
βββ README.md (this file)
Objective: Introduction to core AI problem-solving methodologies.
- Exploration of basic AI techniques
- Foundational algorithms and approaches
- See assignment 1.pdf for detailed problem statement
- See assignment_1_deidier_esposito.pdf for complete solution report
Objective: Implement constraint satisfaction algorithms to solve complex combinatorial problems.
CSP Framework (csp.py)
- AC-3 Algorithm: Arc Consistency checking for domain reduction
- Backtracking Search: Complete search algorithm with constraint propagation
- Binary constraint satisfaction with intelligent variable ordering
Applications:
-
Map Coloring Problem (
map_coloring.py)- Color Australian states using only 3 colors
- No two adjacent states can have the same color
- Demonstrates binary constraint satisfaction
-
Sudoku Solver (
sudoku.py)- Solves 9Γ9 Sudoku puzzles with varying difficulty levels
- Includes test cases: easy, medium, hard, and very hard
- Uses AC-3 for initial constraint propagation and backtracking for complete solution
cd assignment\ 2/src
# Solve map coloring problem
python3 map_coloring.py
# Solve Sudoku (adjust sudoku_easy.txt to sudoku_hard.txt as needed)
python3 sudoku.pyObjective: Implement game-playing agents using minimax algorithms and explore game theory concepts.
Game Theory Problems:
-
Tic Tac Toe with Minimax (
tic_tac_toe_minimax.py)- Classic minimax algorithm implementation
- Explores entire game tree to optimal depth
- Two players, zero-sum game
- Finds the best move without pruning
-
Tic Tac Toe with Alpha-Beta Pruning (
tic_tac_toe_alpha_beta_pruning.py)- Optimized minimax using alpha-beta pruning
- Eliminates unnecessary branches from game tree exploration
- Significant performance improvement over standard minimax
- Same optimal play with reduced computation time
-
Tic Tac Toe Minimax Variant (
tic_tac_toe_minimax_variant.py)- Alternative implementation of minimax algorithm
- Demonstrates different approaches to game tree evaluation
-
Bucket Game (
bucket_game.py)- Game theory application with strategic choices
- Players choose between predefined bucket options or single numbers
- Demonstrates utility-based decision making
- Uses minimax for optimal play
-
Halving Game (
halving_game.py)- Two-player sequential number reduction game
- Actions: decrement (β1) or halve (Γ·2)
- Educational example of game tree search with limited branching
cd assignment\ 3/src
# Tic Tac Toe with standard Minimax
python3 tic_tac_toe_minimax.py
# Tic Tac Toe with optimized Alpha-Beta Pruning
python3 tic_tac_toe_alpha_beta_pruning.py
# Tic Tac Toe Minimax variant
python3 tic_tac_toe_minimax_variant.py
# Bucket Game
python3 bucket_game.py
# Halving Game
python3 halving_game.py- Python 3.9 or higher
- No external dependencies required (uses only Python standard library)
# Clone the repository
git clone https://github.com/SimoneDeidier/IntroductionToArtificialIntelligence.git
cd IntroductionToArtificialIntelligence
# Navigate to any assignment
cd assignment\ 2/src
python3 map_coloring.py| Algorithm | Assignment | Purpose |
|---|---|---|
| AC-3 | Assignment 2 | Arc consistency constraint propagation |
| Backtracking | Assignment 2 | Complete search with constraint satisfaction |
| Minimax | Assignment 3 | Optimal move selection in adversarial games |
| Alpha-Beta Pruning | Assignment 3 | Optimized minimax game tree exploration |
Each assignment includes a comprehensive solution report documenting:
-
Problem analysis and approach
-
Algorithm implementation details
-
Experimental results and performance metrics
-
Analysis of correctness and optimizations
-
Assignment 1 Report: assignment_1_deidier_esposito.pdf
-
Assignment 2 Report: assignment_2_report_deidier_esposito.pdf
-
Assignment 3 Report: assignment_3_deidier_esposito.pdf
- Simone Deidier
- Davide Esposito