CS 730/830: Intro AI CSPs 1 handout: slides asst 4 posted Wheeler - - PowerPoint PPT Presentation

cs 730 830 intro ai
SMART_READER_LITE
LIVE PREVIEW

CS 730/830: Intro AI CSPs 1 handout: slides asst 4 posted Wheeler - - PowerPoint PPT Presentation

CS 730/830: Intro AI CSPs 1 handout: slides asst 4 posted Wheeler Ruml (UNH) Lecture 8, CS 730 1 / 14 EOLQs CSPs Wheeler Ruml (UNH) Lecture 8, CS 730 2 / 14 CSPs Other Problems Types of Problems UNH Backtracking


slide-1
SLIDE 1

CS 730/830: Intro AI

CSPs

Wheeler Ruml (UNH) Lecture 8, CS 730 – 1 / 14

1 handout: slides asst 4 posted

slide-2
SLIDE 2

EOLQs

CSPs

Wheeler Ruml (UNH) Lecture 8, CS 730 – 2 / 14

slide-3
SLIDE 3

Constraint Satisfaction Problems

CSPs ■ Other Problems ■ Types of Problems ■ UNH ■ Backtracking ■ Break ■ Forward Checking ■ ‘Heuristics’ ■ Example Results ■ MAC ■ Other Algorithms ■ EOLQs

Wheeler Ruml (UNH) Lecture 8, CS 730 – 3 / 14

slide-4
SLIDE 4

Beyond Planning

CSPs ■ Other Problems ■ Types of Problems ■ UNH ■ Backtracking ■ Break ■ Forward Checking ■ ‘Heuristics’ ■ Example Results ■ MAC ■ Other Algorithms ■ EOLQs

Wheeler Ruml (UNH) Lecture 8, CS 730 – 4 / 14

Map coloring: Given a map of n countries and a set of k colors, color every country differently from its neighbors. n-queens : Given an n × n chessboard, arrange n queens so that none is attacking another. configuration : Given di options for each of the n components

  • f a computer system (CPU, backplane, storage system,

NICs), find a set of options compatible with the choices the customer has already made. scheduling : Given a set of temporal constraints (eg, t2 ≥ t1 + 30), find a feasible set of times. What algorithm would you use?

slide-5
SLIDE 5

Types of Search Problems

CSPs ■ Other Problems ■ Types of Problems ■ UNH ■ Backtracking ■ Break ■ Forward Checking ■ ‘Heuristics’ ■ Example Results ■ MAC ■ Other Algorithms ■ EOLQs

Wheeler Ruml (UNH) Lecture 8, CS 730 – 5 / 14

Shortest-path (vacuum, tile puzzle, M&C)

given operators and their costs

want least-cost path to a goal

goal depth/cost unknown

Decisions with an adversary (chess, tic-tac-toe)

adversary might prevent path to best goal

want best assured outcome

Constraint satisfaction (map coloring, n-queens)

any goal is fine

fixed depth

explicit constraints on partial solutions

slide-6
SLIDE 6

Gene Freuder: Father of Constraint Programming

CSPs ■ Other Problems ■ Types of Problems ■ UNH ■ Backtracking ■ Break ■ Forward Checking ■ ‘Heuristics’ ■ Example Results ■ MAC ■ Other Algorithms ■ EOLQs

Wheeler Ruml (UNH) Lecture 8, CS 730 – 6 / 14

Gene Freuder (UNH 1977?–2001)

slide-7
SLIDE 7

Chronological Backtracking

CSPs ■ Other Problems ■ Types of Problems ■ UNH ■ Backtracking ■ Break ■ Forward Checking ■ ‘Heuristics’ ■ Example Results ■ MAC ■ Other Algorithms ■ EOLQs

Wheeler Ruml (UNH) Lecture 8, CS 730 – 7 / 14

Do not expand any partial solution that violates a constraint.

slide-8
SLIDE 8

Break

CSPs ■ Other Problems ■ Types of Problems ■ UNH ■ Backtracking ■ Break ■ Forward Checking ■ ‘Heuristics’ ■ Example Results ■ MAC ■ Other Algorithms ■ EOLQs

