html5-img
1 / 14

Constraint Satisfaction Problems

Constraint Satisfaction Problems. Chapter 5 Section 1 – 3 Modified by Vali Derhami. Forward checking وارسی پیشرو. Idea : Keep track of remaining legal values for unassigned variables

diallo
Télécharger la présentation

Constraint Satisfaction Problems

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. Constraint Satisfaction Problems Chapter 5 Section 1 – 3 Modified by Vali Derhami CS 3243 - Constraint Satisfaction

  2. Forward checkingوارسی پیشرو • Idea: • Keep track of remaining legal values for unassigned variables هنگامیکه به یک متغیر انتسابی می شود تمام مقادیری از متغیرهای انتساب نیافته دیگر که با این مقدار دهی ناسازگارند را از دامنه آن متغیرها حذف میکند • Terminate search when any variable has no legal values CS 3243 - Constraint Satisfaction

  3. Forward checking • Idea: • Keep track of remaining legal values for unassigned variables • Terminate search when any variable has no legal values CS 3243 - Constraint Satisfaction

  4. Forward checking • Idea: • Keep track of remaining legal values for unassigned variables • Terminate search when any variable has no legal values CS 3243 - Constraint Satisfaction

  5. Forward checking • Idea: • Keep track of remaining legal values for unassigned variables • Terminate search when any variable has no legal values CS 3243 - Constraint Satisfaction

  6. Constraint propagation • Forward checking propagates information from assigned to unassigned variables, but doesn't provide early detection for all failures: • NT and SA cannot both be blue! • Constraint propagation repeatedly enforces constraints locally CS 3243 - Constraint Satisfaction

  7. Arc consistency سازگاری کمان • Simplest form of propagation makes each arc consistent X Y is consistent iff for every value dxof X there is some allowed dy برای هر مقدار dx از متغیر X یک مقدار مجاز برای متغیر Y باشد CS 3243 - Constraint Satisfaction

  8. Arc consistency • Simplest form of propagation makes each arc consistent X Y is consistent iff for every value dxof X there is some allowed dy CS 3243 - Constraint Satisfaction

  9. Arc consistency • Simplest form of propagation makes each arc consistent X Y is consistent iff for every value dxof X there is some allowed dy • If X loses a value, neighbors of X need to be rechecked CS 3243 - Constraint Satisfaction

  10. Arc consistency • Simplest form of propagation makes each arc consistent X Y is consistent iff for every value dxof X there is some allowed dy • If X loses a value, neighbors of X need to be rechecked • Arc consistency detects failure earlier than forward checking Can be run as a preprocessor or after each assignment CS 3243 - Constraint Satisfaction

  11. Arc consistency algorithm AC-3 • Time complexity: O(n2d3) CS 3243 - Constraint Satisfaction

  12. Local search for CSPs • Hill-climbing, simulated annealing typically work with "complete" states, i.e., all variables assigned • To apply to CSPs: • allow states with unsatisfied constraints • operators reassign variable values • Variable selection: randomly select any conflicted variable • Value selection by min-conflicts heuristic: • choose value that violates the fewest constraints • i.e., hill-climb with h(n) = total number of violated constraints CS 3243 - Constraint Satisfaction

  13. Example: 4-Queens • States: 4 queens in 4 columns (44 = 256 states) Actions: move queen in column • Goal test: no attacks • Evaluation: h(n) = number of attacks • Given random initial state, can solve n-queens in almost constant time for arbitrary n with high probability (e.g., n = 10,000,000) CS 3243 - Constraint Satisfaction

  14. Summary • CSPs are a special kind of problem: • states defined by values of a fixed set of variables • goal test defined by constraints on variable values • Backtracking = depth-first search with one variable assigned per node • Variable ordering and value selection heuristics help significantly • Forward checking prevents assignments that guarantee later failure • Constraint propagation (e.g., arc consistency) does additional work to constrain values and detect inconsistencies • Iterative min-conflicts is usually effective in practice CS 3243 - Constraint Satisfaction

More Related