For the past several years, mathematics majors in the computing track at the University of Pennsylvania have taken a course in continuous algorithms (numerical analysis) in the junior year, and in discrete algorithms in the senior year. This book has grown out of the senior course as I have been teaching it recently. It has also been tried out on a large class of computer science and mathematics majors, including seniors and graduate students, with good results.Selection by the instructor of topics of interest will be very important, because normally I’ve found that I can’t cover anywhere near all of this material in a semester. A reasonable choice for a first try might be to begin with Chapter 2 (recursive algorithms) which contains lots of moti- vation. Then, as new ideas are needed in Chapter 2, one might delve into the appropriate sections of Chapter 1 to get the concepts and techniques well in hand. After Chapter 2, Chapter 4, on number theory, discusses material that is extremely attractive, and surprisingly pure and applicable at the same time. Chapter 5 would be next, since the foundations would then all be in place. Finally, material from Chapter 3, which is rather inde- pendent of the rest of the book, but is strongly connected to combinatorial algorithms in general, might be studied as time permits.Throughout the book, there are opportunities to ask students to write programs and get them running. These are not mentioned explicitly, with a few exceptions, but will be obvious when encountered. Students should all have the experience of writing, debugging, and using a program that is nontrivially recursive, for example. The concept of recursion is subtle and powerful, and is helped a lot by hands-on practice. Any of the algorithms of Chapter 2 would be suitable for this purpose. The recursive graph algo- rithms are particularly recommended since they are usually quite foreign to students’ previous experience and therefore have great learning value. Front cover Algorithms and Complexity (Second Edition) Copyright Contents Preface Preface to the Second Edition 0. What this Book Is About 0.1 Background 0.2 Hard versus Easy Problems 0.3 A Preview 1. Mathematical Preliminaries 1.1 Orders of Magnitude 1.2 Positional Number Systems 1.3 Manipulations with Series 1.4 Recurrence Relations 1.5 Counting 1.6 Graphs 2. Recursive Algorithms 2.1 Introduction 2.2 Quicksort 2.3 Recursive Graph Algorithms 2.4 Fast Matrix Multiplication 2.5 The Discrete Fourier Transform 2.6 Applications of the FFT 2.7 A Review 2.8 Bibliography 3. The Network Flow Problem 3.1 Introduction 3.2 Algorithms for the Network Flow Problem 3.3 The Algorithm of Ford and Fulkerson 3.4 The Max-Flow Min-Cut Theorem 3.5 The Complexity of the Ford-Fulkerson Algorithm 3.6 Layered Networks 3.7 The MPM Algorithm 3.8 Applications of Network Flow 4. Algorithms in the Theory of Numbers 4.1 Preliminaries 4.2 The Greatest Common Divisor 4.3 The Extended Euclidean Algorithm 4.4 Primality Testing 4.5 Interlude: The Ring of Integers Modulo n 4.6 Pseudoprimality Tests 4.7 Proof of Goodness of the Strong Pseudoprimality Test 4.8 Factoring and Cryptography 4.9 Factoring Large Integers 4.10 Proving Primality 5. NP-Completeness 5.1 Introduction 5.2 Turing Machines 5.3 Cook’s Theorem 5.4 Some Other NP-Complete Problems 5.5 Half a Loaf 5.6 Backtracking (I): Independent Sets 5.7 Backtracking (II): Graph Coloring 5.8 Approximate Algorithms for Hard Problems Hints and Solutions for Selected Problems Index Back cover
This book is an introductory textbook on the design and analysis of algorithms. The author uses a careful selection of a few topics to illustrate the tools for algorithm analysis. Recursive algorithms are illustrated by Quicksort, FFT, fast matrix multiplications, and others. Algorithms associated with the network flow problem are fundamental in many areas of graph connectivity, matching theory, etc. Algorithms in number theory are discussed with some applications to public key encryption. This second edition will differ from the present edition mainly in that solutions to most of the exercises will be included.