An introduction
Arash
13 Octob
Arash Rafiey
to graph theory
Rafiey
ber, 2015
An introduction to graph theory
Definition of Graph
Let V be a finite nonempty set an
(V , E ) is called a digraph where V
called a set of (directed) edges or
Arash Rafiey
nd let E ⊆ V × V .
V is a set of vertices and E is
arcs.
An introduction to graph theory
Definition of Graph
Let V be a finite nonempty set an
(V , E ) is called a digraph where V
called a set of (directed) edges or
When the order does not matter (
graph G = (V , E ) and E (G ) ⊆ {{
a
bc
de
V={a,b,c,d,e}
E={{a,b},{a,c},{b,c},{b,d},{d,c},{c,e
Arash Rafiey
nd let E ⊆ V × V .
V is a set of vertices and E is
arcs.
(relation is symmetric) we have a
{u, v }|u, v ∈ V (G )}
a
bc
de
V={a,b,c,d,e}
e}} E={(a,b),(b,d),(d,b),(c,b),(c,e)}
An introduction to graph theory
For simplicity instead of edge {u,
Arash Rafiey
v } we write edge uv .
An introduction to graph theory
For simplicity instead of edge {u,
Two vertices u and v are called ad
Arash Rafiey
v } we write edge uv .
djacent if uv is an edge of G .
An introduction to graph theory
For simplicity instead of edge {u,
Two vertices u and v are called ad
We say v is a neighbor of u if uv
Let x, y be two vertices of graph G
Arash Rafiey
v } we write edge uv .
djacent if uv is an edge of G .
is an edge of G .
G.
An introduction to graph theory
For simplicity instead of edge {u,
Two vertices u and v are called ad
We say v is a neighbor of u if uv
Let x, y be two vertices of graph G
An x − y walk is an alternating se
starting at x and ending at y .
Arash Rafiey
v } we write edge uv .
djacent if uv is an edge of G .
is an edge of G .
G.
equence of vertices and edges,
An introduction to graph theory
For simplicity instead of edge {u,
Two vertices u and v are called ad
We say v is a neighbor of u if uv
Let x, y be two vertices of graph G
An x − y walk is an alternating se
starting at x and ending at y .
If x = y then the walk is called cl
Arash Rafiey
v } we write edge uv .
djacent if uv is an edge of G .
is an edge of G .
G.
equence of vertices and edges,
losed.
An introduction to graph theory
For simplicity instead of edge {u,
Two vertices u and v are called ad
We say v is a neighbor of u if uv
Let x, y be two vertices of graph G
An x − y walk is an alternating se
starting at x and ending at y .
If x = y then the walk is called cl
A trail is a walk in which all the e
Arash Rafiey
v } we write edge uv .
djacent if uv is an edge of G .
is an edge of G .
G.
equence of vertices and edges,
losed.
edges are distinct.
An introduction to graph theory
For simplicity instead of edge {u,
Two vertices u and v are called ad
We say v is a neighbor of u if uv
Let x, y be two vertices of graph G
An x − y walk is an alternating se
starting at x and ending at y .
If x = y then the walk is called cl
A trail is a walk in which all the e
A path is a simple walk (no verte
Arash Rafiey
v } we write edge uv .
djacent if uv is an edge of G .
is an edge of G .
G.
equence of vertices and edges,
losed.
edges are distinct.
ex repeated).
An introduction to graph theory
For simplicity instead of edge {u,
Two vertices u and v are called ad
We say v is a neighbor of u if uv
Let x, y be two vertices of graph G
An x − y walk is an alternating se
starting at x and ending at y .
If x = y then the walk is called cl
A trail is a walk in which all the e
A path is a simple walk (no verte
A cycle is a simple closed walk (n
beginning ).
Arash Rafiey
v } we write edge uv .
djacent if uv is an edge of G .
is an edge of G .
G.
equence of vertices and edges,
losed.
edges are distinct.
ex repeated).
no vertex repeated except the
An introduction to graph theory
Theorem
Let G = (V , E ) be undirected gra
exists a trail from a to b, then the
Arash Rafiey
aph with a, b ∈ V , a = b. If there
ere exists a path from a to b.
An introduction to graph theory
Theorem
Let G = (V , E ) be undirected gra
exists a trail from a to b, then the
Proof.
Consider the shortens trail a, x1, x
(ax1, x1x2, x2x3, . . . , xn−1xn, xnb ar
path then there exist k, m where x
k < m ). But then we can contra
a, x1, . . . , xk , xm+1, . . . , xn, b from
Arash Rafiey
aph with a, b ∈ V , a = b. If there
ere exists a path from a to b.
x2, . . . , xn, b in G
re edges). If this trail is not a
xk = xm (x0 = a, xm+1 = b,
act and get a shorter trail
a to b.
An introduction to graph theory
Definition
A graph G is called connected if
distinct vertices of G .
a c
b
de
G (connected)
Definition
If G is not connected then it can
each piece is a connected graph a
component .
The number of connected compon
Arash Rafiey
f there is a path between any two
a
bc
de
H (not connected)
be partitioned into pieces where
and is called a connected
nents of G is denoted by κ(G ).
An introduction to graph theory
Example :
Let G = (V , E ) be an undirected
n-sequences and the two vertices
exactly two positions.
Find κ(G ).
Arash Rafiey
graph whose vertices are binary
x, y are adjacent if they differ in
An introduction to graph theory
Definition
A graph G is simple if there are n
self-loop.
Arash Rafiey
no parallel edges and there is no
An introduction to graph theory
Definition
A graph G is simple if there are n
self-loop.
Definition
If v is a vertex of graph G , then t
(dG (v ), or dv ) is the number of ed
of neighbors of v . The self-loop is
If G is a simple graph and each ve
called a k-regular graph.
Arash Rafiey
no parallel edges and there is no
the degree of v , denoted deg (v )
dges incident to v . Is the number
s counted twice.
ertex has degree k then G is
An introduction to graph theory
Theorem (Handshaking)
For any graph G = (V , E ) we hav
deg (v )
v ∈V
Arash Rafiey
ve
= 2|E (G )|.
An introduction to graph theory
Theorem (Handshaking)
For any graph G = (V , E ) we hav
deg (v )
v ∈V
Proof.
If an edge e has two end points u
to each of deg (u), deg (v ). If e is
then it will contribute two to deg (
contributes two in the sum and id
Arash Rafiey
ve
= 2|E (G )|.
u and v then it will contribute one
s a self loop incident to vertex u
(u). In any case each edge
dentity follows.
An introduction to graph theory
Theorem (Handshaking)
For any graph G = (V , E ) we hav
deg (v )
v ∈V
Proof.
If an edge e has two end points u
to each of deg (u), deg (v ). If e is
then it will contribute two to deg (
contributes two in the sum and id
Corollary
In any graph G the number of ver
Arash Rafiey
ve
= 2|E (G )|.
u and v then it will contribute one
s a self loop incident to vertex u
(u). In any case each edge
dentity follows.
rtices of odd degree must be even.
An introduction to graph theory
Some families of Graphs
1) A graph G is called complete
every other vertex.
Arash Rafiey
if every vertex is adjacent to
An introduction to graph theory
Some families of Graphs
1) A graph G is called complete
every other vertex.
2) For every n ≥ 2, the n-path-gra
on n vertices.
V (Pn) = {v1, v2, . . . , vn} and E (P
Arash Rafiey
if every vertex is adjacent to
aph, denoted by Pn is just a path
Pn) = {v1v2, v2v3, . . . , vn−1vn}.
An introduction to graph theory
Some families of Graphs
1) A graph G is called complete
every other vertex.
2) For every n ≥ 2, the n-path-gra
on n vertices.
V (Pn) = {v1, v2, . . . , vn} and E (P
3) For every n ≥ 2, the n-cycle-gr
on n vertices.
V (Cn) = {v1, v2, . . . , vn}, E (Cn) =
Arash Rafiey
if every vertex is adjacent to
aph, denoted by Pn is just a path
Pn) = {v1v2, v2v3, . . . , vn−1vn}.
raph, denoted by Cn is just a cycle
= {v1v2, v2v3, . . . , vn−1vn, vnv1}.
An introduction to graph theory
Some families of Graphs
1) A graph G is called complete
every other vertex.
2) For every n ≥ 2, the n-path-gra
on n vertices.
V (Pn) = {v1, v2, . . . , vn} and E (P
3) For every n ≥ 2, the n-cycle-gr
on n vertices.
V (Cn) = {v1, v2, . . . , vn}, E (Cn) =
4) For every n ≥ 2, the n-hypercu
V (Qn) = {length n bit string }
their bit strings differ in exactly on
Arash Rafiey
if every vertex is adjacent to
aph, denoted by Pn is just a path
Pn) = {v1v2, v2v3, . . . , vn−1vn}.
raph, denoted by Cn is just a cycle
= {v1v2, v2v3, . . . , vn−1vn, vnv1}.
ube, denoted by Qn has vertex set
and two vertices are adjacent if
ne position.
An introduction to graph theory
Bipartite Graphs
Definition
A graph G = (V , E ) is bipartite if
such that each edge of G has one
point in W .
Arash Rafiey
f V can be partitioned into U, W
e end point in U and one end
An introduction to graph theory