Among the many applications of the constraint satisfaction problem (CSP) paradigm, one of the first was to perform a process called line-labeling to attempt to use a 2-dimensional image of a Βblocks-worldΒ environment to infer its 3-dimensional structure so that a robot can reconfigure the blocks to achieve a goal. In this task, you will utilize code that we provide to you, and extend it with code that you write, to develop a deeper understanding of the CSP paradigm and its application to line labeling.
As an introduction to the line-labeling problem, see the separate document provided that summarizes it.
Part of the line labeling code has been written for you (Python 2.7). Parts a to i will provide more instruction on finishing the code.
Many of the utility functions written in diagram.py will be helpful. The class Vertex is used extensively in diagram.py and is defined in vertex.py.
You will use main.py to run the code. Example commands: python main.py example
s/cube.txt propagation -p ac_3 # only run AC3 on cube.txt
python main.py examples/cube.txt backtracking -p ac_3 -o mrv # find all solutions of AC3 and MRV
python main.py examples/cube.txt backtracking -s -p ac_3 -o mrv # find ONE solution using backtracking with AC3 and MRV
python main.py examples/cube.txt backtracking -p forward_checking -o first_unassigned # find ONE solution using backtracking with forward checking and the first unassigned heuristic
Run python main.py -h for detailed usage instructions.
row#
#solns
propagation
ordering
# assignments TOWER
# assignments POIUYT
1
all
No-prop
First-unassigned
2
all
Forward-checking
First-unassigned
3
all
Arc-consistency
First-unassigned
4
all
No-prop
MRV
5
all
Forward-checking
MRV
6
all
Arc-consistency
MRV
7
one
No-prop
First-unassigned
8
one
Forward-checking
First-unassigned
9
one
Arc-consistency
First-unassigned
10
one
No-prop
MRV
11
one
Forward-checking
MRV
12
one
Arc-consistency
MRV
13
all
Arc-consistency**
MRV