Hamilton cycle

这篇博客探讨了图论中的哈密顿回路问题及其在有向图上的变种,以及它们如何与3-SAT问题相互规约。通过构造方法展示了3-SAT实例可以转换为寻找有向哈密顿回路的问题,并证明了3-SAT的可满足性与存在哈密顿回路的等价性。此外,还提及了3-SAT到最长路径问题的转换,以及旅行商问题(TSP)的相关联性。
摘要由CSDN通过智能技术生成

1.1 Hamilton cycle

HAMILTON-CYCLE. Given an undirected graph G = (V, E), does there exist a
cycle Γ that visits every node exactly once?

一个有解的图,一个没有解的图如下:

2.1 Directed Hamilton cycle reduces to Hamilton cycle

DIRECTED-HAMILTON-CYCLE. Given a directed graph G = (V, E), does there exist
a directed cycle Γ that visits every node exactly once?

关于有向哈密尔顿圈问题可以规约到哈密尔顿问题证明如下(DIRECTED-HAMILTON-CYCLE ≤ P HAMILTON-CYCLE.):

Pf. Given a directed graph G = (V, E), construct a graph Gʹ with 3n nodes.

Lemma. G has a directed Hamilton cycle iff Gʹ has a Hamilton cycle.

2.1.1 证明

Pf. ⇒

  • Suppose G has a directed Hamilton cycle Γ.
  • Then Gʹ has an undirected Hamilton cycle (same order).

Pf. ⇐

  • Suppose Gʹ has an undirected Hamilton cycle Γʹ.
  • Γʹ must visit nodes in Gʹ using one of following two orders:
    …, black, white, blue, black, white, blue, black, white, blue, …
    …, black, blue, white, black, blue, white, black, blue, white, …
  • Black nodes in Γʹ comprise either a directed Hamilton cycle Γ in G,
    or reverse of one.

3.1 3-satisfiability reduces to directed Hamilton cycle

Construction. Given 3-SAT instance Φ with n variables xi and k clauses.

  • Construct G to have 2^n Hamilton cycles.
  • Intuition: traverse path i from left to right ⇔ set variable xi = true.

一个3元可满足性问题包含n个变量以及k个子模块,我们构造出一个2^n结点个数的图G。存在任意一个从左到右的路径<->xi=true. 右到左<->xi=false.

A problem:

3.1.1 3-satisfiability reduces to directed Hamilton cycle

Construction. Given 3-SAT instance Φ with n variables xi and k clauses.

  • For each clause: add a node and 2 edges per literal.

首先我们的构造方法是这样的:给你一个文法式n个变量k个子模块。对于每一个子模块添加一个结点两条边。
可以看到图中的子模块Cj和Ck分别表示的是: 如果xi是从右到左流入Ck的那么Ck中表示的则是xi“非”同理可得Cj中为xi。

一个完整的实例图如下:

3.1.2 烦人的证明又来了!

Lemma. Φ is satisfiable iff G has a Hamilton cycle

Pf. ⇒

  • Suppose 3-SAT instance Φ has satisfying assignment x*.
  • Then, define Hamilton cycle Γ in G as follows:
  • if x*i= true, traverse row i from left to right
  • if x*i= false, traverse row i from right to left
  • for each clause Cj , there will be at least one row i in which we are
    going in “correct” direction to splice clause node Cj into cycle
    (and we splice in Cj exactly once)

这种充分性其实不可靠的因为我可以将X1,x2,x3全部设置为true,那么显然哈密尔顿圈不满足。。。X1就重复了两次。

Pf. ⇐

  • Suppose G has a Hamilton cycle Γ.
  • If Γ enters clause node Cj , it must depart on mate edge.
  • nodes immediately before and after Cj are connected by an edge e ∈ E
  • removing Cj from cycle, and replacing it with edge e yields Hamilton
    cycle on G – { Cj }
  • Continuing in this way, we are left with a Hamilton cycle Γʹ in
    G – { C1 , C2 , …, Ck }.
  • Set x*i= true if Γʹ traverses row i left-to-right; otherwise,
  • set x*i= false. traversed in “correct” direction, and each clause is satisfied.

4.1 3-satisfiability reduces to longest path

Pf 1. Redo proof for DIR-HAM-CYCLE, ignoring back-edge from t to s.
Pf 2. Show HAM-CYCLE ≤ P LONGEST-PATH

5.1 TSP

TSP. Given a set of n cities and a pairwise distance function d(u, v),
is there a tour of length ≤ D ?

5.1.1 HAM-CYCLE ≤ P TSP

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值