- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
当我读这本书 -- 人工智能(一种现代方法)时,我遇到了以下描述将 n 元约束搜索问题转换为二进制问题的方法的句子:
Another way to convert an n-ary CSP to a binary one is the dual graph transformation: create a new graph in which there will be one variable for each constraint in the original graph, and one binary constraint for each pair of constraints in the original graph that share variables. For example, if the original graph has variables {X, Y, Z} and constraints ⟨(X, Y, Z), C1⟩ and ⟨(X, Y ), C2⟩ then the dual graph would have variables {C1, C2} with the binary constraint ⟨(X, Y ), R1 ⟩, where (X, Y ) are the shared variables and R1 is a new relation that defines the constraint between the shared variables, as specified by the original C1 and C2.
我不太明白书中提供的例子,谁能帮忙用另一种方式解释一下,最好提供一个具体的例子?谢谢:D
最佳答案
假设您的问题具有以下约束:
具有以下域:
作者说您需要再创建 2 个变量,每个约束一个。它们的定义如下:
定义了 c1 和 c2 的域,以便它们不违反 C1 和 C2,即:
c1 和 c2 将是对偶图的节点,但首先您需要在它们之间定义一个约束,即 R1:
关于algorithm - 如何使用对偶图变换将 n 元 CSP 转换为二进制 CSP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19261183/
我在 CentOS 机器的 MariaDB 上成功运行了这个命令: MariaDB> select * from foobar into outfile '/tmp/schrodinger_cat.c
我是一名优秀的程序员,十分优秀!