The word "levencycle" is inspired by cyclic levenquine challenge.
Definitions
A 1-dup permutation of order \$n\$ is some permutation of \$1, \cdots, n\$ plus one duplicate number in the range.
For example, 1-dup permutations of order 3 include 1, 3, 2, 2
and 3, 2, 1, 3
. There are 36 distinct 1-dup permutations of order 3, and \$\frac{(n+1)!\cdot n}{2}\$ of those of order \$n\$ in general.
A Hamiltonian levencycle combines the concept of Hamiltonian cycle (a cycle going through all vertices in a given graph) and Levenstein distance (minimal edit distance between two strings). Informally, it is a cycle going through all possible sequences by changing only one number at once.
For example, the following is a Hamiltonian levencycle of order 2: (the connection from the last to the start is implied)
(1, 1, 2) -> (1, 2, 2) -> (1, 2, 1) -> (2, 2, 1) -> (2, 1, 1) -> (2, 1, 2)
For order 3, found by automated search using Z3:
(1, 1, 2, 3) -> (1, 2, 2, 3) -> (1, 2, 1, 3) -> (1, 2, 3, 3) ->
(1, 2, 3, 2) -> (1, 3, 3, 2) -> (1, 1, 3, 2) -> (3, 1, 3, 2) ->
(3, 1, 2, 2) -> (3, 1, 2, 1) -> (3, 1, 2, 3) -> (2, 1, 2, 3) ->
(2, 1, 1, 3) -> (2, 1, 3, 3) -> (2, 1, 3, 2) -> (2, 1, 3, 1) ->
(2, 2, 3, 1) -> (1, 2, 3, 1) -> (3, 2, 3, 1) -> (3, 2, 1, 1) ->
(3, 2, 2, 1) -> (3, 3, 2, 1) -> (1, 3, 2, 1) -> (2, 3, 2, 1) ->
(2, 3, 3, 1) -> (2, 3, 1, 1) -> (2, 3, 1, 2) -> (2, 3, 1, 3) ->
(2, 2, 1, 3) -> (3, 2, 1, 3) -> (3, 2, 1, 2) -> (3, 1, 1, 2) ->
(3, 3, 1, 2) -> (1, 3, 1, 2) -> (1, 3, 2, 2) -> (1, 3, 2, 3)
Challenge
Given an integer \$n \ge 2\$, output a Hamiltonian levencycle of 1-dup permutations of order \$n\$. The output format is flexible. Assume that such a cycle exists; for values of \$n\$ where it does not exist, the behavior is undefined (you may do whatever you want).
Standard code-golf rules apply. The shortest code in bytes wins.