How to convert n-ary CSP to binary CSP using dual graph transformation

蓝咒 提交于 2019-12-04 00:27:36

Let's say your problem has the following constraints:

  • C1, which involves x, y and z:
    • x + y = z
  • C2, which involves x and y:
    • x < y

with the following domains:

  • x :: [1,2,3]
  • y :: [1,2,3]
  • z :: [1,2,3]

The author says that you need to create 2 more variables, one for each constraint. They are defined as follows:

  • c1 = < x, y, z >
  • c2 = < x, y >

The domains of c1 and c2 are defined so that they don't violate C1 and C2, i.e.:

  • c1 :: [ <1,2,3>, <2,1,3>, <1,1,2>]
  • c2 :: [<1,2>, <2,3>, <1,3>]

c1 and c2 will be the nodes of the dual graph, but first you need to define a constraint between them, i.e. R1:

  • R1: "the 1st and the 2nd element of c1 (x and y) must be equal to the 1st and the 2nd element of c2 respectively" (actually you could split it in two simpler constraints)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!