I'm looking for a method that generates pairs of pseudorandom numbers with the following conditions:
- Every pair from $(1, 1)$ to $(n, m)$ is seen exactly once before repeating, for any choice of integers $n$ and $m$. It's fine if some pairs are more than $(n, m)$, as these can be skipped, but ideally not too many (so something like rounding $n$ and $m$ up to the next power of 2 is fine).
- The method can be seeded with different inputs to produce different orders.
- Small space complexity, ideally $O(1)$.
I'm using this to generate bipartite graphs with a given number of vertices on each side ($n$ and $m$) and a given number of edges (the first $k$ pairs generated).
I've looked at linear congruence generators and the PCRG method looks promising, but I'm not sure how either of these could be adapted for these requirements.
Does anyone know of a method that achieves this? Thanks!