05AB1E, 9 77 6 bytes
āœʒāα@Pœʒāα@P
Outputs all possible permutations of the 1-based indicesinput-list, and outputs all possible permutations. Outputting a random one would be 2 bytes longer by adding a trailing }Ω
.
Explanation:
ā œ # Push a list inof thepermutations rangeof [1,the first (implicit) first input-length]
œ # Pop and get all its permutations list
ʒ # Filter this list of permutations by:
ā # Push a list in the range [1,length] (without popping)
α # Get the absolute difference between the values at the same positions
@ # Check for each whether the second (implicit) input is >= the value
P # Product to check if all are truthy
# (after which the filtered list is output implicitly)