Generic Iteratic Deepening package for python 2.7
Author: Chen Zhang
Email: zhangc.sh.cn@gmail.com
This package is originally a responce to Programming Assignment 1 of Aritifical Intelligence tough by Professor Ernest Davis with NYU.
If you want to use this software for academic purposes, aka assignments, please refer to the ACADEMIC INTEGRITY.
I tried to make the program generic. Some abstract classes are raised in the prgram, even though Python 2 does not have official support for that. The code is well-documented with docstring. It is not going to be hard to figure out the definition and implementation details of the phantom abstract classes.
- iterative_deepening.py contains a generic
IterativeDeepeningclass good forSearchableobjects. The abstract classes ofSearchableandStateare also implemented. - dominos.py, is the code that solves the assignment problem. A
DominoSpace(subclass ofSearchable) andPostCorrespondenceState(subclass ofState) are implemented, along with classDomino. - iterative_deepening_test.py includes the unit test for the package. A commonly seen
TreeNodeclass is defined, and is wraped up toTreeStateby inheritingStatedefined in iterative_deepening.py.
The package provides the following search methods:
BFSStandard Breadth-First Search w/ or w/out maxmium queue size and maximum number of states exploredDFSStandard Depth-First Search w/ or w/out maximum number of states exploredIterativeDeepeningStandard Iterative Deepening w/ or w/out maximum number of states exploredSearchIterative Deepening using a list of seeds initialized with BFS w/ maximum queue size.
The search methods returns the solution (None if unfound)
and the error code
0 - sulution found
1 - no soluion exists
2 - solution not found within the constraints