;;; Dribble FILE : Lalitesh K. Katragadda ;;; I have used (search *initial-state*) instead of (solve-problem) for clarity of ;;; initial state used. However both are equivalent. ; Solving the water jug problem with breadth first search. (search *initial-state*) Solution Found after 13 node generations, and 6 moves. 0 0 Do OP-FILL4 4 0 Do OP-POUR-4-3 1 3 Do OP-EMPTY3 1 0 Do OP-POUR-4-3 0 1 Do OP-FILL4 4 1 Do OP-POUR-4-3 2 3 T ; Solving the water jug problem with depth first search. DEPTH (search *initial-state*) Solution Found after 9 node generations, and 6 moves. 0 0 Do OP-FILL4 4 0 Do OP-POUR-4-3 1 3 Do OP-EMPTY3 1 0 Do OP-POUR-4-3 0 1 Do OP-FILL4 4 1 Do OP-POUR-4-3 2 3 T :ld "puzzle" ; Loading /usr0/lalit/lisp/AI/puzzle.lisp. (breadth-first) BREADTH (search *initial-state*) Solution Found after 933 node generations, and 11 moves. 1 8 2 7 5 6 4 3 Move DOWN 1 8 2 7 5 3 6 4 Move LEFT 1 8 2 7 5 3 6 4 Move UP 1 8 2 7 3 6 5 4 Move UP 1 2 7 8 3 6 5 4 Move RIGHT 1 2 7 8 3 6 5 4 Move DOWN 1 2 3 7 8 6 5 4 Move DOWN 1 2 3 7 8 4 6 5 Move LEFT 1 2 3 7 8 4 6 5 Move LEFT 1 2 3 7 8 4 6 5 Move UP 1 2 3 8 4 7 6 5 Move RIGHT 1 2 3 8 4 7 6 5 T ; Unlimited depth first has no use so attempt depth first pruned to 12 generations deep. (setf *max-depth* 12) 12 (search *initial-state*) Solution Found after 419 node generations, and 11 moves. ; same solution as above, hence not included ; Attempt depth first pruned to 13 generations deep. (setf *max-depth* 13) 13 (search *initial-state*) Solution Found after 690 node generations, and 11 moves. ; same solution as above, hence not included ; Attempt depth first pruned to 20 generations deep. NIL (setf *max-depth* 20) 20 (search *initial-state*) Solution Found after 5058 node generations, and 17 moves. 1 8 2 7 5 6 4 3 Move DOWN 1 8 2 7 5 3 6 4 Move LEFT 1 8 2 7 5 3 6 4 Move UP 1 8 2 7 3 6 5 4 Move UP 1 2 7 8 3 6 5 4 Move RIGHT 1 2 7 8 3 6 5 4 Move DOWN 1 2 3 7 8 6 5 4 Move DOWN 1 2 3 7 8 4 6 5 Move LEFT 1 2 3 7 8 4 6 5 Move UP 1 2 3 7 4 6 8 5 Move LEFT 1 2 3 7 4 6 8 5 Move DOWN 1 2 3 6 7 4 8 5 Move RIGHT 1 2 3 6 7 4 8 5 Move UP 1 2 3 6 4 8 7 5 Move LEFT 1 2 3 6 4 8 7 5 Move DOWN 1 2 3 8 6 4 7 5 Move RIGHT 1 2 3 8 6 4 7 5 Move UP 1 2 3 8 4 7 6 5 T (dribble)