• Keine Ergebnisse gefunden

Foundations of Artificial Intelligence

N/A
N/A
Protected

Academic year: 2022

Aktie "Foundations of Artificial Intelligence"

Copied!
2
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Foundations of Artificial Intelligence

M. Helmert S. Eriksson Spring Term 2021

University of Basel Computer Science

Exercise Sheet 4

Due: March 31, 2021 Exercise 4.1(1+1 marks)

Which of the search algorithms shown in slide 35 of the printout version of chapter 12 would you use for the following problems? For breadth-first and uniform cost also consider whether to use the tree or graph variant. Justify your answer in two to three sentences.

(a) route planning

(b) searching a specific file in a large file system which does not have any symbolic links Hint: You can assume that the file exists at most once and that there is only one action type move-to-subdirectory with cost 1.

Exercise 4.2(2 marks)

Consider a pancakes problem withnpancakes where a states=hp1, . . . , pnirepresents the sizes of the pancakes from top to bottom. We additionally definepn+1=n+ 1 for all statess. Intuitively this means we interpret the table on which the pancakes stand as an additional (immovable) pancake of sizen+ 1. Now consider the following heuristic:

h(s) =

n

X

i=1

d(pi, pi+1) with

d(x, y) =

(0 if|x−y|= 1 1 otherwise

Which of the four propertiessafe, goal-aware, admissible and consistent doeshsatisfy? Justify your answer for each property.

Exercise 4.3(1 mark)

Can a heuristic be safe and goal-aware, but not admissible? Justify your answer.

Exercise 4.4(4+1 marks)

The task in this exercise is to write a software program. We expect you to implement your code on your own, without using existing code you find online. If you encounter technical problems or have difficulties understanding the task, please let us know. For this exercise, you only have to create a new fileAstarSearch.java.

(a) Implement A? without node reopening in a new file AstarSearch.java. Your class must inherit from SearchAlgorithmBase. Make sure that the value of the member variable expandedNodes is updated correctly. You can access the heuristic value of a state through a new method in theStateSpace interface calledpublic int h(State s).

(2)

(b) We altered PancakeStateSpaceto implement the heuristic described in Exercise 4.2. Test your implementation of AstarSearch on the example problem instances provided in the instances directory. Set a time limit of 10 minutes and a memory limit of 2 GB for each run. On Linux, you can set a time limit of 10 minutes with the commandulimit -t 600.

Running your implementation on the first example instance with

java -Xmx2048M AstarSearch pancakes instances/pancakes_prob_01

sets the memory limit to 2 GB. If the RAM of your computer is 2GB or less, set the memory limit to the amount of available RAM minus 256 MB instead. In any case, describe in your solution how much RAM was used.

Report runtime, number of node expansions, solution length and solution cost for all in- stances that can be solved within the given time and memory limits. For all other instances, report if the time or the memory limit was hit.

Submission rules:

• Create a single PDF file (ending .pdf) for all non-programming exercises. If you want to submit handwritten parts, include their scans in the single PDF. Put the names of all group members on top of the first page. Use page numbers or put your names on each page. Make sure your PDF has size A4 (fits the page size if printed on A4).

• For programming exercises, create only those Java textfiles (ending .java) required by the exercise. Put your names in a comment on top of each file. Make sure your code compiles and test it!

• For the submission, you can either upload the single PDF or prepare a ZIP file (ending .zip, .tar.gz or .tgz; not .rar or anything else) containing the single PDF and the Java textfile(s) and nothing else. Please do not use directories within the ZIP, i.e., zip the files directly.

Referenzen

ÄHNLICHE DOKUMENTE

Provide a worst-case runtime estimate of the algorithm based on cutset conditioning if your cutset from the first part of this exercise is used (i.e., compute an upper bound for

Perfom DPLL on the clause set {{A, ¬B}, {¬A, B}, {B, ¬D}, {C}, {¬C, ¬B, ¬D}, {C, D}}, always picking the variable occuring in the highest number of clauses and always considering

In cases where the precondition choice function is not deterministic, choose the precondition in alphabetical order.. Exercise 11.3

– one line for each table position: maximum number of blocks in the tower at this table position, followed by the IDs of the blocks in the initial state, starting from the surface

Successor nodes are generated by applying the following actions in order, ignoring the ones that are inapplicable in a given state: transport 2 missionaries, transport 1

(c) Test your implementation by verifying the statements on Slide 23 of Chapter 20 (print version), which state that hill climbing with a random initialization finds a solution

Provide a worst-case runtime estimate of the algorithm based on cutset conditioning if your cutset from the first part of this exercise is used (i.e., compute an upper bound for

The domain description (variables and actions) is given in the file bridges-once-domain.pddl, and the problem description (objects, initial state and goal description) is given in