# CS代写：人工智能CPSC 322 assignment代写

Step1：售前咨询，导师匹配

Step2：免费导师咨询

Step3：沟通细节，下单定金

Step4：交付任务，支付尾款

Step5：售后服务

## CPSC 322 Artificial Intelligence Assignment 代写案例

Question One

CSP techniques are useful in solving complex configuration and allocation problems. You are given the task of allocating four developments in a new site in Whistler. You have to place a housing complex, a big hotel, a recreational area and a garbage dump. The area for development can be represented as 3×3 grid (three rows 0,1,2 and three columns 0,1,2) and you need to place each development in their own cell of the grid. Unfortunately there are some practical constraints on the problem that you need to take into account. In the following, A is close to B if A is in a cell that shares an edge or a corner with B.

• There is a cemetery in cell 0,0.

• There is a lake in cell 1,2.

• The garbage dump should not be close to the lake.

• The housing complex and the big hotel should not be close to the cemetery.

• The recreational area should be close to the lake.

• The housing complex and the big hotel should be close to the recreational area.

• The housing complex and the big hotel should not be close to the garbage dump.

Represent this problem as a CSP. Be as precise as you can in specifying the constraints. Also there may be some basic constraints that are in the description (and not just in the points). You need to give a human-level description of the variables, domains and constraints as well as either an AIspace or AIPython CSP representation and demonstrate that it works. How many solutions are there? If there are solutions, what are they? If there are no solutions, explain why. The solutions and the explanations you give, must be in straightforward non-techical language that a member of the public could understand.

Question Two

Consider a scheduling problem, where there are eight variables A, B, C , D, E, F, G, H each with domain {1, 2, 3, 4}. Suppose the constraints are: A > G, A ≤ H , |F −B| = 1, G < H , |G −C | = 1, H − C is even, H 6= D, D > G, D 6= C , E 6= C , E < D − 1, E 6= H − 2, G 6= F, H 6= F, C 6= F, D 6= F, |E − F| is odd. (a) Show how search can be used to solve this problem, using the variable ordering A, B, C , D,E, F, G, H . To do this, write a program to print out all answers and count the number of nodes expanded and the number failing consistency checks. You can use whatever programming language you like. We don’t want a general program; just one for this example. Python code that produces the answer for variables X , Y and Z each with domains {t, f }, and constraints X 6= Y , Y 6= Z is at http://www.cs.ubc.ca/~poole/cs322/2020/as3/streeCount.py (b) Is there a smaller tree? Give a node ordering that results in as small a tree as you can find. Show both how many failing consistency checks there are, and how many nodes are expanded to find all solutions. Explain how you found this ordering and why you would expect the tree resulting from this ordering to be good. (A good explanation as to why your ordering is expected to be good is more important than the perfect ordering.) (c) How many failures would there be for generate-and-test? Hint: it can be computed in a straightforward manner if you know the number of variables, the size of the domains, and the number of solutions; you do not need to write a program like the second part of streeCount.py. The file as3csp.py in the zip file contains an AIPython representation of this domain. Note that AIPython does not tell us how many failing consistency checks there are.

Question Three

Show how arc consistency can be used to solve the scheduling problem of question 2 of assignment 3. To do this you need to

(a) For the first 5 instances of arc consistency, explain which elements of a domain are deleted

at each step, and which arc is responsible for removing the element. You need to explain

it at a level for one of your peers to understand if this is the first time they have seen arc

consistency. Select arcs to cover the interesting cases.

(b) Show explicitly the constraint graph after arc consistency has stopped.

(c) Show how splitting domains can be used to solve this problem. Draw the tree of splits and

show the solutions.

(d) Based on this experience, discuss how much arc consistency saves over the backtracking for

this problem (include the best tree that you found and an arbitrary tree). Make sure there is

Question Four

Show how stochastic local search can be used for the scheduling problem of question one. Make sure that it tries 2000 steps before termination. You can use the AIspace applet or the Python code.

(a) For one particular run, where you select a variable that is involved in the most conflicts, and either select a value at random or that results in the minimum number of conflicts, explain which element is changed at each step and what was the resulting number of unsatisfied arcs.

(You only need to do this for 5 steps). Again, explain this at a level for one of your peers to understand if this is the first time they have seen local search. (Try to make the example interesting as if you were explaining it.)

(b) Compare and explain the result of the following settings:

i) select a variable involved in the maximum number of unsatisfied constraints, and either its best value or a random value (but tell us which one)

ii) select any variable which is involved in unsatisfied constraints, and either its best value or a random value

iii) a probabilistic mix of the (i) and (ii), such as with probability 0.4 select a variable involved in the most conflicts, otherwise select variable in any conflict, and either select its best value or a random value. Try a few probabilities and report on the best one found.

You must show and explain the runtime distributions and describe what you observe (in particular, tell us which curves correspond to which settings, when one algorithm better than another, and how often each setting does not find solutions; be specific). You should use multiple runs for each setting in the comparisons.

(c) Does a random restart help for any of these cases? Explain. (d) Based on this experience suggest good settings for the parameters that control which algorithms is run (e.g., which method is chosen, and the probabilities that different choices are made). Justify your choice.

## Recent Case

### 盘点留学生常用5 种最佳笔记方法，哪一种适合您

SCI期刊论文的发表过程是一项复杂而细致的工作，涉

### 轻松掌握万能Essay模板，撰写一篇合格的英文论文

Python可谓是当下最火的编程语言，同时，Pyt