E约束满足人工智能(AI)课件.ppt
《E约束满足人工智能(AI)课件.ppt》由会员分享,可在线阅读,更多相关《E约束满足人工智能(AI)课件.ppt(77页珍藏版)》请在三一办公上搜索。
1、约束满足问题 (CSP) Constraint Satisfaction Problems (CSP)(对于困难的决策,我们将推迟到它变得容易的时候再做决定) R&N: Chap. 5,约束满足问题 (CSP) Constraint Satis,我们想做些什么?,搜索技术通常按照一个任意的次序对可能进行选择,一般很少有效的信息能够帮助如何进行选择在许多问题中,状态的到达与进行选择的次序无关(“可交换”) ,即采取不同的次序进行选择也一样可以到达同一个状态那能否通过选定某种适合的选择次序能够更有效的解决这些问题呢?甚至可以避免进行选择?,我们想做些什么?搜索技术通常按照一个任意的次序对可能进行选
2、择,约束传播Constraint Propagation,将一个皇后放入到一个方格里移去所有可能攻击到的方格,约束传播Constraint Propagation将一个,6655556,5 5 5 5 5 6 7,Constraint Propagation,计算每一行、每一列不会受到攻击的方格数将一个皇后放置在有着最小数目的行或列上再次移去可能受到攻击的所有方格,65 5 5 5 5 6 7C,344335,4 3 3 3 4 5,重复前述过程,Constraint Propagation,34 3 3 3 4 5,43234,3 3 3 4 3,Constraint Propagation
3、,3 3 3 4 3,42213,3 3 3 1,Constraint Propagation,3 3 3,221,2 2 1,Constraint Propagation,2 2 1Constraint Propagatio,Constraint Propagation,21,1 2,Constraint Propagation1 2,Constraint Propagation,1,1,Constraint Propagation1,Constraint Propagation,Constraint Propagation,我们需要些什么?,后继函数与目标测试还需要:通过约束传播( pro
4、pagate the constraints )信息,比如通过对一个皇后位置的约束来影响其他皇后的位置提前的失败测试(failure test)约束的清晰表示 约束传播算法,我们需要些什么?后继函数与目标测试,约束满足问题 (CSP) Constraint Satisfaction Problem (CSP),变量的集合 variables X1, X2, , Xn每一个变量Xi所有可能的取值,构成该变量的值域Di;通常Di是有限的约束的集合 constraints C1, C2, , Cp每个约束描述了一个变量子集与特定的某些值合法的结合对应关系目标: 每一个变量都得到了一个赋值,且所有的约
5、束得到满足,约束满足问题 (CSP) Constraint Satis,地图着色问题,7 个变量 WA,NT,SA,Q,NSW,V,T 每个变量的值域是一样的: red, green, blue 两个相邻的变量不能取相同的值:WANT, WASA, NTSA, NTQ, SAQ, SANSW, SAV,QNSW, NSWV,地图着色问题 7 个变量 WA,NT,SA,Q,NSW,V,8-皇后问题,8 个变量 Xi, i = 1 to 8 每个变量的值域均为: 1,2,8 约束表示为如下形式:Xi = k Xj k for all j = 1 to 8, ji对角线也是相同的约束,所有的约束都是
6、二进制表示,8-皇后问题 8 个变量 Xi, i = 1 to 8所有的,Street Puzzle(课本习题5.13),Ni = English, Spaniard, Japanese, Italian, NorwegianCi = Red, Green, White, Yellow, BlueDi = Tea, Coffee, Milk, Fruit-juice, WaterJi = Painter, Sculptor, Diplomat, Violinist, DoctorAi = Dog, Snails, Fox, Horse, Zebra,The Englishman lives i
7、n the Red houseThe Spaniard has a DogThe Japanese is a PainterThe Italian drinks TeaThe Norwegian lives in the first house on the leftThe owner of the Green house drinks CoffeeThe Green house is on the right of the White houseThe Sculptor breeds SnailsThe Diplomat lives in the Yellow houseThe owner
8、of the middle house drinks MilkThe Norwegian lives next door to the Blue houseThe Violinist drinks Fruit juiceThe Fox is in the house next to the DoctorsThe Horse is next to the Diplomats,Who owns the Zebra?Who drinks Water?,Street Puzzle(课本习题5.13)12345Ni,Street Puzzle,Ni = English, Spaniard, Japane
9、se, Italian, NorwegianCi = Red, Green, White, Yellow, BlueDi = Tea, Coffee, Milk, Fruit-juice, WaterJi = Painter, Sculptor, Diplomat, Violinist, DoctorAi = Dog, Snails, Fox, Horse, Zebra,The Englishman lives in the Red houseThe Spaniard has a DogThe Japanese is a PainterThe Italian drinks TeaThe Nor
10、wegian lives in the first house on the leftThe owner of the Green house drinks CoffeeThe Green house is on the right of the White houseThe Sculptor breeds SnailsThe Diplomat lives in the Yellow houseThe owner of the middle house drinks MilkThe Norwegian lives next door to the Blue houseThe Violinist
11、 drinks Fruit juiceThe Fox is in the house next to the DoctorsThe Horse is next to the Diplomats,Street Puzzle12345Ni = Englis,Street Puzzle,Ni = English, Spaniard, Japanese, Italian, NorwegianCi = Red, Green, White, Yellow, BlueDi = Tea, Coffee, Milk, Fruit-juice, WaterJi = Painter, Sculptor, Diplo
12、mat, Violinist, DoctorAi = Dog, Snails, Fox, Horse, Zebra,The Englishman lives in the Red houseThe Spaniard has a DogThe Japanese is a PainterThe Italian drinks TeaThe Norwegian lives in the first house on the leftThe owner of the Green house drinks CoffeeThe Green house is on the right of the White
13、 houseThe Sculptor breeds SnailsThe Diplomat lives in the Yellow houseThe owner of the middle house drinks MilkThe Norwegian lives next door to the Blue houseThe Violinist drinks Fruit juiceThe Fox is in the house next to the DoctorsThe Horse is next to the Diplomats,(Ni = English) (Ci = Red),(Ni =
14、Japanese) (Ji = Painter),(N1 = Norwegian),其余的类似,留给同学们思考,(Ci = White) (Ci+1 = Green)(C5 White)(C1 Green),Street Puzzle12345Ni = Englis,Street Puzzle,Ni = English, Spaniard, Japanese, Italian, NorwegianCi = Red, Green, White, Yellow, BlueDi = Tea, Coffee, Milk, Fruit-juice, WaterJi = Painter, Sculptor
15、, Diplomat, Violinist, DoctorAi = Dog, Snails, Fox, Horse, Zebra,The Englishman lives in the Red houseThe Spaniard has a DogThe Japanese is a PainterThe Italian drinks TeaThe Norwegian lives in the first house on the leftThe owner of the Green house drinks CoffeeThe Green house is on the right of th
16、e White houseThe Sculptor breeds SnailsThe Diplomat lives in the Yellow houseThe owner of the middle house drinks MilkThe Norwegian lives next door to the Blue houseThe Violinist drinks Fruit juiceThe Fox is in the house next to the DoctorsThe Horse is next to the Diplomats,(Ni = English) (Ci = Red)
17、,(Ni = Japanese) (Ji = Painter),(N1 = Norwegian),(Ci = White) (Ci+1 = Green)(C5 White)(C1 Green),一元(unary)约束,Street Puzzle12345Ni = Englis,Street Puzzle,Ni = English, Spaniard, Japanese, Italian, NorwegianCi = Red, Green, White, Yellow, BlueDi = Tea, Coffee, Milk, Fruit-juice, WaterJi = Painter, Scu
18、lptor, Diplomat, Violinist, DoctorAi = Dog, Snails, Fox, Horse, Zebra,The Englishman lives in the Red houseThe Spaniard has a DogThe Japanese is a PainterThe Italian drinks TeaThe Norwegian lives in the first house on the left N1 = NorwegianThe owner of the Green house drinks CoffeeThe Green house i
19、s on the right of the White houseThe Sculptor breeds SnailsThe Diplomat lives in the Yellow houseThe owner of the middle house drinks Milk D3 = MilkThe Norwegian lives next door to the Blue houseThe Violinist drinks Fruit juiceThe Fox is in the house next to the DoctorsThe Horse is next to the Diplo
20、mats,Street Puzzle12345Ni = Englis,Street Puzzle,Ni = English, Spaniard, Japanese, Italian, NorwegianCi = Red, Green, White, Yellow, BlueDi = Tea, Coffee, Milk, Fruit-juice, WaterJi = Painter, Sculptor, Diplomat, Violinist, DoctorAi = Dog, Snails, Fox, Horse, Zebra,The Englishman lives in the Red ho
21、use C1 RedThe Spaniard has a Dog A1 DogThe Japanese is a PainterThe Italian drinks TeaThe Norwegian lives in the first house on the left N1 = NorwegianThe owner of the Green house drinks CoffeeThe Green house is on the right of the White houseThe Sculptor breeds SnailsThe Diplomat lives in the Yello
22、w houseThe owner of the middle house drinks Milk D3 = MilkThe Norwegian lives next door to the Blue houseThe Violinist drinks Fruit juice J3 ViolinistThe Fox is in the house next to the DoctorsThe Horse is next to the Diplomats,Street Puzzle12345Ni = Englis,有限CSP vs. 无限CSPFinite vs. Infinite CSP,有限C
23、SP : 每个变量的值域有有限个值无限CSP : 一些或所有的变量的值域是无限的E.g., 实数线性规划:本课程只讨论有限CSP,有限CSP vs. 无限CSPFinite vs. Inf,CSP 描述为搜索问题,n个变量 X1, ., Xn合法赋值 : Xi1 vi1, ., Xik vik, 0 k n, 即取值vi1, ., vik满足所有与变量Xi1, ., Xik有关的约束完全赋值: k由0到n,每个变量都得到了赋值 变量值域大小为d, 则有O(dn) 种完全赋值状态: 合法赋值初始状态: 空赋值 , 即 k = 0,也就是还没有变量得到赋值状态的后继: Xi1vi1, ., Xik
24、vik Xi1vi1, ., Xikvik, Xik+1vik+1目标测试: k = n,即n个变量都得到了赋值,CSP 描述为搜索问题n个变量 X1, ., Xn,E约束满足人工智能(AI)课件,4 变量 X1, ., X4令节点N的合法赋值为: A = X1 v1, X3 v3 以为变量X4取值为例令X4 的值域为 v4,1, v4,2, v4,3A的后继为以下赋值中的合法赋值: X1 v1, X3 v3 , X4 v4,1 X1 v1, X3 v3 , X4 v4,2 X1 v1, X3 v3 , X4 v4,3 ,4 变量 X1, ., X4,E约束满足人工智能(AI)课件,回溯搜索B
25、acktracking Search,本质即使用递归的简化深度优先算法,回溯搜索Backtracking Search本质即使用递,回溯搜索(3 变量),赋值 Assignment = ,回溯搜索(3 变量)赋值 Assignment = ,赋值 Assignment = (X1,v11),X1,v11,回溯搜索(3 变量),赋值 Assignment = (X1,v11)X1v1,赋值 Assignment = (X1,v11), (X3,v31),X1,v11,v31,X3,回溯搜索(3 变量),赋值 Assignment = (X1,v11), (X3,赋值 Assignment = (
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 约束 满足 人工智能 AI 课件
链接地址:https://www.31ppt.com/p-1284662.html