1
CMPS 101
Algorithms and Abstract Data Types
Graph Theory
Graphs
A
graph
G
consists of an ordered pair of sets
)
,
(
E
V
G
=
where
∅
≠
V
, and
}
of
subsets

2
{
)
2
(
V
V
E
=
⊆
,
i.e.
E
consists of
unordered
pairs of elements of
V
.
We call
)
(
G
V
V
=
the
vertex
set, and
)
(
G
E
E
=
the
edge
set of
G
.
In this handout we consider only graphs in which both the vertex set and edge set are
finite.
An edge {
x
,
y
}, denoted
xy
or
yx
, is said to
join
its two
end vertices
x
and
y
, and these ends are
said to be
incident
with the edge
xy
.
Two vertices are called
adjacent
if they are joined by an edge, and
two edges are said to be
adjacent
if they have a common end vertex.
A graph will usually be depicted as
a collection of points in the plane (vertices), together with line segments (edges) joining the points.
Example 1
}
6
,
5
,
4
,
3
,
2
,
1
{
)
(
=
G
V
,
}
56
,
45
,
36
,
35
,
26
,
25
,
24
,
23
,
14
,
12
{
)
(
=
G
E
1
2
3
4
5
6
Two graphs
1
G
and
2
G
are said to me
isomorphic
if there exists a bijection
)
(
)
(
:
2
1
G
V
G
V
→
φ
such that
for any
)
(
,
1
G
V
y
x
∈
, the pair
xy
is an edge of
1
G
if and only if the pair
)
(
)
(
y
x
is an edge of
2
G
.
In
other words,
must preserve all incidence relations amongst the vertices and edges in
1
G
.
We write
2
1
G
G
≅
to mean that
1
G
and
2
G
are isomorphic.
Example 2
Let
1
G
be the graph from the previous example, and define
2
G
by
}
,
,
,
,
,
{
)
(
2
f
e
d
c
b
a
G
V
=
,
}
,
,
,
,
,
,
,
,
,
{
)
(
2
ef
de
cf
ce
bf
be
bd
bc
ad
ab
G
E
=
.
Define a map
)
(
)
(
:
2
1
G
V
G
V
→
by
,
3
,
2
,
1
c
b
a
→
→
→
f
e
d
→
→
→
6
,
5
,
4
.
Clearly
is an isomorphism.
2
G
can be drawn as
a
d
c
f
b
e
Isomorphic graphs are indistinguishable as far as graph theory is concerned.
In fact, graph theory can be
defined to be the study of those properties of graphs that are preserved by isomorphism.
Thus a graph is
not a picture, in spite of the way we visualize it.
A graph is a combinatorial object consisting of two
abstract sets, together with some incidence data relating those sets.