Hacker News new | comments | ask | show | jobs | submit login
The Algorithm Design Manual (2008) (algorist.com)
186 points by Chris2048 11 months ago | hide | past | web | favorite | 34 comments

> 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.

I really really like this idea. It is fairly common that I'm working on an algorithm and I have pieces of it and can see goal line, but can't quite figure out to get there.

Learning to see patterns and generalize solutions from past failures is incredibly useful.

One of my favorite technical books. The sections on dynamic programming and heuristics were a revelation for me working on some of my first non trivial algorithms.

Algorithms taught by Skiena was one of two CS courses I took at Stony Brook (the other was formal logic) as they were cross listed with MAT. It was an enjoyable class, i think Skiena has really nailed down how to teach CS. This book covers more than can be taught in a semester so it was a great way for me to get a wide breadth of basic algorithmic knowledge. I think its treatment of simulated annealing stuck with me most.

The Algorithm Design Manual is very 'fluffy'. I never understood why so many people like it.

If you enjoy hand-waving and hate rigour, it's a nice read. But if you don't like computer science in the first place, why don't you pick a good novel or a book about giraffes?

https://www.mccaughan.org.uk/g/books/alg-design.html puts a similar objection in a much more sympathetic tone that I can manage.

I am quite enjoying the lecture notes on http ://jeffe.cs.illinois.edu/teaching/algorithms/ recently, but there are for a more advanced course.

I love it since it has actual C code for implementing the ideas. You get the intuition for the algorithms, how that intuition translates into pseudocode, and how that pseudocode becomes real C code.

Another lesson that it uniquely provides is that in day to day life you don't use these algorithms. You create new algorithms using the ideas behind the famous ones as a guide. An algorithms book or class that doesn't teach you that problem-solving mindset is basically useless.

Yes, we mostly study the famous algorithms the same way mathematicians study the famous theorems: not because they want to reprove them again and again in daily life.

Exactly. I think the Algorithm Design Manual does more to directly train that kind of thinking than many books.

Now if you want theory, I continue to recommend Algorithm Design by Kleinberg and Tardos.

Mathematicians look for more elegant proofs of already proven theorems all the time. The earliest proof is usually not the simplest, nor the clearest, nor the easiest to generalize, nor <insert desideratum here>.

Similarly, I think there is scientific value in finding cleaner ways to implement known algorithms, prove their complexity bounds, etc. For example, one of my current projects is to provide total functional implementations of known data structures and algorithms (i.e., free of assertions and unreachable control flow points), and I have gained insight about these data structures and algorithms that I couldn't have possibly obtained from their published descriptions.

It really depends on what you're looking for. If you're trying to build a solid understanding of algorithmic patterns, the Algorithm Design Manual is a quite good choice, and not hand-wavy nor lacking in rigor in any meaningful way.

If you are trying to prove properties of particular algorithms or you already have a specific algorithm in mind that you're considering using and need to analyze its complexity, then this would not be the best choice.

You shouldn't dismiss/denigrate the book because it doesn't fit with your personal use case.

The whole 'lacking rigor' idea here is a common pitfall for programmers—seems predicated on the false idea that coding is this one dimensional activity with a hard side and a fluffy side, and the fluffy side is largely comprised of deceptions for the weak or timid. I bet there's a strong correlation between folks who prefer (e.g.) Cormen to Skiena and those who insist on using terminal windows and vi/emacs for every task—and yet the correlation you might hope to find with the quality/depth/interest of their work fails to hold.

