# In This Question You Will Construct A Table Showing The Number Of States Expanded Wh 2903228

Question 1: Search Algorithms for the 15-Puzzle (2 marks)

In this question you will construct a table showing the number of states

expanded when the 15-puzzle is solved, from various starting positions, using

four different searches:

(i) Uniform Cost Search (with Dijkstra’s Algorithm)

(ii) Iterative Deepening Search

(iii) A*Search (using the Manhattan Distance heuristic)

(iv) Iterative Deepening A*Search

Go to the Course Web Site, Week 3 Prolog Code: Path Search, scroll to the

Activity at the bottom of the page and click on “prolog search.zip”.

Unzip the file and change directory to prolog search, e.g.

unzip prolog_search.zip

cd prolog_search

Start prolog and load puzzle15.pl and ucsdijkstra.pl by typing

[puzzle15].

[ucsdijkstra].

Then invoke the search for the specified start10 position by typing

start10(S), solve(S,P,G,N), showsol(P).

When the answer comes back, just hit Enter/Return. This version of UCS

uses Dijkstra’s algorithm which is memory efficient, but is designed to return

only one answer. Note that the length of the path is returned as G, and the

total number of states expanded during the search is returned as N.

(a) Draw up a table with four rows and five columns. Label the rows as UCS,

IDS, A* and IDA*

, and the columns as start10, start20, start27,

start35 and start43. Run each of the following algorithms on each of

the 5 start states:

(i) [ucsdijkstra]

(ii) [ideepsearch]

(iii) [astar]

(iv) [idastar]

Document Preview:

COMP3411/9414 Arti?cial IntelligenceTerm 1, 2019Assignment 2 – Heuristics and SearchDue: Tuesday 9 April, 11:59pmMarks: 12% of ?nal assessmentQuestion1: SearchAlgorithmsforthe15-Puzzle(2marks)In this question you will construct a table showing the number of statesexpanded when the15-puzzle issolved, fromvariousstarting positions, usingfour di?erent searches:(i) Uniform Cost Search (with Dijkstra’s Algorithm)(ii) Iterative Deepening Search*(iii) A Search (using the Manhattan Distance heuristic)*(iv) Iterative Deepening A SearchGo to the Course Web Site, Week 3 Prolog Code: Path Search, scroll to theActivity at the bottom of the page and click on “prolog search.zip”.Unzip the ?le and change directory to prolog search, e.g.unzip prolog_search.zipcd prolog_searchStart prolog and load puzzle15.pl and ucsdijkstra.pl by typing[puzzle15].[ucsdijkstra].Then invoke the search for the speci?ed start10 position by typingstart10(S), solve(S,P,G,N), showsol(P).When the answer comes back, just hit Enter/Return. This version of UCSuses Dijkstra’salgorithm which is memory e?cient, but is designed to returnonly one answer. Note that the length of the path is returned as G, and thetotal number of states expanded during the search is returned as N.(a) Drawupatablewithfourrowsand?vecolumns. LabeltherowsasUCS,* *IDS, A and IDA , and the columns as start10, start20, start27,start35 and start43. Run each of the following algorithms on each ofthe 5 start states:(i) [ucsdijkstra](ii) [ideepsearch](iii) [astar](iv) [idastar]1In each case, record in your table the number of nodes generated dur-ing the search. If the algorithm runs out of memory, just write “Mem”in your table. If the code runs for ?ve minutes without producing out-put, terminate the process by typing Control-C and then “a”, and write“Time” in your table.(b) Brie?y discuss the time and space e?ciency of these four algorithms.Question 2: Deceptive Starting States (1.5 marks)Consider…

Attachments:

assign2.pdf