Graphs
1
Graphs
ORD
DFW
SFO
LAX
80
2
1
7
4
3
1843
1233
Graphs
2
Outline and Reading
Graphs (§12.1)
±
Definition
±
Applications
±
Terminology
±
Properties
±
ADT
Data structures for graphs (§12.2)
±
Edge list structure
±
Adjacency list structure
±
Adjacency matrix structure
Graphs
3
Graph
A graph is a pair
(
V, E
)
, where
±
V
is a set of nodes, called
vertices
±
E
is a collection of pairs of vertices, called
edges
±
Vertices and edges are positions and store elements
Example:
±
A vertex represents an airport and stores the threeletter airport code
±
An edge represents a flight route between two airports and stores the
mileage of the route
ORD
PVD
MIA
DFW
SFO
LAX
LGA
HNL
849
8
0
9
1120
2555
Graphs
4
Edge Types
Directed edge
±
ordered pair of vertices
(
u
,
v
)
±
first vertex
u
is the origin
±
second vertex
v
is the destination
±
e.g., a flight
Undirected edge
±
unordered pair of vertices
(
u
,
v
)
±
e.g., a flight route
Directed graph
±
all the edges are directed
±
e.g., route network
Undirected graph
±
all the edges are undirected
±
e.g., flight network
ORD
PVD
flight
AA 1206
ORD
PVD
849
miles
Graphs
5
John
David
Paul
brown.edu
cox.net
cs.brown.edu
att.net
qwest.net
math.brown.edu
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.
 Fall '08
 Staff
 Graph Theory, Data Structures, edges, DFW, vertices

Click to edit the document details