Graph PDF
Graph PDF
• V (G), the vertex set of the graph, often denoted by just V , which
is a nonempty set of elements called vertices, and
• E(G), the edge set of the graph, often denoted by just E, which is
a possibly empty set of elements called edges, such that each edge
e in E is assigned an unordered pair (u, v) of vertices, called the
end vertices of e. Sometimes, it is convenient to denote (u, v) by
simply uv, or equivalently, vu.
V = {a, b, c, d, e} and E = {e1, e2, e3, e4, e5, e6, e7, e8},
where
e1 ←→ (a, b) e2 ←→ (b, c)
e3 ←→ (c, c) e4 ←→ (c, d)
e5 ←→ (b, d) e6 ←→ (d, e)
e7 ←→ (b, e) e8 ←→ (b, e)
e8
e1
a b e
e7
e2 e6
e5
e3 c d
e4
Note that the definition of a graph allows the possibility of the edge e
having idetical end vertices, i.e., it is possible to have a vertex u joined
to itself by an edge — such an edge is called a loop.
If two (or more) edges have the same end vertices then edges are called
parallel.
where
e1 ←→ (a, b) e2 ←→ (a, c)
e3 ←→ (b, c) e4 ←→ (c, d)
Some authors use the term multigraph for graphs with loops and parallel
edges, and reserve the term graph for simple graphs only. Since we will
deal with graphs with loops very often, it is more convenient not to make
this distinction.
e1
a b
e2 e3
e4
Two edges e and f which are incident with a common vertex v are said
to be adjacent.
b e
c d
The First Theorem of Graph Theory. For any graph G with ne edges
and nv vertices v1, . . . , vnv , we have that
nv
X
d(vi) = 2 · ne.
i=1
Check by yourself:
b e
c d
W = v0e1v1e2v2 . . . vk−1ek vk
whose terms are alternately vertices and edges such that, for 1 ≤ i ≤ k,
the edge ei has end vertices vi−1 and vi.
The integer k, the number of edges of the walk, is called the length of
W.
b d
e1 e2 e3
a e8 c e4
e7 e6 e5
f e
If the edges e1, e2, . . . , ek of the walk v0e1v1e2v2 . . . vk−1ek vk are dis-
tinct then W is called a trail.
M N
b d
b
a c a c
Connected Disconnected
b d
e1 e2 e3
a e8 c e4
e7 e6 e5
f e
b c d
The vertices of degree (at most) 1 in a tree are called the leaves of the
tree.
• V (D), the vertex set of the digraph, often denoted by just V , which
is a nonempty set of elements called vertices, and
• A(D), the arc set of the digraph, often denoted by just A, which
is a possibly empty set of elements called arcs, such that each arc
a in A is assigned a (ordered) pair (u, v) of vertices. If a is an arc
in D with associated ordered pair of vertices (u, v), then a is said
to join u to v, u is called the initial vertex of a, and v is called the
terminal vertex of a.
For example, consider the digraph D = (V (D), A(D)) such that V (D)
= {a, b, c, d, e} and A(D) = {e1, e2, e3, e4, e5, e6}, such that e1 ←→
(b, c), e2 ←→ (d, c), e3 ←→ (c, d), e3 ←→ (d, e), e4 ←→ (e, d), and
e6 ←→ (e, e).
e6
a b e
e1 e5 e4
e2
c d
e3
W = v0 a 1 v1 . . . a k vk ,
whose terms are alternately vertices and arcs such that for 1 ≤ i ≤ k,
the initial vertex of the arc ai is vi−1 and its terminal vertex is vi. The
number k of arcs is the length of W .
There are similar definitions for directed trails, directed paths, and di-
rected cycles.
a b e
e1 e5 e4
e2
c d
e3
e6 e6
a b e a b e
e1 e5 e4 e1 e5 e4
e2 e2
c d c d
e3 e3