2-sat 模型

· · 个人记录

## 反边 2-sat 中反边是非常重要的一部分,具体而言若 $(x,st) \to (y,st')$ 则 $(y,st' \oplus 1) \to (x,st \oplus 1)$。 有了反边我们可以推出如下性质: 1. 若 $(x,st) \leadsto (y,st')$ 则 $(y,st' \oplus 1) \leadsto (x,st \oplus 1)$。取反路径上所有边易证。 2. 若 $(x,st) \leadsto (x,st \oplus 1),(y,st') \leadsto (x,st)$ 则 $(y,st') \leadsto (y,st' \oplus 1)$。取反 $(y,st') \leadsto (x,st)$ 上所有边即可。' 3. 若 $(x,st) \leadsto (z,st'),(y,st'') \leadsto (z,st' \oplus 1)$,则 $(x,st) \leadsto (y,st'' \oplus 1)$。取反 $(y,st'') \leadsto (z,st' \oplus 1)$ 即可。 4. 若对于某个 SCC topo 序的前缀确定了合法方案,并且存在至少一个无限制的合法方案(即不存在 $(x,st) \leadsto (x,st \oplus 1),(x,st \oplus 1) \leadsto (x,st)$),那么必定存在确定剩下的点真假的合法方案。证明考虑按照 SCC topo 序继续往后取值,一组中真的标记为先被取到的即可,容易发现一定合法(若 $(x,st) < (x,st \oplus 1)$ 且两者的都为真,那么必定存在 $(y,st')$ 满足 $(y,st')$ 为真且 $(y,st') \leadsto (x,st \oplus 1)$,那么根据性质一有 $(x,st) \leadsto (y,st' \oplus 1)$,于是对于 SCC topo 序有 $(y,st' \oplus 1) \leq (x,st) < (x,st \oplus 1) \leq (y,st') < (y,st' \oplus 1)$ 导出矛盾!)。 5. 存在一种合法方案使得 $(x,st)$ 为真当且仅当存在至少一个无限制合法方案且 $(x,st) \not \leadsto (x,st \oplus 1)$。必要性显然,合法性考虑:对于 $x$ 所处的弱联通块,先将 $x$ 可达的所有点置为真,然后按照 SCC topo 序确定每组点。如果这样不合法说明存在 $(x,st) \leadsto (z,st')$ 且 $(z,st') \leadsto (z,st' \oplus 1)$,根据性质二这与假设矛盾。 6. 存在一个合法方案使得 $\forall x \in S$ $(x,st_x)$ 为真当且仅当 $\forall x,y \in S$ $(x,st_x) \not \leadsto (y,st_y \oplus 1)$。证法和性质五类似。