Presentation is loading. Please wait.

Presentation is loading. Please wait.

Constraint Satisfaction Definition. A constraint is a formula of the form: (x = y) (x  y) (x = red) (x  red) Where x and y are variables that can take.

Similar presentations


Presentation on theme: "Constraint Satisfaction Definition. A constraint is a formula of the form: (x = y) (x  y) (x = red) (x  red) Where x and y are variables that can take."— Presentation transcript:

1 Constraint Satisfaction Definition. A constraint is a formula of the form: (x = y) (x  y) (x = red) (x  red) Where x and y are variables that can take values from a set (e.g., {yellow, white, black, red, …}) Definition. A constraint formula is a collection of constraints. Definition. Given a constraint formula is there an instantiation of the variables that makes the formula true Example: ( x = y)  ( x  z)  (y  z) Definition. Constraint-SAT: given a constraint formula, is there an instantiation of the variables that makes the conjunction true?

2 Example of a CSP Problem 8-queens problem:  Put 8 queens in a chess board such that no queen is threatening another queen Modeling the 8-queens problem as a CSP problem:  Make 8 variables, one for every queen: Q 1, Q 2, …, Q 8  Assume that each variable can take a value T[1,1]…T[8,8]  Constraints: homework. See slide 4 T[1,1] T[8,8]

3 Graph Coloring Given a graph, we want to: 1.Assign a color to each node 2.No two nodes that are connected have the same color assigned to them 3.We want to use the minimum number of colors possible that satisfiers 1 and 2

4 Homework Part I: Nov. 15 CSE 435: Write the constraints for the 8-queen problem. To make things easier use more expressive constraints:   i  j : Q 4 = A[i,j]   k if Q 3 = A[i,j] then k  j CSE 335: write pseudo-code of program that receives Q 1,…,Q 8 and checks if it solves the 8-queen problem CSE 435:  Formulate Graph coloring as a decision problem  Show that Constraint-SAT can be polynomially transformed into Graph Coloring (that is, we can transform constraint-SAT into a Graph coloring problem, and this transformation can be done in polynomialm time)


Download ppt "Constraint Satisfaction Definition. A constraint is a formula of the form: (x = y) (x  y) (x = red) (x  red) Where x and y are variables that can take."

Similar presentations


Ads by Google