1 / 12

4-Queens Example

4-Queens Example. (slides adapted from Prof. Kauchak). X1 { 1 ,2,3,4}. X2 {1,2,3,4}. 1. 2. 3. 4. 1. 2. 3. 4. X3 {1,2,3,4}. X4 {1,2,3,4}. 4-Queens Problem. What can we remove with forward checking?. X1 { 1 ,2,3,4}. X2 { 1 , 2 ,3,4}. 1. 2. 3. 4. 1. 2. 3. 4. X3

Download Presentation

4-Queens Example

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. 4-Queens Example (slides adapted from Prof. Kauchak)

  2. X1 {1,2,3,4} X2 {1,2,3,4} 1 2 3 4 1 2 3 4 X3 {1,2,3,4} X4 {1,2,3,4} 4-Queens Problem What can we remove with forward checking?

  3. X1 {1,2,3,4} X2 {1,2,3,4} 1 2 3 4 1 2 3 4 X3 {1,2,3,4} X4 {1,2,3,4} 4-Queens Problem Anything else with arc consistency? Can’t have X2 = 3! (Conflicts with all possible values of X3) forward propagation

  4. X1 {1,2,3,4} X2 {1,2,3,4} 1 2 3 4 1 2 3 4 X3 {1,2,3,4} X4 {1,2,3,4} 4-Queens Problem Anything else? Can’t have X3 = 4! (Conflicts with X2=4)

  5. X1 {1,2,3,4} X2 {1,2,3,4} 1 2 3 4 1 2 3 4 X3 {1,2,3, } X4 {1,2,3,4} 4-Queens Problem Anything else? Can’t have X3 = 2! (Conflicts with all possible values of X4)

  6. X1 {1,2,3,4} X2 {1,2,3,4} 1 2 3 4 1 2 3 4 X3 {1,2,3,4} X4 {1,2,3,4} 4-Queens Problem Did not have to search over values. Just looked at constraints.

  7. X1 {1,2,3,4} X2 {1,2,3,4} 1 2 3 4 1 2 3 4 X3 {1,2,3,4} X4 {1,2,3,4} 4-Queens Problem

  8. X1 {1,2,3,4} X2 {1,2,3,4} 1 2 3 4 1 2 3 4 X3 {1,2,3,4} X4 {1,2,3,4} 4-Queens Problem Try X1=2 Forward checking removes values

  9. X1 {1,2,3,4} X2 {1,2,3,4} 1 2 3 4 1 2 3 4 X3 {1,2,3,4} X4 {1,2,3,4} 4-Queens Problem ? Can’t have X3 = 3 (Conflicts with X2=4)

  10. X1 {1,2,3,4} X2 {1,2,3,4} 1 2 3 4 1 2 3 4 X3 {1,2,3,4} X4 {1,2,3,4} 4-Queens Problem ? Can’t have X4 = 1 or X4 = 4

  11. X1 {1,2,3,4} X2 {1,2,3,4} 1 2 3 4 1 2 3 4 X3 {1,2,3,4} X4 {1,2,3,4} 4-Queens Problem

  12. X1 {1,2,3,4} X2 {1,2,3,4} 1 2 3 4 1 2 3 4 X3 {1,2,3,4} X4 {1,2,3,4} 4-Queens Problem Searched just 2 variables (X1, X2)!

More Related