这里的一个轻度有趣变型,其中的问题是容易的:不是接地组{ 1 ,2 ,3 ,... ,Ñ },允许的任意子集{ 1 ,2 ,4 ,8 ,... }。目标仍然是找到一个置换π,
以便A = { | π (2 k)− 2 k | :2 ķ∈ Ω }
,其中Ω{1,2,3,…,n}{1,2,4,8,…}πA={|π(2k)−2k|:2k∈Ω}Ω是地面。这里的主要优点在于,新的地面组力的每个元素甲
为2 ķ 1 - 2 ķ 2对于一些ķ 1,ķ 2,并且如果ķ 1 ≠ ķ 2,然后ķ 1和ķ 2通过该确定区别。因此,对于每个差异| 2 k 1 − 2 k 2 | 在A中,我们可以推断π (2 kA2k1−2k2k1,k2k1≠k2k1k2|2k1−2k2|A1)=2k2π(2k1)=2k2 or π(2k2)=2k1π(2k2)=2k1 (or
both).
Efficiently solving this simplified variation is then more or less routine.
Begin by constructing the undirected bipartite multigraph G=(L⊔R,E)G=(L⊔R,E) where LL and RR are distinct copies of the ground set,
and add edges (2k1,2k2)(2k1,2k2) and (2k2,2k1)(2k2,2k1) whenever
|2k1−2k2||2k1−2k2| appears in AA with k1≠k2k1≠k2.
I claim that the following are equivalent:
- There is a permutation ππ with differences AA
- Every vertex in GG has degree 0 or 2
I won't actually prove this because of time, but it's not too bad to work out
on one's own. That 1⟹2 is straightforward. That 2⟹1 is a
bit more arduous, but it's not too bad when you reason with the automorphism
of G which sends each vertex in L to its copy in R (and vice-versa).
The proof I have in mind directs the edges in G so that all edges in a cycle
go ``the same way around the cycle''
(each nonisolated vertex has in-degree = out-degree = 1),
and so that the preceding automorphism of G remains an automorphism of the
directed version.
π is then chosen according to the edges that go from L to R.
You can phrase the above algorithm as a perfect matching question, and I imagine there are other reductions to 2-SAT. I don't see how to extend these approaches to the original problem though.