Graph Theory - Lecture 1 (of 2)
Graph Theory
Click here for a movable graph
Graph Theory
Graph Theory
Graph Theory
Graph Theory
Graph Theory
a e1
e2 c
b e4
d e3 e5
e6 e e8
e7
G f g
Definition (Graph)
A graph G is an ordered pair (V , E ), where
V = V (G ) is a non-empty set of vertices – The vertex set of G ;
E = E (G ) is a set of edges the edge set of G ; and the two sets are
related through a function
fG : E → {{u, v } : u, v ∈ V }
called the incidence function, assigning to each edge the unordered
pair of its end-points. 1/20
Graph Theory - Example
za e1
e2 c
b e4
d e3 e5
e6 e e8
e7
G f g
The drawing above represents a graph with vertex set
V = {a, b, c, d, e, f , g }, edge set E = {e1 , e2 , · · · , e8 }, and incidence
function defined by
f (e1 ) = {a, b} f (e2 ) = {b, c}
f (e3 ) = {b, d} f (e4 ) = {b, e}
f (e5 ) = {c, e} f (e6 ) = {d, f }
f (e7 ) = {e, f } f (e8 ) = {c, g }
2/20
Graph Theory - Loop and Parallel Edges
Definition
An edge e in a graph G is called a
loop if fG (e) = {u} for some vertex u ∈ V (G ) (that is, if its
endpoints coincide)
link if fG (e) = {u, v }for distinct vertices u, v ∈ V (G ).
Distinct edges e1 and e2 in a graph G are called parallel or multiple
if fG (e1 ) = fG (e2 ),that is, if they have the same endpoints. 3/20
Graph Theory - Loop and Parallel Edges
In this example, edges e1 ande7 are loops,
and all other edges are links.
Edges e3 , e4 , and e5 are pairwise parallel.
4/20
Graph Theory - Loop and Parallel Edges
In this example, edges e1 ande7 are loops,
and all other edges are links.
Edges e3 , e4 , and e5 are pairwise parallel.
Definition (Simple Graph)
A simple graph is a graph without loops and without multiple edges.
4/20
Graph Theory - Directed Graph
Definition
A directed graph (or digraph) D is an ordered pair (V , A), where
V = V (D) is a non-empty set of vertices – the vertex set of D;
A = A(D) is a set of arcs or directed edges the arc set of D; and
the two sets are related via an incidence function fD :→ V × V ,
assigning to each arc the ordered pair of its endpoints.
5/20
Graph Theory - Directed Graph Example
We have a digraph with vertex set V = {v1 , v2 , v3 , v4 } and arc set
A = {a1 , a2 , ..., a9 }. The incidence function returns
fD (a1 ) = (v1 , v1 ) fD (a2 ) = (v1 , v2 )
fD (a3 ) = (v3 , v2 ) fD (a4 ) = (v2 , v3 )
fD (a5 ) = (v2 , v3 ) fD (a6 ) = (v2 , v4 )
fD (a7 ) = (v3 , v3 ) fD (a8 ) = (v3 , v4 )
fD (a9 ) = (v4 , v3 )
6/20
Graph Theory - Directed Graph Example
If a ∈ A(D) and u, v ∈ V (D) are such that fD (a) = (u, v ), then u is called
the initial and v is called the terminal vertex of the arc a.
7/20
Graph Terminology
Graph Theory - Graph Terminology
Adjacent: Let G = (V , E ) be a graph. Vertices u, v ∈ V are called
adjacent or neighbours in G if uv is an edge of G .
8/20
Graph Theory - Graph Terminology
Adjacent: Let G = (V , E ) be a graph. Vertices u, v ∈ V are called
adjacent or neighbours in G if uv is an edge of G .
Incident An edge uv is said to be incident with each of its end points
u and v .
8/20
Graph Theory - Graph Terminology
Adjacent: Let G = (V , E ) be a graph. Vertices u, v ∈ V are called
adjacent or neighbours in G if uv is an edge of G .
Incident An edge uv is said to be incident with each of its end points
u and v .
Degree The degree of a vertex u ∈ V , denoted by degG (u), is the
number of edges of G incident with vertex u, each loop counting
twice.
8/20
Graph Theory - Graph Terminology
Adjacent: Let G = (V , E ) be a graph. Vertices u, v ∈ V are called
adjacent or neighbours in G if uv is an edge of G .
Incident An edge uv is said to be incident with each of its end points
u and v .
Degree The degree of a vertex u ∈ V , denoted by degG (u), is the
number of edges of G incident with vertex u, each loop counting
twice.
– A vertex of degree 0 is called isolated, and a vertex of degree 1 is
called pendant (or a leaf in the context of trees).
8/20
Some Useful Graphs
Graph Theory - Complete Graph
9/20
Graph Theory - Complete Graph
Complete Graph
A complete graph Kn (for n ≥ 1) is a simple graph with n vertices in
which every pair of distinct vertices are adjacent. More formally
V (Kn ) = {u1 , u2 , · · · , un }
E (Kn ) = {xy : x, y ∈ V , x 6= y }
9/20
Graph Theory - Complete Bi-partite Graph
10/20
Graph Theory - Complete Bi-partite Graph
Complete Bi-partite Graph
A complete bipartite graph Km,n (for m, n ≥ 1) is a simple graph with
m + n vertices. The vertex set partitions into sets X and Y of cardinalities
m and n, and each pair of vertices from distinct parts are adjacent. That
is:
V (Km,n ) = {x1 , x2 , · · · , xm } ∪ {y1 , y2 , · · · , yn }
E (Km,n ) = {xi yj : xi ∈ X , yj ∈ Y }
10/20
Graph Theory - Bipartite Graph
11/20
Graph Theory - Bipartite Graph
Bipartite Graph
A bipartite graph Km,n (for m, n ≥ 1) is a simple graph with m + n
vertices. The vertex set partitions into sets X and Y of cardinalities m and
n. And edges are only of the form xy , where x ∈ X , y ∈ Y :
V (Km,n ) = {x1 , x2 , · · · , xm } ∪ {y1 , y2 , · · · , yn }
E (Km,n )⊆{xi yj : xi ∈ X , yj ∈ Y }
11/20
Graph Theory - Cycle
12/20
Graph Theory - Cycle
13/20
Graph Theory - Cycle
Cycle
A cycle Cn (of length n ≥ 1) is a graph with n vertices that are linked in a
circular way, creating n edges. That is,
V (Cn ) = {u1 , u2 , · · · , un }
E (Cn ) = {u1 u2 , u2 u3 , u3 u4 , · · · , un−1 un , un u1 }
13/20
Graph Theory - Cycle
Cycle
A cycle Cn (of length n ≥ 1) is a graph with n vertices that are linked in a
circular way, creating n edges. That is,
V (Cn ) = {u1 , u2 , · · · , un }
E (Cn ) = {u1 u2 , u2 u3 , u3 u4 , · · · , un−1 un , un u1 }
Note that any cycle Cn for n ≥ 3 is a simple graph, while for n = 2, the
edge set E (Cn ) consists of a pair of parallel edges.
13/20
Graph Theory - Path
14/20
Graph Theory - Path
15/20
Graph Theory - Path
Path
A path Pn (of length n ≥ 0) is a graph with n + 1 vertices that are linked
in a linear way. More precisely,
V (Pn ) = {u1 , u2 , · · · , un }
E (Pn ) = {u1 u2 , u2 u3 , u3 u4 , · · · , un−1 un }
15/20
Graph Theory - Subgraph
b c h
d e i j
G f g H k
Subgraph
Let G and H be simple graphs. We say that H is a subgraph of G if
V (H) ⊆ V (G ) and E (H) ⊆ E (G ).
But is it induced subgraph? What is that by the way?
16/20
Graph Theory - Subgraph
b c h
d e i j
G f g H k
Subgraph
Let G and H be simple graphs. We say that H is a subgraph of G if
V (H) ⊆ V (G ) and E (H) ⊆ E (G ).
But is it induced subgraph? What is that by the way?
16/20
Matrix Representation of Graphs
Matrix Representation of Graphs
Graph Theory - Incident Matrix Representation
Incident Matrix Representation
Let G be a graph with V (G ) = {u1 , u2 , · · · , un },
E (G ) = {e1 , e2 , · · · , em },and incidence function fG . We define:
the incidence matrix of G : an n × m matrix M = [mij ] such that
2, if fG (ej ) = {vj }
mij = 1, if fG (ej ) = {ui , uk } for some k 6= i (1)
0 otherwise.
17/20
Graph Theory - Adjacency Matrix Representation
Adjacency Matrix Representation
Let G be a graph with V (G ) = {u1 , u2 , · · · , un },
E (G ) = {e1 , e2 , · · · , em },and incidence function fG . We define:
the adjacency matrix of G : an n × n matrix A = [aij ] such that
aij = |{ek : fG (ek ) = {ui , uj }}|
= number of edges with end points ui and uj .
18/20
Graph Theory - Adjacency Matrix Representation
19/20
Thank you for your attention!!
20/20