final-csps

pdf

School

University of California, Berkeley *

*We aren’t endorsed by this school

Course

188

Subject

Computer Science

Date

Dec 6, 2023

Type

pdf

Pages

3

Uploaded by SargentPencilManatee29

Report
CS 188 Spring 2023 Final Review: CSPs Q1. Worst-Case Backtracking Consider solving the following CSP with standard backtracking search where we enforce arc consistency of all arcs before every variable assignment. Assume every variable in the CSP has a domain size d > 1. A B C D E F (a) For each of the variable orderings, mark the variables for which backtracking search (with arc consistency checking) could end up considering more than one different value during the search. (i) Ordering: A, B, C, D, E, F A B C D E F (ii) Ordering: B, D, F, E, C, A A B C D E F (b) Now assume that an adversary gets to observe which variable ordering you are using, and after doing so, chooses to add one additional binary constraint between any pair of variables in the CSP to maximize the number of backtracking variables in the worst case. For each of the following variable orderings, select which additional binary constraint the adversary should add. Then, mark the variables for which backtracking search (with arc consistency checking) could end up considering more than one different value when solving the modified CSP. (i) Ordering: A, B, C, D, E, F The adversary should add the additional binary constraint: *$ AC *$ BF *$ AE *$ CD *$ AF *$ CE *$ BD *$ DF When solving the modified CSP with this ordering, backtracking might occur at: A B C D E F (ii) Ordering: B, D, F, E, C, A The adversary should add the additional binary constraint: *$ AC *$ BF *$ AE *$ CD *$ AF *$ CE *$ BD *$ DF When solving the modified CSP with this ordering, backtracking might occur at: A B C D E F 1
Q2. CSPs: Potluck Pandemonium The potluck is coming up and the staff haven’t figured out what to bring yet! They’ve pooled their resources and determined that they can bring some subset of the following items. 1. Pho 2. Apricots 3. Frozen Yogurt 4. Fried Rice 5. Apple Pie 6. Animal Crackers There are five people on the course staff: Taylor, Jonathan, Faraz, Brian, and Alvin. Each of them will only bring one item to the potluck. i. If (F)araz brings the same item as someone else, it cannot be (B)rian. ii. (A)lvin has pho-phobia so he won’t bring Pho, but he’ll be okay if someone else brings it. iii. (B)rian is no longer allowed near a stove, so he can only bring items 2, 3, or 6. iv. (F)araz literally can’t even; he won’t bring items 2, 4, or 6. v. (J)onathan was busy, so he didn’t see the last third of the list. Therefore, he will only bring item 1, 2, 3, or 4. vi. (T)aylor will only bring an item that is before an item that (J)onathan brings. vii. (T)aylor is allergic to animal crackers, so he won’t bring item 6. (If someone else brings it, he’ll just stay away from that table.) viii. (F)araz and (J)onathan will only bring items that have the same first letter (e.g. Frozen Yogurt and Fried Rice). ix. (B)rian will only bring an item that is after an item that (A)lvin brings on the list. x. (J)onathan and (T)aylor want to be unique; they won’t bring the same item as anyone else. (a) Which of the listed constraints are unary constraints? i ii iii iv v vi vii viii ix x (b) Rewrite implicit constraint viii. as an explicit constraint. 2
(c) How many edges are there in the constraint graph for this CSP? (d) The table below shows the variable domains after all unary constraints have been enforced. A 2 3 4 5 6 B 2 3 6 F 1 3 5 J 1 2 3 4 T 1 2 3 4 5 Following the MRV heuristic, which variable should we assign first? Break all ties alphabetically. *$ A *$ B *$ F *$ J *$ T (e) To decouple this from the previous question, assume that we choose to assign (F)araz first. In this question, we will choose which value to assign to using the Least Constraining Value method. To determine the number of remaining values, enforce arc consistency to prune the domains. Then, count the total number of possible assignments ( not the total number of remaining values). It may help you to enforce arc consistency twice, once before assigning values to (F)araz, and then again after assigning a value. (i) Assigning F = results in possible assignments. (ii) Assigning F = results in possible assignments. (iii) Assigning F = results in possible assignments. (iv) Using the LCV method, which value should we assign to F? If there is a tie, choose the lower number. *$ 1 *$ 2 *$ 3 *$ 4 *$ 5 *$ 6 Extra tables for work: A 2 3 4 5 6 B 2 3 6 F 1 3 5 J 1 2 3 4 T 1 2 3 4 5 A 2 3 4 5 6 B 2 3 6 F 1 3 5 J 1 2 3 4 T 1 2 3 4 5 A 2 3 4 5 6 B 2 3 6 F 1 3 5 J 1 2 3 4 T 1 2 3 4 5 A 2 3 4 5 6 B 2 3 6 F 1 3 5 J 1 2 3 4 T 1 2 3 4 5 3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help