COMP 250 Winter 2010
27  graphs 1: definitions
March 19, 2010
Graphs
You are familiar with data structures such as arrays and lists (linear), and trees (nonlinear). We
next consider a more general nonlinear data structure, known as graphs. Like the previous data
structures, a graph is a set of nodes
V
, each node having references to other nodes. In the case of
graphs, a reference from one node to another is called an edge. The set of edges is denoted
E
, and
so the graph may be written as a pair
G
= (
V,E
). In a (rooted) tree, we saw that the references
were either to a child or parent node. In a general graph, there is no notion of child and parent.
Every node can potentially reference every other node.
Examples of graphs include transportation networks.
For example,
V V
might be a set of
airports and
E
might be direct flights between airports. In computer system,
V
might be a set of
computers and
E
might be a direct communication link between them.
Or
V
might be a set of
html documents on a web site and
E
might be defined by URLs (links) between documents.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '08
 BLANCHETTE
 Computer Science, Graph Theory, Data Structures, adjacency matrix, adjacency lists

Click to edit the document details