Home

Awesome

Pseudocode

Pseudocode descriptions of the algorithms from Russell and Norvig's Artificial Intelligence - A Modern Approach.

The algorithms as they appear in the book are available in pdf format:

The files listed below give the same algorithms, but in markdown format. We need help checking that the 4th edition versions are correct. We are in the process of updating from the old 3rd edition algorithms. (Note: when editing pseudocode in a md/*.md file, put two spaces at the end of a line; this keeps the line separate from the following line.)

3rd ed.4th ed.Pseudo-code Algorithm
2.32.7TABLE-DRIVEN-AGENT
2.42.8REFLEX-VACUUM-AGENT
2.62.10SIMPLE-REFLEX-AGENT
2.82.12MODEL-BASED-REFLEX-AGENT
3.1xSIMPLE-PROBLEM-SOLVING-AGENT
3.73.7BEST-FIRST-SEARCH
3.113.9BREADTH-FIRST-SEARCH
3.173.12ITERATIVE-DEEPENING-SEARCH
x3.14BIBF-SEARCH (Bidirectional Best-First)
3.13xUNIFORM-COST-SEARCH
3.16xDEPTH-LIMITED-SEARCH
3.243.22RECURSIVE-BEST-FIRST-SEARCH
4.24.2HILL-CLIMBING
4.54.4SIMULATED-ANNEALING
4.84.7GENETIC-ALGORITHM
4.114.10AND-OR-GRAPH-SEARCH
4.214.20ONLINE-DFS-AGENT
4.244.23LRTA*-AGENT
5.35.3MINIMAX-SEARCH (was MINIMAX-DECISION in 3e)
5.75.7ALPHA-BETA-SEARCH
x5.11MONTE-CARLO-TREE-SEARCH
6.36.3AC-3
6.56.5BACKTRACKING-SEARCH
6.86.9MIN-CONFLICTS
6.116.11TREE-CSP-SOLVER
7.17.1KB-AGENT
7.87.10TT-ENTAILS
7.97.13PL-RESOLUTION
7.127.15PL-FC-ENTAILS?
7.147.17DPLL-SATISFIABLE?
7.157.18WALKSAT
7.177.20HYBRID-WUMPUS-AGENT
7.197.22SATPLAN
9.19.1UNIFY
9.39.3FOL-FC-ASK
9.69.6FOL-BC-ASK
9.89.8APPEND
10.111.1AIR-CARGO-TRANSPORT-PROBLEM
10.211.2SPARE-TIRE-PROBLEM
10.311.4BLOCKS-WORLD
10.7xHAVE-CAKE-AND-EAT-CAKE-TOO-PROBLEM
10.9xGRAPHPLAN
11.411.7REFINEMENT-HIGH-LEVEL-ACTIONS
11.511.8HIERARCHICAL-SEARCH
11.811.11ANGELIC-SEARCH
11.111.13JOB-SHOP-SCHEDULING-PROBLEM
13.112.1DT-AGENT
14.913.11ENUMERATION-ASK
14.1013.13ELIMINATION-ASK
14.1213.16PRIOR-SAMPLE
14.1313.17REJECTION-SAMPLING
14.1413.18LIKELIHOOD-WEIGHTING
14.1513.20GIBBS-ASK
15.414.4FORWARD-BACKWARD
15.614.6FIXED-LAG-SMOOTHING
15.1714.17PARTICLE-FILTERING
x15.5OUPM (for citation extraction)
x15.6NET-VISA
x15.9RADAR (OUPM for radar tracking)
x15.11GENERATE-IMAGE
x15.15GENERATE-MARKOV-LETTERS
16.916.9INFORMATION-GATHERING-AGENT
17.417.6VALUE-ITERATION
17.717.9POLICY-ITERATION
17.917.16POMDP-VALUE-ITERATION
11.1018.1DOUBLES-TENNIS-PROBLEM
18.419.5LEARN-DECISION-TREE
18.719.8CROSS-VALIDATION-WRAPPER
18.1019.11DECISION-LIST-LEARNING
18.3319.25ADABOOST
19.2xCURRENT-BEST-LEARNING
19.3xVERSION-SPACE-LEARNING
19.8xMINIMAL-CONSISTENT-DET
19.12xFOIL
21.222.2PASSIVE-ADP-AGENT
21.422.4PASSIVE-TD-AGENT
21.822.8Q-LEARNING-AGENT
22.1xHITS
23.423.5CYK-PARSE
23.523.8SENTENCE-TREE
25.926.6MONTE-CARLO-LOCALIZATION
29.1xPOWERS-OF-2