Efficient coroutine generation of constrained Gray sequences
<|reference_start|>Efficient coroutine generation of constrained Gray sequences: We study an interesting family of cooperating coroutines, which is able to generate all patterns of bits that satisfy certain fairly general ordering constraints, changing only one bit at a time. (More precisely, the directed graph of constraints is required to be cycle-free when it is regarded as an undirected graph.) If the coroutines are implemented carefully, they yield an algorithm that needs only a bounded amount of computation per bit change, thereby solving an open problem in the field of combinatorial pattern generation.<|reference_end|>
@article{knuth2004efficient,
    title={Efficient coroutine generation of constrained Gray sequences},
    author={Donald E. Knuth, Frank Ruskey},
    journal={Lecture Notes in Computer Science 2635 (2004), 183--204},
    year={2004},
    number={Knuth migration 11/2004},
    archivePrefix={arXiv},
    eprint={cs/0404058},
    primaryClass={cs.DS}
}