  Motivated by the rank modulation scheme, a recent work by Sala and Dolecek
explored the study of constraint codes for permutations. The constraint studied
by them is inherited by the inter-cell interference phenomenon in flash
memories, where high-level cells can inadvertently increase the level of
low-level cells.
  In this paper, the model studied by Sala and Dolecek is extended into two
constraints. A permutation $\sigma \in S_n$ satisfies the \emph{two-neighbor
$k$-constraint} if for all $2 \leq i \leq n-1$ either
$|\sigma(i-1)-\sigma(i)|\leq k$ or $|\sigma(i)-\sigma(i+1)|\leq k$, and it
satisfies the \emph{asymmetric two-neighbor $k$-constraint} if for all $2 \leq
i \leq n-1$, either $\sigma(i-1)-\sigma(i) < k$ or $\sigma(i+1)-\sigma(i) < k$.
We show that the capacity of the first constraint is $(1+\epsilon)/2$ in case
that $k=\Theta(n^{\epsilon})$ and the capacity of the second constraint is 1
regardless to the value of $k$. We also extend our results and study the
capacity of these two constraints combined with error-correction codes in the
Kendall's $\tau$ metric.
