Map Coloring and DFS Techniques in Constraint Satisfaction Problems

example map coloring n.w
1 / 21
Embed
Share

Explore map coloring and Depth-First Search (DFS) techniques in constraint satisfaction problems. Learn about variable domains, constraints, solutions, node ordering heuristics, and information propagation through constraints. Discover strategies like minimum remaining values, degree heuristic, least constraining value, and forward checking to solve complex problems efficiently.

  • Map Coloring
  • DFS Techniques
  • Constraint Satisfaction
  • Heuristics
  • Problem Solving

Uploaded on | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. EXAMPLE: MAP COLORING

  2. Example: Map coloring Variables WA, NT, Q, NSW, V, SA, T Domains Di={red,green,blue} Constraints adjacent regions must have different colors. E.g. WA NT (if the language allows this) E.g. (WA,NT) in {(red,green),(red,blue),(green,red), } E.g. (WA,NT) not in {(red,red),(blue,blue),(green,green)}

  3. Example: Map coloring Solutions are assignments satisfying all constraints, e.g. {WA=red,NT=green,Q=red,NSW=green,V=red,SA=blue,T=green}

  4. DFS ON AUSTRALIA

  5. Search example

  6. Search example

  7. Search example

  8. DFS NODE ORDERING HEURISTICS

  9. Minimum remaining values heuristic Select the most constrained variable (the variable with the smallest number of remaining values)

  10. Degree heuristic Select the variable that is involved in the largest number of constraints with other unassigned variables A useful tie breaker. In what order should its values be tried?

  11. Least constraining value Allows 1 value for SA Allows 0 value for SA Given a variable, choose the least constraining value the value that leaves the maximum flexibility for subsequent variable assignments.

  12. PROPAGATING INFORMATION THROUGH CONSTRAINTS

  13. Forward checking Can we detect inevitable failure early? And avoid it later? Yes track remaining legal values for unassigned variables Terminate search when any variable has no legal values.

  14. Forward checking Assign {WA=red} Effects on other variables connected by constraints with WA NT can no longer be red SA can no longer be red

  15. Forward checking Assign {Q=green} Effects on other variables connected by constraints with WA NT can no longer be green NSW can no longer be green SA can no longer be green

  16. Forward checking If V is assigned blue Effects on other variables connected to WA NSW can no longer be blue SA is empty (no valid assignment is possible) FC has detected a partial assignment that is inconsistent with the constraints.

  17. Forward checking Solving CSPs with heuristics + forward checking is more efficient than either approach alone FC checking propagates information from assigned to unassigned variables but does not provide detection for all failures. FC misses the fact that NT and SA cannot be blue We need constraint propagation to enforce constraints locally

  18. Arc consistency X Y is consistent iff for every value x of X there is some allowed y SA NSW is consistent iff SA=blue and NSW=red What about the other direction NSW SA?

  19. Arc consistency X Y is consistent iff for every value x of X there is some allowed y NSW SA is consistent iff NSW=red and SA=blue NSW=blue and SA=??? Arc can be made consistent by removing blue from NSW

  20. Arc consistency Arc can be made consistent by removing blue from NSW Recheck neighbours Remove red from V

  21. Arc consistency Arc can be made consistent by removing blue from NSW Recheck neighbours Remove red from V Arc consistency detects failure earlier than forward checking Can be run as a preprocessor or after each assignment. Repeated until no inconsistency remains

More Related Content