12.07.2015 Views

A Practical Introduction to Data Structures and Algorithm Analysis

A Practical Introduction to Data Structures and Algorithm Analysis

A Practical Introduction to Data Structures and Algorithm Analysis

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

11GraphsGraphs provide the ultimate in data structure flexibility. Graphs can model bothreal-world systems <strong>and</strong> abstract problems, so they are used in hundreds of applications.Here is a small sampling of the range of problems that graphs are applied<strong>to</strong>.1. Modeling connectivity in computer <strong>and</strong> communications networks.2. Representing a map as a set of locations with distances between locations;used <strong>to</strong> compute shortest routes between locations.3. Modeling flow capacities in transportation networks.4. Finding a path from a starting condition <strong>to</strong> a goal condition; for example, inartificial intelligence problem solving.5. Modeling computer algorithms, showing transitions from one program state<strong>to</strong> another.6. Finding an acceptable order for finishing subtasks in a complex activity, suchas constructing large buildings.7. Modeling relationships such as family trees, business or military organizations,<strong>and</strong> scientific taxonomies.We begin in Section 11.1 with some basic graph terminology <strong>and</strong> then definetwo fundamental representations for graphs, the adjacency matrix <strong>and</strong> adjacencylist. Section 11.2 presents a graph ADT <strong>and</strong> simple implementations based on theadjacency matrix <strong>and</strong> adjacency list. Section 11.3 presents the two most commonlyused graph traversal algorithms, called depth-first <strong>and</strong> breadth-first search, withapplication <strong>to</strong> <strong>to</strong>pological sorting. Section 11.4 presents algorithms for solvingsome problems related <strong>to</strong> finding shortest routes in a graph. Finally, Section 11.5presents algorithms for finding the minimum-cost spanning tree, useful for determininglowest-cost connectivity in a network. Besides being useful <strong>and</strong> interestingin their own right, these algorithms illustrate the use of some data structures presentedin earlier chapters.389

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!