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}.
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
• A∗with 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).