I always feel kind of bad when I see programmers taking on this attitude (often times it manifests as they're trying to freak out more novice programmers and display their supposed superiority), and unnecessarily hampering themselves. It's one aspect of our culture I'd really like to see die out before it spreads to the next generation.

I love it for the wonderful, engaging "war stories" and practical approach. It's not as theoretical as CLRS but much more practical, approachable, and readable, making it likely a better choice for most programmers.

Yes, I guess The Algorithm Dealing Manual is more accessible like McDonald's is more accessible.

I just felt like having wasted my time after looking through it.

CLRS is pretty solid by comparison. (Even if not my favourite book.)

McDonalds is actively bad for anyone's health. A book being too basic for your big brain doesn't make it worthless for everyone else.

Not completely sure on this. My grandparents are into their 80s eating stuff like McDonalds, KFC, etc. reasonably often. Maybe McDonald's isn't good for you, but the bigger issue seems to be being fat

Depends on what you eat at McDonald's, and how much. In any case, I was merely comparing ease of access.

It's the only book where author actually tries to make you understand the topic rather than mastrubating on it's academic background and a bunch of pseudomath.

I think a lot of people (especially experienced ones) are too quick to dismiss how much human skill comes from subconscious habits and intuition. Since they aren't consciously struggling with it, it's not on their radar anymore.

That's part of why it's so jarring for an professional to start trying to be an educator for the first time.

I've actually taught programming / CS.

(And that taught me that SICP is not as awesome as I nostalgically remembered. My students still didn't like the algorithm design manual.)

You don't have to "hate rigor" in order to like non-technical treatments of a subject.

One reason I like the book is it gives a high-level overview of what algorithms are available to solve a problem, and a sense of which is most appropriate to my problem. If I need rigor after that, I can go to an appropriate source.

The majority of people reading algorithm books are looking to brush up for technical interviews or to supplement a bootcamp education, not because they are CS postgrads or genuinely love algorithms.

> I never understood why so many people like it.

It's a good reference for anyone who is researching how to approach a given problem. One can switch off to a different text later on if they need to, and one of the nice features of Skiena is that he provides links at times to source code and further reading.

Ideally you'd know all the basics and use something like Kao's Encyclopedia of Algorithms to lookup the rest, but that thing is big enough to beat a man to death with. Skiena is a lot more approachable.

I didn't go to university thus I do not have a CS degree. This book was incredibly helpful in teaching me the basics of algorithms. I found it approachable but technical enough.

I don't have a CS or any other degree either.

But I guess I'm just grumpy, because the book came with high praise.

To be more constructive:

Sedgewick's Algorithms is good for implementations in imperative languages. Okasaki's Purely Functional Data Structures is a nice introduction to some algorithms and data structures suitable in a purely functional setting. He also addresses laziness.

And finally for the theory, Schrijver's "Combinatorial Optimization: Polyhedra and Efficiency" tells you more about P and the boundary to NP than you ever wanted to know.

Those are just a few that I enjoyed, and I can't claim they are the best.

For example Structure and Interpretation of Computer Programs is definitely worth a read, but it won't help you with algorithms directly.

I once studied SICP out of curiosity during undergraduate days. It's an interesting introduction to functional programming using Scheme.

Of course, it don't focus on algorithms itself. You need to study other materials, provided in books already mentioned here :)

For all its quirks, Knuth is still best for a lot of the algorithmic analysis.

You'll have to go elsewhere for cutting edge in a lot of areas, but it's great to learn from.

I found Knuth's Art of Computer Programming a bit too dense for me, and I have a high tolerance. There's definitely a wide world inbetween the fluffy Skiena and the concrete Knuth.

(I did enjoy Concrete Mathematics.)

Knuth is a bit too imperative for my interests.

But if you like strong stuff, Schrijver's "Combinatorial Optimization: Polyhedra and Efficiency" tells you more about P and the boundary to NP than you ever wanted to know.

http://jeffe.cs.illinois.edu/teaching/algorithms/ is reasonably accessible so far for me, yet still manages to teach me new hard things.

None of the books mentioned are bleeding edge. It's easier to get that out of papers.

If you haven't tried the latest entries in Knuth's work, I'd recommend those. The preprints of the Dancing Links stuff is surprisingly approachable and a ton of fun.

I wanted to do the same, but I feel a little threatened by the DS clause (That I had to had a course on the topic) - Did you have previous knowledge or just went through?

I felt the exact same way.

Personally I've found the best thing is to see a lot of problems. The more problems you've solved, the more reference points you have for solving future ones.

But these have to be problems that you've personally solved.

That's why fluffy algorithm books are a waste of time. Books cannot do the thinking for you.

Do you have any other book that can be considered as an alternative with some rigor but still be approachable to a beginner?

I have stumbled upon Algorithms (by Sanjoy Dasgupta Algorithms (Author),‎ Christos H. Papadimitriou Algorithms (Author),‎ Umesh Vazirani). I find it, good for beginners, without being overwhelming. It goes like prose and not terse.

This is my favorite introductory book on algorithms. It's very well-written, concise, and develops important concepts through problems. It also strikes a nice balance in presenting real mathematical content without beating you over the head with formality.

This was my textbook for an Algorithms course in school. I recently had to crack it open again to brush up on algorithms before a tech interview; I think it helped.

2nd Edition was published 10 years ago.

10 years ago being 2008 - and the second edition also appears to be the most recent edition too; age of the edition though appears to have no impact on its value.

SOURCE: The Algorithm Design Manual 2nd ed. 2008 Edition https://www.amazon.com/Algorithm-Design-Manual-Steven-Skiena...

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact