Chapter 9

Reconnecting the Dots

IN THIS CHAPTER

Bullet Working with graphs

Bullet Performing sorting tasks

Bullet Reducing the tree size

Bullet Locating the shortest route between two points

Global Positioning System (GPS) setups work because you can use algorithms to traverse the points on the map and the streets that connect them. In fact, by the time you finish this chapter, you understand the basis used to make a GPS navigator work (but not necessarily the mechanics of making it happen). Of course, the fundamental requirement for using a graph to create a GPS navigator is the capability to search for connections between points on the map, as discussed in the first section of the chapter.

To make sense of a graph, you need to sort the nodes, as described in the second section of the chapter, to create a specific organization. Without organization, making any sort of decision becomes impossible. An algorithm might end up going in circles or giving inconvenient output.

When you view a map, you don’t look at the information in the lower-right corner when you actually need to work with locations and roads in ...

Get Algorithms For Dummies, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.