O'Reilly logo

Mastering Algorithms with Perl by John Macdonald, Jon Orwant, Jarkko Hietaniemi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. Graphs

I wonder what happens if I connect this to this?

the last words of too many people

Graphs are fundamental to computer science: they define relationships between items of data—in particular, membership (certain things belong together) and causalities (certain things depend on other things). Graphs were thought up long before computers were anything more than sand on the beach,[42] and when mathematics started to sprout branches that later became computer science, graphs were there. Great age does not imply stagnation: graph theory is still a very vigorous area and many unsolved problems await their conquerors.

Here is a sample of what you can do with graphs:

  • Want to schedule many interdependent tasks? See Section 8.5.2.

  • Want to plan a route that takes you through all the interesting places without using the same road twice? (Section 8.6.1)

  • Want to find the cheapest flight from Helsinki to Auckland? Or the fastest? (Section 8.8.6.1) Or the one with fewest transfers? (Section 8.5.3)

  • Want to plan your network so that there are as few points of failure as possible? (Section 8.8.2)

  • Want to find the shortest distances between all your favorite haunts? (Section 8.8.6.2)

  • Want to maximize the throughput of your network? (Section 8.8.8)

Perhaps because of their centuries of practice, graph theorists have defined a lot of terminology. (For example, graphs are also called networks.) Another reason for the dizzying amount of jargon might be the unavoidable gap between what ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required