GRAPH THEORY (Basic)
• Definition − A graph (denoted as G=(V,E)) consists of a non-empty set of
vertices or nodes V and a set of edges E. It is a collection of points, called
vertices, and lines between those points, called edges.
• A graph is a collection of vertices connected to each other through a set of
edges.
Example − Let us consider a graph G=(V,E)
where V={a,b,c,d, e} and E={{a,b},{a,c},{b,c},{c,d}}
• Degree of a Vertex − The degree of a vertex V of a graph G (denoted by deg
(V)) is the number of edges incident with the vertex V. (in the graph, deg(c) =
3.
• The vertex of degree 0 is isolated and the vertex of degree 1 is a pendant.
• Even and Odd Vertex − If the degree of a vertex is even, the vertex is called an
even vertex and if the degree of a vertex is odd, the vertex is called an odd
vertex.
The even vertices are a, b, and the odd vertices are c, d. e
• Degree of a Graph − The degree of a graph is the
largest vertex degree of that graph. For the graph
on the right, the degree of the graph is 3.
Adjacent Vertices
Two vertices are said to be adjacent if there is an edge (arc) connecting them.
Adjacent Edges
Adjacent edges are edges that share a common vertex.
A vertex of degree zero is called isolated.
A graph with one vertex is a trivial graph.
Otherwise non-trivial.
Exercise: What is the degree of each vertex?
G dG(a) = 3 d(b) = ___ dG(d) = ___
dG(c) = ___ d(e) = ____ dG(f) = ___
The degree sequence of the graph is
then 3, 2, 4, 2, 1, 0 This can be written in
different ways like 4, 3, 2, 2, 1, 0 or 0, 1, 2, 2, 3, 4
Let us write in decreasing order, 4, 3, 2, 2, 1, 0
Exercise: Give the degree sequence of each graph. What is the degree of the graph?
Def. If a sequence (d1, d2, d3, . . . d) of nonnegative integers is the degree sequence
of a graph, then it is called a graphic (or graphical) sequence.
Which sequence is graphic? Why?
1. (5,2,2,2,1) 5. 5,2,2,2,1,0
2. 2, 2, 1, 1 6. 3, 3, 2, 1, 1 9. 3, 3, 3, 3, 3, 3, 3, 3
3. 4, 2, 2, 1 7. 2, 2, 2, 1,1
4. 2, 2, 1, 1 8. 3, 2, 2, 1, 1, 1
TYPES OF GRAPHS
Def. A loop is an edge that connects a vertex to itself.
Def. If a graph has more than one edge joining some pair of vertices then these edges
are called multiple edges./parallel edges
Def. a multigraph is a graph which is permitted to have multiple edges (also called
parallel edges)
Def. A simple graph is a graph that have no loops and no parallel edges
Def. A walk is a sequence of vertices and edges of a graph i.e. if we traverse a graph
then we get a walk. i.e. the origin vertex and terminal vertex are different.
Note: Vertices and Edges can be repeated.
The total number of edges covered in a walk is called as Length of the Walk.
Examples: 1324 length is 2
12435 length is 4.
1234213 length is 6
Def. Open walk
• if-its length of the walk is greater than zero and the vertices at which the walk
starts (origin vertex) and ends (terminal vertex) are different.
Ex. ABCE and its length is 3
Def. Closed walk
• If its Length of the walk is greater than zero and the vertices at which the walk
starts and ends are same.
Ex. BCEDB and its length is 4
Def. A trail is an open walk in which vertices may repeat but no edges are not allowed
to repeat.
Def. A path is defined as an open walk with no repeated vertices and edges.
.
Ex. afcgd is a path (black path)
Why is the blue path not a path?
.Def. A Circuit is a closed trail.
• Vertices may repeat and edges are not allowed to repeat,
• In the figure above
Def. A cycle is defined as a closed path. It is walk in which-
-- no vertices are allowed to repeat apart from the start and end vertex.
-- No edges are allowed to repeat.
C C C
3 4 5
A cyclic graph is a graph containing at least one cycle.
Def.
Ex. EDBACD
7. An acyclic graph is a graph which does not contain any cycle in it.
It is important to note the following points-:
Every path is a trail but every trail need not be a path.
Every cycle is a circuit but every circuit need not be a cycle.
The length of a walk trail, path or cycle is its number of edges.
Def. A regular graph is a graph with the degree of each vertex are equal. A graph is called
K regular if degree of each vertex in the graph is K.
• Ex. The degree sequence of G is 2, 2, 2, therefore this
graph is called 2 regular.
• The degree sequence of G is 3, 3, 3, 3, therefore this
graph is called 3 regular.
What kind of graph is each?
Def. A complete graph K nis a graph in which every pair of vertices is connected by an
edge. There are no loops
Def. a bipartite graph (or bigraph) is a graph whose vertices can be divided into
two disjoint and independent sets U and V, that is every edge connects a vertex in
U to one in V
Def. Complete Bipartite graph K n , m – every vertex of one set is connected with
every vertex of the other set.
Def. A star graph S is the complete bipartite graph K . The star S is called
k 1,k 3
the claw graph.
Def. The wheel graph with n spokes, denoted by W , is a graph that consists of a centered
n
vertex and n-spokes running out to n vertices. Think of a wagon wheel. The centered vertex
is the hub
Def. A graph is said to be connected graph if every pair of vertices in the graph is
connected. Otherwise disconnected.
Def. A graph with just one vertex is connected
.
Def. A component of G is a maximal connected subgraph of G. The number of
components of G is denoted by (G), is read omega.
A disconnected graph G
Graph G
Its components are A, B, C, D. ω (G)=4
Def. An acyclic graph is a graph that has no cycle.
Def. A tree is a connected acyclic graph.
Def. Def. A forest is an acyclic graph.
Def. An end vertex of a forest is a vertex of degree 1.
Graph A is a tree, graph B is a tree, graph C is a tree, and graph D is a tree.
Together is a FOREST.
• Note: In any non-trivial tree, there are at least 2 end vertices.
All non isomorphic trees
- of degree 2:
- of degree 3
- of degree 4
- of degree 5
- of degree 6
- Of degree 7
Def. Let G be a graph.
1. A vertex v of a graph G is called a cut vertex of G if (G – v) > (G).
Simply, A cut vertex is a single vertex whose removal disconnects a graph.
What vertex will you remove to make the graph disconnected? (i.e.increase the
number of components?) number of components increase?
Example: G
A simple approach of finding a cut vertex is one by one we remove all vertices and see
if removal of a vertex causes disconnected graph.
A connected graph G may have at most (n–2) cut vertices
Def. Let G be a graph.
2. An edge e of G is called a bridge or a cut edge if (G – e) > (G).
i.e. What edge will be remove to increase the number of components?
Ex. 2’.
What are the cut vertices? _______________________
What are the cut edges or bridge? _______________________