1 / 44

Tutorial

This tutorial provides a solution to the Map Coloring Constraint Satisfaction Problem (CSP) exercise. The problem involves coloring a map using three colors, such that no two adjacent regions have the same color. The tutorial includes the formulation of the problem as a CSP, the topology of the constraint graph, and various search heuristics to solve the problem.

dowdy
Download Presentation

Tutorial

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. Tutorial Constraint Satisfaction Problems

  2. CSP Exercise 1

  3. Map Coloring • Consider the following map. The task is to color the map using the three colors Red, Blue, and Green, such that no two adjacent regions take the same color.

  4. Map Coloring • Formulate the problem as a CSP. Clearly state the variables, domains, and constraints. • Describe the topology of the constraint graph. • What is the size of the search space? • Color the map using: • Backtracking Search with MRV heuristic. • Backtracking Search with MCV heuristic. • Backtracking Search with LCV heuristic. • Backtracking Search with Forward Checking heuristic. • Note: Variables and values are ordered as follows: • Variables: WA, NT, Q, NSW, V, SA, T • Values: Red, Blue, and Green

  5. Map Coloring • Backtracking Search with MRV heuristic.

  6. Map Coloring • Backtracking Search with MCV heuristic.

  7. Map Coloring • Backtracking Search with LCV heuristic.

  8. Map Coloring • Backtracking Search with Forward Checking.

  9. CSP Exercise 2

  10. {blue, green, red} {blue, green, red} A B {blue, green, red} E C {blue, green, red} D {blue, green, red} H {blue, green, red} F G {blue, green, red} {blue, green, red} 3 colour me! Use all heuristics including arc-propagation to solve this problem.

  11. {blue, green, red} { , green, red} A B {blue, , } E C { , , red} D {blue, , red} H { , green, } F G { , green, } {blue, , } 3 colour me! 3 colour me using Backtracking and Forward Checking …

  12. CSP Exercise 3

  13. CSP – Examination Problem • During an examination, an invigilator has to arrange six students in a way to make sure that the examination is properly conducted and no one cheats. 2 students have makeup in Artificial Intelligence, 1 student has makeup in Database, 2 students have makeup in Mathematics, and 1 student in Physics. As shown in figure below, there exist 6 desks arranged into two rows and three columns.

  14. Examination Problem • The problem for the invigilator is to arrange students so that students having the same makeup exam should not be neighbors (in the same column, in the same row or the same diagonal for example - neighbors of 5 are 1, 2, 3, 4 and 6, - and neighbors of 3 are 2 (same row), 5 (same diagonal) and 6 (same column)). • Propose a formulation of the problem in term of CSP by specifying variables, domains and constraints • Describe the topology of the constraint graph. • Using Forward Checking with Backpropagation, propose a solution to help the invigilator.Variables and values should be selected according to alphabetical or ascending order. • Using Backpropagation with MCV heuristic, propose a solution to help the invigilator. Variables and values are ordered according to alphabetical or ascending order.

  15. AI DB AI M M P Examination Problem - Solution • Using Forward Checking with Backpropagation, propose a solution to help the invigilator.Variables and values should be selected according to alphabetical or ascending order. • Using Backpropagation with MCV heuristic, propose a solution to help the invigilator. Variables and values are ordered according to alphabetical or ascending order.

  16. CSP Exercise 4 Backtracking + FC

  17. Q2 Q3 Q4 Q5 Q6 Q1 1 2 3 4 5 6 Forward Checking • Do it yourself … • Solve 6-queens …

  18. Forward Checking • Solve 6-queens … 2 3 4 5 6 1 1 2 3 4 5 6

  19. Forward Checking • Solve 6-queens … 2 3 4 5 6 1 1 2 3 4 5 6

  20. Forward Checking • Solve 6-queens … 2 3 4 5 6 1 1 2 3 4 5 6

  21. Forward Checking • Solve 6-queens … 2 3 4 5 6 1 1 2 3 4 5 6

  22. Forward Checking • Solve 6-queens … 2 3 4 5 6 1 Column 6 has domain wipeout Backtrack to next “choice” 1 2 3 4 5 6

  23. Forward Checking • Solve 6-queens … 2 3 4 5 6 1 Column 5 has domain wipeout Backtrack to next “choice” 1 2 3 4 5 6

  24. Forward Checking • Solve 6-queens … 2 3 4 5 6 1 1 2 3 4 5 6

  25. Forward Checking • Solve 6-queens … 2 3 4 5 6 1 1 2 3 4 5 6

  26. Forward Checking • Solve 6-queens … 2 3 4 5 6 1 Column 6 has domain wipeout Backtrack to next “choice” 1 2 3 4 5 6

  27. Forward Checking • Solve 6-queens … 2 3 4 5 6 1 1 2 3 4 5 6

  28. Forward Checking • Solve 6-queens … 2 3 4 5 6 1 Column 5 has domain wipeout Backtrack to next “choice” 1 2 3 4 5 6

  29. Forward Checking • Solve 6-queens … 2 3 4 5 6 1 1 2 3 4 5 6

  30. Forward Checking • Solve 6-queens … 2 3 4 5 6 1 1 2 3 4 5 6

  31. Forward Checking • Solve 6-queens … 2 3 4 5 6 1 1 2 3 4 5 6

  32. Forward Checking • Solve 6-queens … 2 3 4 5 6 1 Column 6 has domain wipeout Backtrack to next “choice” 1 2 3 4 5 6

  33. Forward Checking • Solve 6-queens … 2 3 4 5 6 1 1 2 3 4 5 6

  34. Forward Checking • Solve 6-queens … 2 3 4 5 6 1 Column 5 has domain wipeout Backtrack to next “choice” 1 2 3 4 5 6

  35. Forward Checking • Solve 6-queens … 2 3 4 5 6 1 Column 5 has domain wipeout Backtrack to next “choice” 1 2 3 4 5 6

  36. Forward Checking • Solve 6-queens … 2 3 4 5 6 1 1 2 3 4 5 6

  37. Forward Checking • Solve 6-queens … 2 3 4 5 6 1 1 2 3 4 5 6

  38. Forward Checking • Solve 6-queens … 2 3 4 5 6 1 1 2 3 4 5 6

  39. Forward Checking • Solve 6-queens … 2 3 4 5 6 1 1 2 3 4 5 6

  40. Forward Checking • Solve 6-queens … 2 3 4 5 6 1 Column 6 has domain wipeout Backtrack to next “choice” 1 2 3 4 5 6

  41. Forward Checking • Solve 6-queens … 2 3 4 5 6 1 1 2 3 4 5 6

  42. Forward Checking • Solve 6-queens … 2 3 4 5 6 1 1 2 3 4 5 6

  43. Forward Checking • Solve 6-queens … 2 3 4 5 6 1 1 2 3 4 5 6

  44. Forward Checking • Solve 6-queens … 2 3 4 5 6 1 1 2 3 First Solution! 4 5 6

More Related