3-sat和Tutte多项式

时间:2013-07-13 16:57:29

标签: graph-theory z3 topology z3py satisfiability

请考虑以下3-SAT实例和相应的图表

enter image description here

图表可以用其他两种形式显示

enter image description here

此图的Tutte多项式为

enter image description here

图的独立数是4,那么考虑的3-SAT实例是可满足的。使用代码检查此事实:

x1, x2, x3 = Bools('x1 x2 x3')
s=Solver()
s.add(Or(x1,x2,Not(x3)),Or(x1,Not(x2),x3),Or(Not(x1),x2,x3),Or(Not(x1),Not(x2),Not(x3)))
print s
print s.check()
m = s.model()
print m  

,相应的输出是:

sat
[x3 = False, x2 = False, x1 = False]

图表的相应补充是

enter image description here

和图的补数的Tutte多项式是

enter image description here

补语的集团数是4,然后它表示所考虑的3-SAT实例是可以满足的。

问题是:可以使用Tutte多项式来判断所考虑的3-SAT实例是否可以满足?

2 个答案:

答案 0 :(得分:1)

其他例子:

enter image description here

图表可以以其他两种形式显示:

enter image description here

此图的Tutte多项式为:

enter image description here

图的独立数是3,那么考虑的3-SAT实例是可满足的。使用代码检查此事实:

x, y, z = Bools('x y z')
s = Solver()
s.add(Or(x,y,z),Or(Not(x),Not(y),Not(z)),Or(x,Not(y),Not(z)))
print s.check()
m = s.model()
print m

,相应的输出是:

sat
[z = False, y = True, x = False]

图表的相应补充是

enter image description here

和图的补数的Tutte多项式是

enter image description here

补语的集团数是3,然后它表示所考虑的3-SAT实例是可以满足的。

问题是:可以使用Tutte多项式来计算所考虑的3-SAT实例的可能模型吗?

答案 1 :(得分:0)

其他例子:

enter image description here

Tutte多项式是:

enter image description here

图的独立数是3,那么考虑的3-SAT实例是可满足的。使用代码检查此事实:

x1, x2, x3, x4 = Bools('x1 x2 x3 x4')
s = Solver()
s.add(Or(Not(x1),x2,x3),Or(x1,Not(x2),x3),Or(Not(x1),x2,x4))
print s.check()
m = s.model()
print m

,相应的输出是:

sat
[x3 = False, x2 = False, x1 = False, x4 = False]

图表的相应补充是

enter image description here

和图的补数的Tutte多项式是

enter image description here

补语的集团数是3,然后它表示所考虑的3-SAT实例是可以满足的。