This is Real Life Sale

Special Offers see all

Enter to WIN a $100 Credit

Subscribe to
for a chance to win.
Privacy Policy

Visit our stores

    Recently Viewed clear list

    Original Essays | February 16, 2015

    Mary Pilon: IMG The Coffee Shops I Have Loved

    "Should I kill myself, or have a cup of coffee?" – Albert Camus In the five years it took for me to complete my book, The Monopolists, I wrote... Continue »

Qualifying orders ship free.
New Trade Paper
Ships in 1 to 3 days
Add to Wishlist
available for shipping or prepaid pickup only
Available for In-store Pickup
in 7 to 12 days
Qty Store Section
1 Remote Warehouse Software Engineering- Algorithms

The Art of Computer Programming, Volume 4, Fascicle 4: Generating All Trees, History of Combinatorial Generation


The Art of Computer Programming, Volume 4, Fascicle 4: Generating All Trees, History of Combinatorial Generation Cover




I like to work in a variety of fields in order to spread my mistakes more thinly.

--Victor Klee (1999)

This booklet is Fascicle 4 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 and 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, permutations, combinations, and partitions appear in Sections and That sets the stage for the main contents of the present booklet, namely Section, which completes the study of basic patterns by discussing how to generate various kinds of tree structures; and Section, which completes the story of the preceding subsections by discussing the origins of the concepts and pointing to other sources of information. 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.

In fact, I've been looking forward to writing about the generation of trees for a long time, because tree structures have a special place in the hearts of all computer scientists. Although I certainly enjoyed preparing the material about classic combinatorial structures like tuples, permutations, combinations, and partitions in Sections, the truth is that I've saved the best for last: Now it's time for the dessert course. Ever since 1994 I've been giving an annual "Christmas tree lecture" at Stanford University, to talk about the most noteworthy facts about trees that I learned during the current year, and at last I am able to put the contents of those lectures into written form. This topic, like many desserts, is extremely rich, yet immensely satisfying. The theory of trees also ties together a lot of concepts from different aspects of computer programming.

And Section, about the history of combinatorial generation, was equally satisfying to the other half of my brain, because it involves poetry, music, religion, philosophy, logic, and intellectual pastimes from many different cultures in many different parts of the world. The roots of combinatorial thinking go very deep, and I can't help but think that I learned a lot about human beings in general as I was putting the pieces of this story together.

My original intention was to devote far less space to such subjects. But when I saw how fundamental the ideas were, 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 students and for telling me about his classroom experiences. Many other readers have also helped me to check the first drafts, especially in Section where I was often operating at or beyond the limits of my ability to understand languages other than English.

I shall happily pay a finder's fee of $2.56 for each error in this fascicle when it is first reported to me, whether that error be typographical, technical, or historical. The same reward holds for items that I forgot to put in the index. And valuable suggestions for improvements to the text are worth 32¢ each. (Furthermore, if you find a better solution to an exercise, I'll actually reward you with immortal glory instead of mere money, by publishing your name in the eventual book:-)

Cross references to yet-unwritten material sometimes appear as '00' in the following pages; this impossible value is a placeholder for the actual numbers to be supplied later.

Happy reading!

D. E. K.

Stanford, California

June 2005

Product Details

Knuth, Donald E.
Addison-Wesley Professional
Knuth, Donald Ervin
Upper Sadle River, N. J.
Programming - Algorithms
Computer algorithms
Computer programming
Software Engineering-Algorithms
Edition Number:
Volume 4
Edition Description:
Fascicle 4
Art of Computer Programming
Series Volume:
Publication Date:
February 2006
Grade Level:
Professional and scholarly
9.52x6.42x.32 in. .52 lbs.

Other books you might like

  1. The Art of Computer Programming,... New Trade Paper $24.75
  2. The Art of Computer Programming,... Used Trade Paper $19.00
  3. The Gospel of the Flying Spaghetti...
    Used Trade Paper $8.95
  4. Fight Club Politics: How... Used Hardcover $11.50

Related Subjects

Business » Banking
Computers and Internet » Software Engineering » Algorithms
Computers and Internet » Software Engineering » Programming and Languages
Health and Self-Help » Health and Medicine » Medical Specialties
History and Social Science » Politics » General
Humanities » Philosophy » General

The Art of Computer Programming, Volume 4, Fascicle 4: Generating All Trees, History of Combinatorial Generation New Trade Paper
0 stars - 0 reviews
$23.75 In Stock
Product details 128 pages Addison-Wesley Professional - English 9780321335708 Reviews:
"Synopsis" by ,

Finally, after a wait of more than thirty-five years, the first part of Volume 4 is at last ready for publication. Check out the boxed set that brings together Volumes 1 - 4A in one elegant case, and offers the purchaser a $50 discount off the price of buying the four volumes individually.


The Art of Computer Programming, Volumes 1-4A Boxed Set, 3/e

  • back to top


Powell's City of Books is an independent bookstore in Portland, Oregon, that fills a whole city block with more than a million new, used, and out of print books. Shop those shelves — plus literally millions more books, DVDs, and gifts — here at