# The Hitchhiker's Guide to Graphs

### Announcing my upcoming book on graph theory, algorithms, and applications.

Hey!

This post is to announce my upcoming book, “**The Hitchhiker's Guide to Graphs**”. It's about graph theory, algorithms, and applications.

Update:An early draft is already available. You can purchase lifetime access to this book, including the current and all future draft and production versions, in the following link.

## Another book on graphs?

I know, I know. Why, right?

For starters, graphs are very important in computer science, they are like the quintessential data structure, helping us understand things like maps, social networks, games, and more. Whatever you are doing in computer science, chances are you’ll find a graph pretty soon.

That’s all fine, but there are already lots of books about graphs, right? Like the ultra-famous “Introduction to Algorithms” by Thomas Cormen, probably the most read technical book in CS. So why write a new one?

Well, here’s the thing. In my teaching career, I've taught graphs in many subjects, from undergrad programming, discrete math, algorithm design, compilers, and AI to grad-level specialized courses on AutoML and metaheuristics. I've seen how students learn about and use graphs throughout the entire career. But knowledge about graphs is spread across so many books, and there are so many approaches to learning them: some resources focus on the math behind graph theory, while others teach you how to code algorithms, and yet others focus on the practical applications.

And so it happens that most educational materials on graphs I’ve used are either too theoretical, lacking real-life motivation to study them, or too practical, leaving aside all the beauty of really understanding why things work. I think there is a lack of a sweet middle ground. A small book that shows how useful graphs are in real life, and gives you some practical algorithms and applications, without sacrificing the beauty of graph theory for those interested in the underlying math.

### What is this book, then?

This book is my attempt to cover that middle ground. It is meant for students, teachers, professional computer scientists, and generally anyone who writes code in at least a semi-professional way. It will teach you the basics of graphs with a hands-on approach, and it will show you the underlying magic if you want to. Crucially, this book does not attempt to replace the many wonderful textbooks on graph theory or algorithms out there, but rather be a helpful complement.

The book will be divided into several parts dedicated to specific domain applications, such as maps, social networks, games, etc. Each chapter will take you through one concrete problem and show you how to solve it using graphs. We will start by understanding the problem and turning it into a graph problem. Then we will devise and code an algorithm to solve it. Finally, we will learn some of the relevant underlying theory to prove that the algorithm works.

This means you can read this book in many ways. You can read it from beginning to end or just pick the chapters that interest you most. You can focus just on the applications or you can delve into the underlying theory if you want to see some of the most beautiful proofs in math. The goal is to make learning about graphs easy and fun for everyone, regardless of your math level.

The book will also come with a public GitHub repository containing reference implementations for all the algorithms and some extra things you can use to solve real-life problems with graphs.

### How is this different to The Science of Computation?

I’m so glad you asked. My other book, The Science of Computation (TSOC), is a high-level exploration of the entire field of Computer Science. It requires no prior experience with either college-level math or any coding skills. There will be graphs in TSOC, but only at a very conceptual level.

In contrast, this book will focus solely on graphs, and will go much, much deeper. Plus, this book does require some basic coding abilities and some willingness to grapple with college-level math. Not too much, though, but definitely not zero. In summary, this book is meant for a more technical audience who wants to solve actual problems, while TSOC is more of a love letter to the field of Computer Science.

### How can I get it?

Just like all my other books, this is a long-term project. As usual, most of the book's content will appear in free articles on this blog first. Some articles will be in the Computer Science section, but most will appear as Coding Lessons. However, the book will put everything together in a more coherent structure, and will go deeper into some of the technical details.

And as always, premium subscribers to Mostly Harmless Ideas will get every single update as soon as its ready. At the moment, all I have is ideas, so there’s nothing concrete to share today, but I’ll be back soon with the first couple of chapters. At that moment, I will also bring some options for those wanting to support this book without getting a full subscription.

Until then, happy coding!

Oh sure, make the rest of us feel crappy about our lack of productivity as you write not one but two books in parallel. Class act, Alejandro!

Will there eventually be a physical copy available?