--- created_at: '2018-02-14T17:04:10.000Z' title: The Algorithm Design Manual (2008) url: http://www.algorist.com/ author: Chris2048 points: 182 story_text: comment_text: num_comments: 34 story_id: story_title: story_url: parent_id: created_at_i: 1518627850 _tags: - story - author_Chris2048 - story_16377259 objectID: '16377259' year: 2008 --- [Source](http://www.algorist.com/ "Permalink to The Algorithm Design Manual ") # The Algorithm Design Manual ![book cover][1] ![skiena][2] # The Algorithm Design Manual, 2nd Edition ## Steven Skiena | ----- | | [Teaching Resources][3] | [Algorithm Repository][4] | [Consulting Services ][5] | * [By Language][6] * [C][7] * [C++][8] * [C#][9] * [Java][10] * [FORTRAN][11] * [Python][12] * [Mathematica][13] * [Pascal][14] * [ADA][15] * [Lisp][16] * [Binary][17] * [By Problem][6] * [1.1 Data Structures][18] * [Dictionaries][19] * [Priority Queues][20] * [Suffix Trees and Arrays][21] * [Graph Data Structures][22] * [Set Data Structures][23] * [Kd-Trees][24] * [1.2 Numerical Problems][25] * [Solving Linear Equations][26] * [Bandwidth Reduction][27] * [Matrix Multiplication][28] * [Determinants and Permanents][29] * [Constrained and Unconstrained Optimization][30] * [Linear Programming][31] * [Random Number Generation][32] * [Factoring and Primality Testing][33] * [Arbitrary Precision Arithmetic][34] * [Knapsack Problem][35] * [Discrete Fourier Transform][36] * [1.3 Combinatorial Problems][37] * [Sorting][38] * [Searching][39] * [Median and Selection][40] * [Generating Permutations][41] * [Generating Subsets][42] * [Generating Partitions][43] * [Generating Graphs][44] * [Calendrical Calculations][45] * [Job Scheduling][46] * [Satisfiability][47] * [1.4 Graph Problems -- polynomial-time problems][48] * [Connected Components][49] * [Topological Sorting][50] * [Minimum Spanning Tree][51] * [Shortest Path][52] * [Transitive Closure and Reduction][53] * [Matching][54] * [Eulerian Cycle / Chinese Postman][55] * [Edge and Vertex Connectivity][56] * [Network Flow][57] * [Drawing Graphs Nicely][58] * [Drawing Trees][59] * [Planarity Detection and Embedding][60] * [1.5 Graph Problems -- hard problems][61] * [Clique][62] * [Independent Set][63] * [Vertex Cover][64] * [Traveling Salesman Problem][65] * [Hamiltonian Cycle][66] * [Graph Partition][67] * [Vertex Coloring][68] * [Edge Coloring][69] * [Graph Isomorphism][70] * [Steiner Tree][71] * [Feedback Edge/Vertex Set][72] * [1.6 Computational Geometry][73] * [Robust Geometric Primitives][74] * [Convex Hull][75] * [Triangulation][76] * [Voronoi Diagrams][77] * [Nearest Neighbor Search][78] * [Range Search][79] * [Point Location][80] * [Intersection Detection][81] * [Bin Packing][82] * [Medial-Axis Transformation][83] * [Polygon Partitioning][84] * [Simplifying Polygons][85] * [Shape Similarity][86] * [Motion Planning][87] * [Maintaining Line Arrangements][88] * [Minkowski Sum][89] * [1.7 Set and String Problems][90] * [Set Cover][91] * [Set Packing][92] * [String Matching][93] * [Approximate String Matching][94] * [Text Compression][95] * [Cryptography][96] * [Finite State Machine Minimization][97] * [Longest Common Substring][98] * [Shortest Common Superstring][99] * [Algorithm Links][6] * [Algorithm Lectures][100] * [Algorithm Design Manual Information][101] * [CSE 373 Course page][102] * [NIST Dictory of Algorithms and Data Structures][103] * [World of Mathematics][104] * [Programming Challenges][105] * [Audio Algorithm Lectures][106] * [Graduate Study Opportuinties][107] * * * ## Second Edition now available! | ----- | | [Errata][108] | | [Programs][109] | | [Credits][110] | | [ Solution Key/Wiki][111] | This newly expanded and updated second edition continues to take the "mystery" out of designing algorithms, and analyzing their efficacy and efficiency. Expanding on the first edition, the book now serves as the primary textbook of choice for algorithm design courses while maintaining its status as the premier practical reference guide to algorithms for programmers, researchers, and students. The reader-friendly Algorithm Design Manual provides straightforward access to combinatorial algorithms technology, stressing design over analysis. The first part, Techniques, provides accessible instruction on methods for designing and analyzing computer algorithms. The second part, Resources, is intended for browsing and reference, and comprises the catalog of algorithmic resources, implementations and an extensive bibliography. [Buy the book directly from Springer to ensure integrity.][112] * * * ## Learn/Teach Algorithms the Skiena Way! | ----- | | [Audio/ Video Lectures][100] | | [Author's Course Page][102] | | [Lecture Notes][113] | The second edition contains enough material to serve as the textbook for a standard _Introduction to Algorithms_ course. I assume the reader has completed the equivalent of a second programming course, typically titled _Data Structures_ or _Computer Science II_. The book, and associated supporting material, stresses design over analysis. A full set of [lecture slides][113] integrated with [audio and video lectures][113] are freely available on line. Let me help teach your course! I received the 2001 [IEEE Computer Science and Engineering Teaching Award][114] and have been been teaching undergraduate algorithm classes for almost twenty years. I have made several pedagogical improvements throughout the book. Textbook-oriented features include: * _More Leisurely Discussion_ \-- The tutorial material in the first part of the book has been _doubled_ over the previous edition. The pages have been devoted to more thorough and careful exposition of fundamental material, instead of adding more specialized topics. * _False Starts_ \-- Algorithms textbooks generally present important algorithms as a fait accompli, obscuring the ideas involved in designing them and the subtle reasons why other approaches fail. The war stories illustrate such development on certain applied problems, but I have expanded such coverage into classical algorithm design material as well. * _Stop and Think_ \-- Here I illustrate my thought process as I solve a topic-specific homework problem---false starts and all. I have interspersed such problem blocks throughout the text to increase the problem-solving activity of my readers. Answers appear immediately following each problem. * _More and Improved Homework Problems_ \-- This edition of _The Algorithm Design Manual_ has twice as many homework exercises as the previous one. Exercises that proved confusing or ambiguous have been improved or replaced. Degree of difficulty ratings (from 1 to 10) have been assigned to all problems. * _Self-Motivating Exam Design_ \-- In my algorithms courses, I promise the students that _all_ midterm and final exam questions will be taken directly from homework problems in this book. This provides a ``student-motivated exam,'' so students know exactly how to study to do well on the exam. I have carefully picked the quantity, variety, and difficulty of homework exercises to make this work; ensuring there are neither too few or too many candidate problems. * _Take-Home Lessons_ \-- Highlighted ``take-home'' lesson boxes scattered throughout the text emphasize the big-picture concepts to be gained from the chapter. * _Links to Programming Challenge Problems_ \-- Each chapter's exercises will contain links to 3-5 relevant ``Programming Challenge'' problems from _http://www.programming-challenges.com_. These can be used to add a programming component to paper-and-pencil algorithms courses. * _More Code, Less Pseudo-code_ \-- More algorithms in this book appear as code (written in C) instead of pseudo-code. I believe the concreteness and reliability of actual tested implementations provides a big win over less formal presentations for simple algorithms. Full implementations are available for study at courseweb. * * * ![first edition][115] | ----- | | [First Edition Errata][116] | ## First Edition I was gratified by the warm reception the first edition of _The Algorithm Design Manual_ received since its publication. It ultimately went through ten printings and generated numerous [errata][116], which remain available here. The first edition came with a CD-ROM, with mirrors of [the algorithm repository][4] and my [audio/video lecture notes][100]. Updated and improved versions of these resources are available on line, rendering the CD-ROM unnecessary (although I fondly recall the fellow who asked me for an extra copy so their child could have one when they grew up). This CD-ROM was also the source of the pirated online version from [Indonesia][117]. The [Amazon Kindle edition][118] is better. Reviews of _The Algorithm Design Manual_ include: * From [Steve Yegge -- Get that Job at Google"][119]: `` My absolute favorite for this kind of interview preparation is Steven Skiena's The Algorithm Design Manual. More than any other book it helped me understand just how astonishingly commonplace (and important) graph problems are ? they should be part of every working programmer's toolkit. The book also covers basic data structures and sorting algorithms, which is a nice bonus. But the gold mine is the second half of the book, which is a sort of encyclopedia of 1-pagers on zillions of useful problems and various ways to solve them, without too much detail. Almost every 1-pager has a simple picture, making it easy to remember. This is a great way to learn how to identify hundreds of problem types.'' * From [Programming Stuff][120]: ``The book teaches you how to extract the relevant information from a problem, how to transform a given problem into a well-researched problem, how to select the best data structure for the job and how to really improve algorithms. .. That's what makes the book so different and yet so valuable.'' * * * ## From the Publisher Written by a well-known algorithms researcher who received the IEEE Computer Science and Engineering Teaching Award, this new edition of _**The Algorithm Design Manual**_ is an essential learning tool for students needing a solid grounding in algorithms, as well as a special text/reference for professionals who need an authoritative and insightful guide. ### Quotes "...the book is an algorithm-implementation treasure trove, and putting all of these implementations in one place was no small feat. The list of implementations [and] extensive bibliography make the book an invaluable resource for everyone interested in the subject." **\--ACM Computing Reviews** "It has all the right ingredients: rich contents, friendly, personal language, subtle humor, the right references, and a plethora of pointers to resources." ** \-- P. Takis Metaxas, Wellesley College** "This is the most approachable book on algorithms I have." **\-- Megan Squire, Elon University, USA** [1]: http://www.algorist.com/cover.jpg [2]: http://www.algorist.com/skiena.jpg [3]: http://www.algorist.com#teaching [4]: http://www.cs.sunysb.edu/~algorith [5]: http://www.algorist.com/consulting [6]: http://www.algorist.com# [7]: http://www.cs.sunysb.edu/~algorith/implement/C.shtml [8]: http://www.cs.sunysb.edu/~algorith/implement/C++.shtml [9]: http://www.cs.sunysb.edu/~algorith/implement/Csharp.shtml [10]: http://www.cs.sunysb.edu/~algorith/implement/Java.shtml [11]: http://www.cs.sunysb.edu/~algorith/implement/FORTRAN.shtml [12]: http://www.cs.sunysb.edu/~algorith/implement/Python.shtml [13]: http://www.cs.sunysb.edu/~algorith/implement/Mathematica.shtml [14]: http://www.cs.sunysb.edu/~algorith/implement/Pascal.shtml [15]: http://www.cs.sunysb.edu/~algorith/implement/ADA.shtml [16]: http://www.cs.sunysb.edu/~algorith/implement/Lisp.shtml [17]: http://www.cs.sunysb.edu/~algorith/implement/Binary.shtml [18]: http://www.cs.sunysb.edu/~algorith/major_section/1.1.shtml [19]: http://www.cs.sunysb.edu/~algorith/files/dictionaries.shtml [20]: http://www.cs.sunysb.edu/~algorith/files/priority-queues.shtml [21]: http://www.cs.sunysb.edu/~algorith/files/suffix-trees.shtml [22]: http://www.cs.sunysb.edu/~algorith/files/graph-data-structures.shtml [23]: http://www.cs.sunysb.edu/~algorith/files/set-data-structures.shtml [24]: http://www.cs.sunysb.edu/~algorith/files/kd-trees.shtml [25]: http://www.cs.sunysb.edu/~algorith/major_section/1.2.shtml [26]: http://www.cs.sunysb.edu/~algorith/files/linear-equations.shtml [27]: http://www.cs.sunysb.edu/~algorith/files/bandwidth.shtml [28]: http://www.cs.sunysb.edu/~algorith/files/matrix-multiplication.shtml [29]: http://www.cs.sunysb.edu/~algorith/files/determinants.shtml [30]: http://www.cs.sunysb.edu/~algorith/files/unconstrained-optimization.shtml [31]: http://www.cs.sunysb.edu/~algorith/files/linear-programming.shtml [32]: http://www.cs.sunysb.edu/~algorith/files/random-numbers.shtml [33]: http://www.cs.sunysb.edu/~algorith/files/factoring-integers.shtml [34]: http://www.cs.sunysb.edu/~algorith/files/high-precision-arithmetic.shtml [35]: http://www.cs.sunysb.edu/~algorith/files/knapsack.shtml [36]: http://www.cs.sunysb.edu/~algorith/files/fourier-transform.shtml [37]: http://www.cs.sunysb.edu/~algorith/major_section/1.3.shtml [38]: http://www.cs.sunysb.edu/~algorith/files/sorting.shtml [39]: http://www.cs.sunysb.edu/~algorith/files/searching.shtml [40]: http://www.cs.sunysb.edu/~algorith/files/median.shtml [41]: http://www.cs.sunysb.edu/~algorith/files/generating-permutations.shtml [42]: http://www.cs.sunysb.edu/~algorith/files/generating-subsets.shtml [43]: http://www.cs.sunysb.edu/~algorith/files/generating-partitions.shtml [44]: http://www.cs.sunysb.edu/~algorith/files/generating-graphs.shtml [45]: http://www.cs.sunysb.edu/~algorith/files/calendar-calculations.shtml [46]: http://www.cs.sunysb.edu/~algorith/files/scheduling.shtml [47]: http://www.cs.sunysb.edu/~algorith/files/satisfiability.shtml [48]: http://www.cs.sunysb.edu/~algorith/major_section/1.4.shtml [49]: http://www.cs.sunysb.edu/~algorith/files/dfs-bfs.shtml [50]: http://www.cs.sunysb.edu/~algorith/files/topological-sorting.shtml [51]: http://www.cs.sunysb.edu/~algorith/files/minimum-spanning-tree.shtml [52]: http://www.cs.sunysb.edu/~algorith/files/shortest-path.shtml [53]: http://www.cs.sunysb.edu/~algorith/files/transitive-closure.shtml [54]: http://www.cs.sunysb.edu/~algorith/files/matching.shtml [55]: http://www.cs.sunysb.edu/~algorith/files/eulerian-cycle.shtml [56]: http://www.cs.sunysb.edu/~algorith/files/edge-vertex-connectivity.shtml [57]: http://www.cs.sunysb.edu/~algorith/files/network-flow.shtml [58]: http://www.cs.sunysb.edu/~algorith/files/drawing-graphs.shtml [59]: http://www.cs.sunysb.edu/~algorith/files/drawing-trees.shtml [60]: http://www.cs.sunysb.edu/~algorith/files/planar-drawing.shtml [61]: http://www.cs.sunysb.edu/~algorith/major_section/1.5.shtml [62]: http://www.cs.sunysb.edu/~algorith/files/clique.shtml [63]: http://www.cs.sunysb.edu/~algorith/files/independent-set.shtml [64]: http://www.cs.sunysb.edu/~algorith/files/vertex-cover.shtml [65]: http://www.cs.sunysb.edu/~algorith/files/traveling-salesman.shtml [66]: http://www.cs.sunysb.edu/~algorith/files/hamiltonian-cycle.shtml [67]: http://www.cs.sunysb.edu/~algorith/files/graph-partition.shtml [68]: http://www.cs.sunysb.edu/~algorith/files/vertex-coloring.shtml [69]: http://www.cs.sunysb.edu/~algorith/files/edge-coloring.shtml [70]: http://www.cs.sunysb.edu/~algorith/files/graph-isomorphism.shtml [71]: http://www.cs.sunysb.edu/~algorith/files/steiner-tree.shtml [72]: http://www.cs.sunysb.edu/~algorith/files/feedback-set.shtml [73]: http://www.cs.sunysb.edu/~algorith/major_section/1.6.shtml [74]: http://www.cs.sunysb.edu/~algorith/files/geometric-primitives.shtml [75]: http://www.cs.sunysb.edu/~algorith/files/convex-hull.shtml [76]: http://www.cs.sunysb.edu/~algorith/files/triangulations.shtml [77]: http://www.cs.sunysb.edu/~algorith/files/voronoi-diagrams.shtml [78]: http://www.cs.sunysb.edu/~algorith/files/nearest-neighbor.shtml [79]: http://www.cs.sunysb.edu/~algorith/files/range-search.shtml [80]: http://www.cs.sunysb.edu/~algorith/files/point-location.shtml [81]: http://www.cs.sunysb.edu/~algorith/files/intersection-detection.shtml [82]: http://www.cs.sunysb.edu/~algorith/files/bin-packing.shtml [83]: http://www.cs.sunysb.edu/~algorith/files/thinning.shtml [84]: http://www.cs.sunysb.edu/~algorith/files/polygon-partitioning.shtml [85]: http://www.cs.sunysb.edu/~algorith/files/simplifying-polygons.shtml [86]: http://www.cs.sunysb.edu/~algorith/files/shape-similarity.shtml [87]: http://www.cs.sunysb.edu/~algorith/files/motion-planning.shtml [88]: http://www.cs.sunysb.edu/~algorith/files/maintaining-arrangements.shtml [89]: http://www.cs.sunysb.edu/~algorith/files/minkowski-sum.shtml [90]: http://www.cs.sunysb.edu/~algorith/major_section/1.7.shtml [91]: http://www.cs.sunysb.edu/~algorith/files/set-cover.shtml [92]: http://www.cs.sunysb.edu/~algorith/files/set-packing.shtml [93]: http://www.cs.sunysb.edu/~algorith/files/string-matching.shtml [94]: http://www.cs.sunysb.edu/~algorith/files/approximate-pattern-matching.shtml [95]: http://www.cs.sunysb.edu/~algorith/files/text-compression.shtml [96]: http://www.cs.sunysb.edu/~algorith/files/cryptography.shtml [97]: http://www.cs.sunysb.edu/~algorith/files/finite-state-minimization.shtml [98]: http://www.cs.sunysb.edu/~algorith/files/longest-common-substring.shtml [99]: http://www.cs.sunysb.edu/~algorith/files/shortest-common-superstring.shtml [100]: http://www.cs.sunysb.edu/~algorith/video-lectures [101]: http://www.cs.sunysb.edu/~algorith/book/ [102]: http://www.cs.sunysb.edu/~skiena/373/ [103]: http://www.nist.gov/dads/ [104]: http://www.mathworld.wolfram.com/ [105]: http://www.programming-challenges.com/ [106]: http://www.cs.sunysb.edu/~algorith/lectures-good/index.html [107]: http://www.cs.sunysb.edu/~skiena/recruit.html [108]: http://www.cs.sunysb.edu/~skiena/algorist/book/errata [109]: http://www.cs.sunysb.edu/~skiena/algorist/book/programs/ [110]: http://www.cs.sunysb.edu/~skiena/algorist/book/credits.html [111]: http://www.algorist.com/algowiki/index.php/The_Algorithms_Design_Manual_(Second_Edition) [112]: http://www.anrdoezrs.net/links/8419556/type/dlg/https://www.springer.com/us/book/9781848000698?wt_mc=PPC.Google%20AdWords.3.EPR436.GoogleShopping_Product_US&gclid=Cj0KCQjwgIPOBRDnARIsAHA1X3TSCVUA8SxT29dbBS__r6m2Vqhl9G_25dVWQwJhg0X9Z30-dEZLCWUaAgpIEALw_wcB [113]: http://www.cs.sunysb.edu/~algorith/video-lectures/ [114]: http://awards.computer.org/ana/award/viewPastRecipients.action;jsessionid=F53F830C57AC18E9525AD71F541C8E75?id=32 [115]: http://www.algorist.com/cover-old.gif [116]: http://www.algorist.com/errata-old [117]: http://www2.toki.or.id/book/AlgDesignManual/ [118]: http://www.amazon.com/Algorithm-Design-Manual-Steven-Skiena-ebook/dp/B00B8139Z8 [119]: http://steve-yegge.blogspot.com/2008/03/get-that-job-at-google.html [120]: http://www.the-interweb.com/serendipity/index.php?/archives/85-Book-review-The-Algorithm-Design-Manual.html