ECE 4524 Artificial Intelligence and Engineering Applications - - PowerPoint PPT Presentation

ece 4524 artificial intelligence and engineering
SMART_READER_LITE
LIVE PREVIEW

ECE 4524 Artificial Intelligence and Engineering Applications - - PowerPoint PPT Presentation

ECE 4524 Artificial Intelligence and Engineering Applications Meeting 7: Constraint Satisfaction Reading: AIAMA 6.1-6.2 Todays Schedule: Review of problem solving using state space search States with factored representations Define


slide-1
SLIDE 1

ECE 4524 Artificial Intelligence and Engineering Applications

Meeting 7: Constraint Satisfaction Reading: AIAMA 6.1-6.2 Today’s Schedule:

◮ Review of problem solving using state space search ◮ States with factored representations ◮ Define a Constraint Satisfaction Problem (CSP) ◮ Examples of CSPs ◮ AC-3 algorithm

slide-2
SLIDE 2

Constraint Satisfaction

Constraint Satisfaction is a relatively new field (1970’s)

◮ Early motivation was the interpretation of line drawings,

Huffman-Clowes labeling (1971).

◮ Mathematically formalized by Montanari in 1974 ◮ Haralick, Davis, Rosenfeld, showed in general such problems

were NP complete (1978)

◮ Applications in machine vision, belief maintenance, scheduling,

temporal reasoning, graph problems, floor plan design, the planning of genetic experiments, the satisfiability problem, ...

◮ Specialized programming languages were developed in 1980’s,

e.g. ALICE See Lauriere, 1978 for a good historical reference.

slide-3
SLIDE 3

Review of the Problem Solving Agent

Problem Solving Agents formulate problems by

◮ representing (model) the world as atomic states, ◮ defining an initial state that represents the initial condition of

the world,

◮ defining a goal state that represents what they want the

world to look like,

◮ and defining a function for allowable state transitions which

map onto actions in the world.

slide-4
SLIDE 4

Some problems have states that can be factored

◮ state = variables with values ◮ constraints specify allowed or prohibited relationships among

the variables

◮ general purpose heuristics can be applied

A classic example is Einstein’s Riddle (Zebra puzzle).

slide-5
SLIDE 5

Einstein’s Riddle

  • 1. There are five houses.
  • 2. The Englishman lives in the red house.
  • 3. The Spaniard owns the dog.
  • 4. Coffee is drunk in the green house.
  • 5. The Ukrainian drinks tea.
  • 6. The green house is immediately to the right of the ivory house.
  • 7. The Old Gold smoker owns snails.
  • 8. Kools are smoked in the yellow house.
  • 9. Milk is drunk in the middle house.
  • 10. The Norwegian lives in the first house.
  • 11. The man who smokes Chesterfields lives in the house next to

the man with the fox.

  • 12. Kools are smoked in the house next to the house where the

horse is kept.

  • 13. The Lucky Strike smoker drinks orange juice.
  • 14. The Japanese smokes Parliaments.
  • 15. The Norwegian lives next to the blue house.
slide-6
SLIDE 6

Formally a CSP is

◮ X, a finite set of variables ◮ D, a set of Domains for each variable, each Domain also a set ◮ C, a set of constraints, each defined as (scope, relation)

◮ scope - set of variables, a subset of X involved in the relation ◮ relation - the relationship among them, a function of the scope

variables that returns True or False

slide-7
SLIDE 7

Warmup

NPR’s Weekend Edition Sunday usually has a word puzzle, e.g. “Think of a well-known actor, three letters in the first name, seven letters in the last. One of the letters is an ”S.” Change the ”S” to a ”K” and rearrange the result, and you’ll name a well-known fictional character. Who is it?” Describe the above as a CSP.

slide-8
SLIDE 8

Exercise

Consider the following CSP. X = X1, X2 D = X1 ∈ Strictly Positive Real Numbers, X2 ∈ Strictly Positive Integers C = X 2

1 + X 2 2 < 2

What is the solution (manual), i.e. what are allowed values of X1 and X2?

slide-9
SLIDE 9

CSP solutions

An assignment of variables to values in their respective domain can be

◮ consistent - violates no constraints ◮ partial, if some variables unassigned ◮ complete, if all variables are assigned a value

A solution to the CSP is a complete and consistent assignment.

slide-10
SLIDE 10

Some terminology

◮ Domains may be continuous or discrete, finite or infinite ◮ Constraints may be

◮ unary - only one variable in the scope ◮ binary - only two variables in the scope ◮ n-ary - n variables in scope ◮ global - arbitrary number of variables are in the scope (often

all of them)

slide-11
SLIDE 11

Most CSP algorithms assume binary constraints.

How might one in general convert all n-ary constraints to binary

  • nes?

Give it some thought, can you see a solution in the case A + B = C? (Exercise 6.6 in the text)

slide-12
SLIDE 12

Example: Map Coloring

slide-13
SLIDE 13

Example: Scheduling

◮ How to schedule experiments on an expensive piece of

equipment, e.g. Large Hadron Collider or Hubble Space Telescope.

◮ How to schedule courses (or meetings in general) ◮ How to schedule jobs on CPUs or computer clusters ◮ How to schedule tasks on a large construction project ◮ How to pack containers and vehicles ◮ etc.

slide-14
SLIDE 14

Example: Sukodu

slide-15
SLIDE 15

Example: KenKen

slide-16
SLIDE 16

Inference using Local Consistency

◮ Node Consistency ◮ Arc Consistency ◮ Path Consistency

slide-17
SLIDE 17

AC-3 Algorithm

slide-18
SLIDE 18

Exercise

A CSP: X : {X1, X2, X3} D : X1 ∈ {A, B, C} , X2 ∈ {A, C, E} , X3 ∈ {E, B, C, A} C : {X1 = X2 = X3} Apply AC-3 to check for an inconsistency.

slide-19
SLIDE 19

Next Actions

◮ Continue reading on Constraint Satisfaction, AIAMA 6.3-6.4 ◮ Take warmup before noon on Thursday 2/8.

Reminders

◮ PS1 is due 2/12.