Given a set $\{1,2,\ldots,n\}$, I would like to recursively generate all partition of size $r$ and $n-r$. For instance, we start with the partitions $$\{1,2,\ldots, r\} \quad \{r+1,\ldots, n\}$$ and then iteratively swap elements. We can write the solution in terms of all the collections of allowed swaps between the two sets. We do this by considering a swap operator $S_{ij}$, which swaps elements $i$, $j$ between these sets, for instance:
$$S_{1,r+1} \{\{1,2,\ldots, r\},\{r+1,\ldots, n\}\} = \{\{r+1,2,3,\ldots, r\},\{1, r+2,\ldots, n\}\}.$$
Then we can write the solution in terms of all $\binom{n}{r}$ strings of swap operators acting on the two sets.
I know that one way to do this is with Heap's algorithm, which would generate all the permutations, which we then just have to partition. However, this algorithm is inefficient for this problem since many permutations correspond to the same subsets. As such I am essentially looking for a simplification to Heap's algorithm for this specific case.
You need to generate all the $r$ sized subsets, of which there are $n \choose r$. ${n-1 \choose r-1}$ of them contain $1$ and ${n-1 \choose r}$ do not contain $1$, so call your subset generator program with those parameters, add $1$ to each set in the output of the first instance, and put them together.