Generic Iteratic Deepening package for python 2.7
Author: Chen Zhang
Email: [email protected]
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
IterativeDeepening
class good forSearchable
objects. The abstract classes ofSearchable
andState
are 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
TreeNode
class is defined, and is wraped up toTreeState
by inheritingState
defined in iterative_deepening.py.
The package provides the following search methods:
BFS
Standard Breadth-First Search w/ or w/out maxmium queue size and maximum number of states exploredDFS
Standard Depth-First Search w/ or w/out maximum number of states exploredIterativeDeepening
Standard Iterative Deepening w/ or w/out maximum number of states exploredSearch
Iterative 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