Summary
This multivolume work on the analysis of algorithms has long been recognized as the definitive description of classical computer science. The three complete volumes published to date already comprise a unique and invaluable resource in programming theory and practice. Countless readers have spoken about the profound personal influence of Knuth's writings. Scientists have marveled at the beauty and elegance of his analysis, while practicing programmers have successfully applied his "cookbook" solutions to their day-to-day problems. All have admired Knuth for the breadth, clarity, accuracy, and good humor found in his books.To begin the fourth and later volumes of the set, and to update parts of the existing three, Knuth has created a series of small books called fascicles, which will be published t regular intervals. Each fascicle will encompass a section or more of wholly new or evised material. Ultimately, the content of these fascicles will be rolled up into the comprehensive, final versions of each volume, and the enormous undertaking that began in 1962 will be complete. Volume 4, Fascicle 2This fascicle inaugurates the eagerly awaited publication of Knuth's The Art of Computer Programming, Volume 4: Combinatorial Algorithms. Part of what will be a long chapter on combinatorial searching, the fascicle begins his treatment of how to generate all possibilities. Specifically, it discusses the generation of all n-tuples, then extends those ideas to all permutations. Such algorithms provide a natural motivation by means of which many of the key ideas of combinatorial mathematics can be introduced and explored. In this and other fascicles of Volume 4, Knuth illuminates important theories by discussing related games and puzzles. Even serious programming can be fun.
Author Biography
Donald E. Knuth is professor Emeritus of The Art of Computer Programming at Sanford University
Table of Contents
Combinatorial Searching | |
Generating All Possibilities | |
Generating Basic Combinatorial Patterns | |
Generating all n-tuples | |
Generating all permutations | |
Generating all combinations | p. 1 |
Generating all partitions | p. 36 |
Generating all set partitions | p. 61 |
Answers to Exercises | p. 87 |
Index and Glossary | p. 144 |
Table of Contents provided by Ingram. All Rights Reserved. |
Excerpts
In my preface to the first edition, I begged the reader not to draw attention to errors. I now wish I had not done so and am grateful to the few readers who ignored my request. --Stuart Sutherland, The International Dictionary of Psychology (1996) This booklet is Fascicle 3 of The Art of Computer Programming, Volume 4: Combinatorial Algorithms. As explained in the preface to Fascicle 1 of Volume 1, I'm circulating the material in this preliminary form because I know that the task of completing Volume 4 will take many years; I can't wait for people to begin reading what I've written so far and to provide valuable feedback. To put the material in context, this fascicle contains Sections 7.2.1.3, 7.2.1.4, and 7.2.1.5 of a long, long chapter on combinatorial searching. Chapter 7 will eventually fill three volumes (namely Volumes 4A, 4B, and 4C), assuming that I'm able to remain healthy. It will begin with a short review of graph theory, with emphasis on some highlights of significant graphs in The Stanford GraphBase, from which I will be drawing many examples. Then comes Section 7.1, which deals with bitwise manipulation and with algorithms relating to Boolean functions. Section 7.2 is about generating all possibilities, and it begins with Section 7.2.1: Generating Basic Combinatorial Patterns. Details about various useful ways to generate n-tuples appear in Section 7.2.1.1, and the generation of permutations is discussed in Section 7.2.1.2. That sets the stage for the main contents of the present booklet, namely Section 7.2.1.3 (which extends the ideas to combinations of n things taken t at a time); Section 7.2.1.4 (about partitions of an integer); and Section 7.2.1.5 (about partitions of a set). Then will come Section 7.2.1.6 (about trees) and Section 7.2.1.7 (about the history of combinatorial generation), in Fascicle 4. Section 7.2.2 will deal with backtracking in general. And so it will go on, if all goes well; an outline of the entire Chapter 7 as currently envisaged appears on the taocp webpage that is cited on page ii. I had great pleasure writing this material, akin to the thrill of excitement that I felt when writing Volume 2 many years ago. As in Volume 2, where I found to my delight that the basic principles of elementary probability theory and number theory arose naturally in the study of algorithms for random number generation and arithmetic, I learned while preparing Section 7.2.1 that the basic principles of elementary combinatorics arise naturally and in a highly motivated way when we study algorithms for combinatorial generation. Thus, I found once again that a beautiful story was "out there" waiting to be told. For example, in the present booklet we find many of the beautiful patterns formed by combinations, with and without repetition, and how they relate to famous theorems of extremal combinatorics. Then comes my chance to tell the extraordinary story of partitions; indeed, the theory of partitions is one of the nicest chapters in all of mathematics. And in Section 7.2.1.5, a little known triangle of numbers, discovered by C. S. Peirce, turns out to simplify and unify the study of set partitions, another vital topic. Along the way I've included expositions of two mathematical techniques of great importance in the analysis of algorithms: Poisson's summation formula, and the powerful saddle point method. There are games and puzzles too, as in the previous fascicles. My original intention was to devote far less space to these subjects. But when I saw how fundamental the ideas were for combinatorial studies in general, I knew that I could never be happy unless I covered the basics quite thoroughly. Therefore I've done my best to build a solid foundation of theoretical and practical ideas that will support many kinds of reliable superstructures. I thank Frank Ruskey for bravely foisting an early draft of this material on college s