• 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 13

Due: June 2, 2021

All exercises on this sheet are bonus exercises.

The goal of this exercise is to compare different problem solving methods covered in this course on the problem of graph coloring: Given an undirected graphG=hV,Ei(with V={v1, . . . ,v|V|} and E ⊆ {{vi,vj} | vi ∈V,vj ∈V,vi 6=vj}) and a finite set of colors C, assign each vertex vi∈Va colorc∈Csuch that for every edge{vi,vj} ∈Ethe colors assigned toviandvj differ.

We can represent this problem as combinatorial optimization problem, constraint network, CNF formula andSTRIPS planning task in the following way:

Combinatorial optimization We defineP =hC, S,min, viwith

• C={hc1, . . . , c|V|i |ci∈C for all1≤i≤ |V|}whereci denotes the color assigned tovi,

• S ={hc1, . . . , c|V|i | hc1, . . . , c|V|i ∈C andci6=cj for all {vi,vj} ∈E},

• v(c) = 0 for allc∈S,

For hill climbing we define the neighbors ofc∈Cto be allc0which differ fromcin the assignment of exactly oneci. Furthermore we use the heuristich(c) =|{{vi,vj} | {vi,vj} ∈E andci=cj}|.

Constraint Network We defineC=hVC,dom,(Rxy)iwith

• VC ={xi|vi∈V},

• dom(xi) =Cfor allxi∈VC, and

• Rxixj ={hc,c0i |c,c0∈C andc6=c0} for all{vi,vj} ∈E.

CNF formula We define a set of propositional variablesVCNF={vc|v∈V,c∈C}, wherevc denotes that vertexvis assigned colorc, and encode the problem with:

Φ = ^

v∈V

(_

c∈C

vc)∧ ^

v∈V

^

{c,c0}⊆C,c6=c0

(¬vc∨ ¬vc0)∧ ^

{vi,vj}∈E

^

c∈C

(¬vci ∨ ¬vjc)

Planning We define a STRIPS planning task Π =hVΠ, I, G, Ai:

• VΠ ={v-not-c |v ∈ V,c∈C} ∪ {v-assigned|v ∈ V} ∪ {v-not-assigned |v ∈ V}, wherev-not-cdenotes that vertexvisnot colored withc,v-assigneddenotes thatvhas been assigned a color andv-not-assigneddenotes thatvhas not been assigned any color.

• I={v-not-c|v∈V,c∈C} ∪ {v-not-assigned|v∈V}, i.e., all vertices have not been assigned any color yet.

• G={v-assigned|v∈V}, i.e., all vertices must be assigned to some color.

• A={assign-v-c|v∈V,c∈C}, where for each actiona=assign-v-cwe have cost(a) = 1 pre(a) ={v-not-assigned} ∪ {v0-not-c| {v,v0} ∈E}

add(a) ={v-assigned} del(a) ={v-not-c,v-not-assigned}.

(2)

Exercise 13.1(4 bonus marks)

Compare the number of candidates of P, the number of (full) assigments of C, the number of interpretations of Φ and the number of states of Π. Which encoding(s) is/are the most and least compact?

Exercise 13.2(1 bonus mark)

Assume we want to apply backtracking with inference using minimum remaining values as variable order on a graph-coloring constraint networkC as defined above.

Why is it not beneficial to use arc consistency in addition to forward checking as an inference method?

Exercise 13.3(1 bonus mark)

Assume we apply DPLL to Φ. When DPLL sets a variable vc to T(i.e., assigns cto vertexv), which variable assignments can be inferred with unit propagation? Justify your answer.

Exercise 13.4(2 bonus marks)

Consider a STRIPS task Π encoding a graph coloring problem as described above. Are the following statements correct? Justify your answer.

(a) All solutions of Π have cost|V|.

(b) Every state reachable fromI corresponds to a consistent partial assignment ofC.

Exercise 13.5(2 bonus marks)

Compare how well the following algorithms are suited for solving graph coloring:

• Hill climbing on the combinatorial optimization problemP,

• Backtracking with forward checking on the constraint networkC,

• DPLL on Φ, and

• Awith an admissible heuristic on Π.

Which one would you choose? List one advantage of each algorithm, and one disadvantage of each one you would not choose.

Hint: the solution to the other parts of this sheet can and should be used here!

Submission rules:

Upload a single PDF file (ending .pdf). 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).

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