Wheeler Ruml (UNH) Lecture 8, CS 730 – 8 / 14

asst 3? control? games?

asst 4

projects

slide-9
SLIDE 9

Forward Checking

CSPs ■ Other Problems ■ Types of Problems ■ UNH ■ Backtracking ■ Break ■ Forward Checking ■ ‘Heuristics’ ■ Example Results ■ MAC ■ Other Algorithms ■ EOLQs

Wheeler Ruml (UNH) Lecture 8, CS 730 – 9 / 14

When assigning a variable, remove the conflicting values for all connected variables. Backtrack on domain wipeout. Arc consistency: for every value in the domain of x, there exists a value in the domain of y that satisfies all the constraints.

slide-10
SLIDE 10

Heuristics for CSPs

CSPs ■ Other Problems ■ Types of Problems ■ UNH ■ Backtracking ■ Break ■ Forward Checking ■ ‘Heuristics’ ■ Example Results ■ MAC ■ Other Algorithms ■ EOLQs

Wheeler Ruml (UNH) Lecture 8, CS 730 – 10 / 14

Variable choice: choose most constrained variable (smallest domain)

want to keep tree small, failing quickly Value choice: try least constraining value first (fewest removals)

might as well succeed sooner if possible

slide-11
SLIDE 11

Example Results

CSPs ■ Other Problems ■ Types of Problems ■ UNH ■ Backtracking ■ Break ■ Forward Checking ■ ‘Heuristics’ ■ Example Results ■ MAC ■ Other Algorithms ■ EOLQs

Wheeler Ruml (UNH) Lecture 8, CS 730 – 11 / 14

BT FC FC+MCV USA > 1M 2K 60 n-Queens > 40M > 40M 820K Zebra 3.9M 35K 500 Random 1 420K 26K 2K Random 2 940K 77K 15K

slide-12
SLIDE 12

Maintaining Arc Consistency

CSPs ■ Other Problems ■ Types of Problems ■ UNH ■ Backtracking ■ Break ■ Forward Checking ■ ‘Heuristics’ ■ Example Results ■ MAC ■ Other Algorithms ■ EOLQs

Wheeler Ruml (UNH) Lecture 8, CS 730 – 12 / 14

Ensure every value for x has a legal value in all neighbors y. If

  • ne doesn’t, remove it and ensure consistency of all y.
slide-13
SLIDE 13

Maintaining Arc Consistency

CSPs ■ Other Problems ■ Types of Problems ■ UNH ■ Backtracking ■ Break ■ Forward Checking ■ ‘Heuristics’ ■ Example Results ■ MAC ■ Other Algorithms ■ EOLQs

Wheeler Ruml (UNH) Lecture 8, CS 730 – 12 / 14

Ensure every value for x has a legal value in all neighbors y. If

  • ne doesn’t, remove it and ensure consistency of all y.

while Q is not empty (x, y) ← pop Q if revised(x, y) then if x’s domain is now empty, return failure for every other neighbor z of x push (z, x) on Q revise(x, y) revised← false foreach v in x’s domain if no value in domain of y is compatible with v remove v from x’s domain revised← true return revised

slide-14
SLIDE 14

Other Algorithms for CSPs

CSPs ■ Other Problems ■ Types of Problems ■ UNH ■ Backtracking ■ Break ■ Forward Checking ■ ‘Heuristics’ ■ Example Results ■ MAC ■ Other Algorithms ■ EOLQs

Wheeler Ruml (UNH) Lecture 8, CS 730 – 13 / 14

(Conflict-directed) Backjumping

Dynamic backtracking

Randomized restarting Course projects!

slide-15
SLIDE 15

EOLQs

CSPs ■ Other Problems ■ Types of Problems ■ UNH ■ Backtracking ■ Break ■ Forward Checking ■ ‘Heuristics’ ■ Example Results ■ MAC ■ Other Algorithms ■ EOLQs

Wheeler Ruml (UNH) Lecture 8, CS 730 – 14 / 14

Please write down the most pressing question you have about the course material covered so far and put it in the box on your way out. Thanks!