Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Comp 3710 Applied Artificial Intelligence Local Search and Csps

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

COMP 3710 Applied Artificial Intelligence

Seminar/Lab 3.

Local search and CSPs


1. Objectives
 Use of local search for n-queens problem.
 Use of ‘Most-Constrained Variable First’ heuristic for a constraints satisfaction problem.

2. Exercise – Local search for 5-queens problem


 Initial board
4

0 1 2 3 4
 Show how local search can be used to find a solution. At each step, you need to show the evaluation of board.
(Note that local search can be struck to a local optimum, i.e., not always solution.)
Board The number of conflicts Selected column and value
(2, 1, 2, 0, 4) 5 (0,3)
(3, 1, 2, 0, 4) 4 (1,0)
(3, 0, 2, 0, 4) 3 (3,1)
(3, 0, 2, 1, 4) 2 (2,4)
(3, 0, 4, 1, 4) 1

3. Exercise – CSP
 Trace the operation of Most-Constrained Variables First (MCVF) for the 5-queens problem.
o MCVF:
 Most constrained variable: You can select a variable that has the least number of choices.
o List at least 6 steps, or till a solution is found.
o You need to show how next variables are selected.
Board # of constrains # of constrains # of constrains # of constrains # of constrains Selection
for column-0 for column-1 for column-2 for column-3 for column-4
(-1, -1, -1, -1, -1) 0 0 0 0 0 0:0
(0, -1, -1, -1, -1) 2 2 2 2 1:3
(0, 3, -1, -1, -1) 4 3 3 2:1
(0,3,1,-1,-1) 4 3 3:4
(0,3,1,4,-1) 4 4:2
(0,3,1,4,2)

You might also like