Efficient Coroutine Generation of Constrained Gray Sequences
(originally entitled "Deconstructing Coroutines")
Donald E.
Knuth,
Department of Computer Science,
Stanford University, USA.
Frank Ruskey,
Department of Computer Science,
University of Victoria, Canada.
Abstract:
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
cyclefree 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.

The compressed postscript file is
106,077 bytes.

The postscript file is 312,586 bytes.

Appears in From ObjectOrientation to Formal Methods:
Dedicated to The Memory of OleJohan Dahl,
Lecture Notes in Computer Science 2635, SpringerVerlag, 2003, pp. 183208.

This paper is Chapter 25 (pages 245274)
in a volume of Don's collected papers entitled
Selected Papers on Computer Languages.
See
http://cslipublications.stanford.edu/site/1575863820.html
or
http://wwwcsfaculty.stanford.edu/~knuth/cl.html
for further information.

The Gray code in this paper was first presented at the S.E. Conference
on Combinatorics, Graph Theory, and Computing in 1995. Some slides
from that talk are reproduced here.

Don has given some talks on the topic (details from his homepage):

Thursday, December 6, 2001, 4:15pm in Gates room B01
A Computer Musing lecture entitled
``Totally Acyclic Digraphs (Spiders) and how to squish them''.

Tuesday 3 September 2002, 2:15pm in the Lille Auditorium at IFI
(Institutt for informatikk, University of Oslo)
a lecture entitled ``Deconstructing Coroutines''.

Tuesday 10 September 2002, Oxford University Com Lab, 4:30pm
a lecture entitled ``Deconstructing Coroutines''.

Papers that refer to this one:

Richard S. Bird,
Spider spinning for dummies,
Advanced Functional Programming,
Lecture Notes in Computer Science (LNCS), 2009, Volume 5832/2009,
3965, DOI: 10.1007/9783642046520_2

Emilio Di Giacomoa, Giuseppe Liottaa, Henk Meijerb, and Stephen K. Wismath,
Volume requirements of 3D upward drawings,
Discrete Mathematics, Volume 309, Issue 7, 8 April 2009, Pages 18241837.
Back to list of publications.