search and backtracking (slides5) Flashcards

1
Q

CSP Standard Incremental Search Formulation (SISF)

A
  • Initial state
  • Successor function
  • State
  • Goal test

same for all CSP’s
every soln appears at depth n with n variables
-depth first search used
path is irrelevant, so complete state formulation is used
for CSP with n variables of domain size d:
b=(n-l)d at depth l, hence n! * d leaves

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

SISF initial state

A

the empty assignment{}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

SISF successor function

A

assign a value to an unassigned variable that does not conflict with the current assignment
-fail if no legal assignments

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

SISF state

A

partial assignment

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

SISF goal test

A

the current assignment is complete

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Backtracking search

A
  • variable assignments are commutative
  • only need to consider assignments to a single variable at each node
  • -b = d and there are d^n leaves
  • Depth-first search for CSPs with single variable assignments is called backtracking search
  • Backtracking search is the basic uninformed algorithm for CSPs
  • can solve n-queens for n approx. 25
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

commutative

A

ex:

[WA = red then NT = green] same as [NT = green then WA = red]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Backtracking search implementation

A
function Backtracking search(csp) returns a solution or failure
return Recursive-Backtracking(assignments, csp) 
Function Recursive-backtracking returns a solution or failure
-if assignment is complete then return assignment
-var<-- Recursive-Backtracking(assignment, csp)
---if result != failure then return result
---remove {var = value} from assignment
--return failure
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

minimum remaining values (MRV) heuristic

A

improves backtracking efficiency
general purpose
Most constrained variable: FIRST FAIL
Choose the variable with the fewest legal values (i.e. the variable with the least number of successors)
-for tiebreakers, choose the variable with the most constraints on remaining variables
-combining with choosing of the least constraining

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Least constraining value

A

given a variable, choose the least constraining value to SUCCEED FIRST
-choose the one that rules out the fewest values in the remaining

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

cons of backtracking

A

thrashing
redundant work
late detection of conflict

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

backtracking thrashing

A

throws away the reason of conflict
Ex: A,B,C,D.E:: 1..10 A>E
-BT tries all the assignments for BCD before finding that A != 1
-soln: backjumping (jump to the source of failure)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

backtracking redundant work

A

unnecessary constraint checks are repeated

ex: A,B,C,D,E:: 1..10, B+8<D, C=5*E
- when assigning C,E the values 1,…,9 are repeatedly checked for D
- Soln: rememember (no-)good assignments

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

backtracking late detection of conflict

A
  • constraint violation is discovered only when values for all variables in constraints are known
  • Example: A,B,C,D,E::1..10, A=3*E
  • -the fact that A>2 is discovered when labeling E
  • -Soln: forward checking(forward check of constraints)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly