Generates a random state reachable from 1:n by applying random
operations (L, R, X). Guarantees the result is in the same
connected component as the starting state.
Usage
generate_state(n, k = n, n_moves = 25L, moves = c("1", "2", "3"))
Value
Integer vector representing a reachable permutation state
Arguments
n
Integer, the size of the permutation
k
Integer, parameter for reverse_prefix operation
n_moves
Integer, number of random operations to apply (default 25)
moves
Character vector, allowed operations (default c("1", "2", "3"))