This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Graphs Margaret M. Fleck 14 April 2010 This lecture introduces graphs (section 9.1. and 9.2 of Rosen). 1 Graphs Graphs are a very general class of object, used to represent a wide variety of relationships and complex objects in computer science. A simple example of a graph is the map of roads connecting cities shown below. In this example, each edge can be traversed in both directions. This is called an undirected graph. Chicago Springfield Bloomington Urbana Danville Decatur Sometimes transportation along certain routes is only one-way. For ex- ample, the examples below shows a possible (but non-existent) circular bus route serving three buildings on our campus. This is a directed graph. When a link works in both directions, you have to show this explicitly, as in the case of the busses to/from the Mall. 1 Mall Siebel Union FLB An undirected graph has 2-way edges, which can be traversed in both directions. For example, most streets or facebook friend relationships (which must be accepted by the other person). A directed graph has one-directional edges. For example, twitter following is a directed relationship. A celebrity may be followed by many people, few of whom the celebrity follows. Graphs can also represent more abstract relationships among objects. For example, web pages contain hyperlinks to other web pages. Each of these links has some anchor text, which labels the page at the other end of the link. Web search systems such as Google analyze the structure of these labelled links, as well as the text on each page, to determine which pages are the best ones to return for a given search keyword. These hyperlink relationships are typically not symmetrical: a link in one direction doesnt imply a link in the opposite direction. For example, my web page might point to Obamas web page, but the reverse link is unlikely....
View Full Document
- Spring '10
- Computer Science