1 / 13

CSC 423 ARTIFICIAL INTELLIGENCE

CSC 423 ARTIFICIAL INTELLIGENCE. Constraint Satisfaction Problems.

zareh
Download Presentation

CSC 423 ARTIFICIAL INTELLIGENCE

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSC 423ARTIFICIAL INTELLIGENCE Constraint Satisfaction Problems

  2. Formally speaking, a constraint satisfaction problem (or CSP) is defined by a set of variables, X1;X2; : : : ;Xn, and a set of constraints, C1;C2; : : : ;Cn. Each variable Xi has a nonempty domain Di of possible values. Each constraint Ci involves some subset of thevariables and specifies the allowable combinations of values for that subset. CONSTRAINT SATISFACTION PROBLEMS 2

  3. The principal states and territories of Australia The image below shows the principal states of Australia as a colouring map. Draw the map-colouring problem to represent a constraint graph. WA=red; NT=green; Q=red; NSW=green; V=red; SA=blue; T=red : 3

  4. INFINITE DOMAINS • Discrete variables can also have infinite domains—for example, the set of integers orthe set of strings. For example, when scheduling construction jobs onto a calendar, each job’sstart date is a variable and the possible values are integer numbers of days from the currentdate. With infinite domains, it is no longer possible to describe constraints by enumeratingall allowed combinations of values. Instead, a constraint language must be used. • It is also no longerpossible to solve such constraints by enumerating all possible assignments, because there areinfinitely many of them. 4

  5. Types of Constraints • Special solution algorithms (which we will not discuss here) exist for linear constraints on integer variables—that is, constraints, such as the one just given, in which each variable appears only in linear form. It can be shown that no algorithm existsfor solving general nonlinear constraints on integer variables. • The simplest type is the unary constraint, which restricts thevalue of a single variable. Every unary constraint can be eliminated simply by preprocessingthe domain of the corresponding variable to remove any value that violates the constraint. Abinary constraint relates two variables. Abinary CSP is one with only binary constraints; 5

  6. Cryptarithmetic Puzzles Problem • It is usual to insist that each letter ina cryptarithmetic puzzle represent a different digit.this wouldbe represented as the six-variable constraint Alldi (F;T;U;W;R;O). • The addition constraintson the four columns of the puzzle also involve several variables and can be written as • O + O = R + 10. X1 • X1 +W +W = U + 10. X2 • X2 + T + T = O + 10. X3 • X3 = F 6

  7. Cryptarithmetic Puzzles Problem (Cont) • Identify the auxiliary variables in the four columns? X1, X2, X3 • Explain the Cryptarithmetic problem and draw the constraint hypergraph and briefly explain the graph? 7

  8. BACKTRACKING SEARCH FOR CSPS • The term backtracking search is used for a depth-first search that chooses values forone variable at a time and backtracks when a variable has no legal values left to assign. 8

  9. BACKTRACKING SEARCH FOR CSPS ALGORITHM 9

  10. BACKTRACKING SEARCH FOR CSPS SEARCH TREE 10

  11. MINIMUM REMAINING VALUE (MRV) • Choosing the variable with the fewest “legal” values—is called the minimumremaining values (MRV) heuristic. It also has been called the “most constrained variable” or“fail-first” heuristic, the latter because it picks a variable that is most likely to cause a failuresoon, thereby pruning the search tree. If there is a variable X with zero legal values remaining,the MRV heuristic will select X and failure will be detected immediately—avoidingpointless searches through other variables which always will fail when X is finally selected. 11

  12. Constraint Propagation and ARC Consistency • Constraint propagation is the general term for propagating the implicationsof a constraint on one variable onto other variables;The idea of arc consistency provides a fast method of constraint propagation that issubstantially stronger than forward checking. 12

  13. Identify the complexity of solving a CSP • The complexity of solving a CSP is strongly related to the structure of its constraint graph. Tree-structured problems can be solved in linear time. Cutset conditioning can reduce a general CSP to a tree-structure one and is very efficient if a small cutest can be found. Tree decomposition techniques transform the CSP into a tree of sub-problems and are efficient if the tree width of the constraint graph is small. 13

More Related