Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

Graph Theory

A graph is a collection of vertices and edges. Vertices are represented by points and
edges are by line segments.
It is denoted by G={V,E}
Where V={v1,v2……} is the set of vertex
E={e1,e2……} is the set of edges.

Examples
i) G= (V(G), E(G),  G )

In the pictorial representation, we represent the vertices by small circles and the edges
by lines whenever the corresponding pair of vertices forms an edge.

Now the pictorial representation of examples (i) and (ii) are

Application
 Airline Scheduling (Flow problems)
 Directions in a Google map (Shortest path)
 Designing of circuit connections
 3D structure of complicated simulated atomic structures in physics and
chemistry.
 Search Engine Algorithms (PageRank algorithm)
 Social Media Marketing (Community detection)

Note:
1. a loop (also called a self-loop or a buckle) is an edge that connects a vertex to
itself.
2. If there are more than one edge between a pair of vertices in a graph, these
edges are called parallel edge.
Graph terminology
Simple graph: A graph with no self loops and parallel edges is called a simple graph.
Multi graph: A graph which consists of parallel edges is called multi graph.
Pseudo graph: A graph with self loop and parallel edges is called a pseudo graph.

Note: Every graph simple and multi graph is pseudo graph, but the converse is not
true.
Degree of a vertex: The degree of a vertex v is the number of edges incident with
that vertex.
Or
The number of edges having that vertex as an end point.
It is denoted by d(v).
tht
Isolated vertex: A vertex with degree zero is called an isolated vertex.
Pendant vertex: A vertex with degree one is called pendant vertex.
Adjacent vertices: A pair of vertices that determine an edge are called adjacent
vertices.
Note: A vertex is even or odd if as its degree is even or odd.
K-Regular: A graph G is k- regular or regular of degree k, if every vertex of G has
degree k.
Comlpete graph: A simple graph in which each pair of distinct vertices is joined by an
edge is called a complete graph.
A comple graph of n vertices is denoted by kn
NON IS A COMPLETE GRAPH IS A COMPLETE GRAPH

Subgraph: A graph whose vertices and edges are subsets of another graph.

Planar Graph: A graph is said to be planar if it can be drawn in a plane so that no


edge cross each other.

Line Graph:
A graph that uses lines to connect individual data points. A line graph displays
quantitative values over a specified time interval.
Directed Graph and undirected Graphs:
o A directed graph (or digraph) is a set of nodes connected by edges, where
the edges have a direction associated with them.
o It contains an ordered pair of vertex.
o It has initial vertex and terminal(end) vertex.

Undirected Graph:
o A directed graph (or digraph) is a set of nodes connected by edges, where
the edges have no direction associated with them.
o It contains an unordered pair of vertex.

Bipartite Graphs
 A bipartite graph, also called a bigraph.
 It is a set of graph vertices decomposed into two disjoint sets such that no two graph
vertices within the same set are adjacent.
 A bipartite graph is a graph whose vertices can be partitioned into two subsets, v1
and v2 such that no edge has both endpoints in the same subset,
Example:
G is a bipartite graph, because its vertex set {u,c,w,b,v,a} is partitioned into two non-empty sets
v1={u,v,w} and v2={a,b,c}.

Complete Bipartite Graph


A complete bipartite graph is a graph whose vertices can be partitioned into two subsets, v1 and
v2 such that no edge has both endpoints in the same subset, and If every vertex of V1 is connected
to every vertex of V2 the graph is called a complete bipartite graph.

It is denoted by K nm,where n,m are elements of 1st and 2nd set

Isomorphism
Two graphs G1 and G2 are said to be isomorphic if there is one to one correspondance (bijection)
between the edge set E1 & E2 in such a way that if e1 is an edge with end vertices u1 and v1 in G1 then
the corresponding edge e2 in in G2 has its end vertices u2 and v2 in G2 which correponds to u1 and v1
(or)
Two graphs are isomorphic if
i. Number of vertices are same
ii. Number of edges are same
iii. An equal number of vertices with given degree
iv. Vertex correspondence & edge correspondence valid.
Connectivity/Connectedness

1. Connectedness in directed graph


2. Connectedness in undirected graph

Connectedness in directed graph

1. Strongly connected(Path in both direction)


A directed graph is strongly connected if there is a path form u to v and v to u, where u and v
are vertices in the graphs.
oder
A directed graph G is strongly connected if there is a directed path from each vertex to
every other vertex.

Vertex pair forward path Backward path


(1,2) 1-2 2-4-1
(1,3) 1-3 3-2-4-1
(1,4) 1-2-4 4-1
(2,3) 2-4-3 3-2
(2,4) 2-4 4-1-2/4-3-2
(3,4) 3-2-4 4-3
2. Weakly connected(Direction is possible only after assuming directed as undirected)
A directed graph is weakly connected, if there is a path between any two vertices in the
underlying undirected graph.

3. Unilaterally Connected(at least a Single path)

A directed graph is said to be unilaterally connected, if in the two vertices u and v, there
exists a directed path either form u to v or from v to u.

Vertex pair forward path Backward path


(1,2) 1-2 X
(1,3) X 3-4-1
(1,4) X 4-1
(2,3) X 3-2
(2,4) X 4-1-2
(3,4) 3-4 X

Handshaking Theorem
n
Let G be a graph with n vertices and e edges. Then  deg(v )  2e
i 1
i .

Proof: Let G be a graph with n vertices and e edges.


The degree of a vertex is the number of edges incident with that vertex.
Since every edge contributes degree 2 to this sum.
n
  deg(vi )  2e .
i 1

Theorem
In a graph G the degree of odd number vertices is an even number.
Proof: Let G be a graph with n vertices and e edges.
n
By Handshaking Theorem  deg(v )  2e
i 1
i

Among n vertices some are even degree and some are odd degree vertices.
Let Ve and Vo be the even and odd vertices respectively.

 deg(v)   deg(v)  2e
V Ve V Vo

 deg(v)  2e   deg(v)
V Vo V Ve
Since the right side is even.
So the sum of left side must contain even no.
i.e. the no. of odd vertices in G is even.
Question1:
Degree of a graph with 12 edges is__24___.
Explanation: Number of edges incident on a graph is known as degree of a vertex. Sum
of degrees of each vertex is called total degree of the graph. Total degree = 2 * number
of edges. So, if there are 24 edges then total degree is 24.
Question2:
An undirected graph has 8 vertices labelled 1, 2, …,8 and 31 edges. Vertices 1, 3, 5, 7
have degree 8 and vertices 2, 4, 6, 8 have degree 7. What is the degree of vertex 8?
Answer: 8
Explanation: Vertices 1, 3, 5, 7 have degree 8 and vertices 2, 4, 6, 8 have degree
7. By definition, sum of degree= 2 * No of edges
Let x = degree of vertex 8
8 + 7 + 8 + 7 + 8 + 7 + 8 + x = 2 * 31
53 + x = 62
x=9
Hence, degree of vertex 8 is 9.
w  v1e1v2e2 .......en vn
Origin Vertex Internal Vertex Terminous
Vertex
No of edges= length of walk(say n)
If n is even even walk
v-May Repeat
If n is odd  odd walk
e-May Repeat

Open walk v1  vn Closed Walk v1  vn

PATH(Open) Trail(Open)
v-No Repeat v-Repeat
e-No Repeat e-No Repeat

Cycle(Closed Path) Circuit(Closed Trail)


v-No Repeat v-Repeat
e-No Repeat e-No Repeat
(Only start and end (Any vertex may be repeated)
vertex is repeated)

Walk:

A walk in a graph G is a finite sequence

W=v1e1v2e2v3e3…….vnen of vertices and edges (not necessarily distinct), beginning and


ending with same or different veritices.

Note: i) Vertices – May repeated.


Edges – May repeated.
ii) Walk can be open or closed.
Length of a walk: The number of edges is called length of the walk.

Trivial walk: A walk that contains no edges.

Closed and open walk: A walk is said to be closed if its origin & terminal vertex is
equal(v0=vn) otherwise ith is called open walk.
Trail: Any walk having different edges or distinct edges is called trail.

Note: i) Vertices – May repeated.


Edges – Not repeated.
ii) Trail can be open or closed.
Circuit: Any closed trial is called circuit.

Note: i) Vertices – May repeated.


Edges – Not repeated.
ii) Circuit is closed trail.
Path: It is a trail in which neither edges nor vertices are repeated.

Note: i) Vertices – Not repeated.


Edges – Not repeated.
ii) Path is open.
iii) Every path is a trail but not every trail is a path.
Cycle: A closed path is called cycle. Only starting and ending vertex must be same.

Note: i) Vertices – Not repeated.


Edges – Not repeated.
ii) Cycle is closed path.
Theorem

A connected graph is Eulerian iff it has no vertices of odd degree.

Proof:

Suppose G is Eulerian Graph.


Then to prove G is of even degree.
Since G is Eulerian Graph So it contains an Eulerian path.
In tracing this walk every time, the walk must a vertex v it goes through two new
edges.
By using one edge which we entered, another edge which we are going to leave.
For 1st vertex we exited and we can enter into that vertex at the last.
Therefore every vertex in a graph G is of even degree.
Conversely,

Suppose all vertices of G are of even degree, then to prove G is Eulerian Graph.
Since all vertices of G are of even degree. So can construct a Eulerian path starting
from vertex v.
Since every vertex is of even degree, we can enter into every vertex and exit from the
same vertex.
Tracing continuously until reaching the vertex V.
So G contains an Eulerian path
Therefore G is an Eulerian.

Connected Component of G

A maximal connected Sub graph of G is a component of G.

Ex:

Note: if graph is connected then there is no component exist.

Cut – Edge(bridge)

An edge ‘e’ of a graph ‘G’ is said to be a cut – edge or a bridge of G if (G-e) is


disconnected.
Cut – Vertex(Articulation point / cut point)

An vertex ‘v’ of a graph ‘G’ is said to be a cut – Vertex of G if (G-V) is disconnected.

Cut – Set

The set of all minimum no. Of edges of G whose removal disconnects a graph G is
called a cut set of G.

A cut set S of G satisfies the following.

1. S is a subset of the edge set E of G.

2. Removal of edges from a connected graph G disconnects G.

3. No proper subset of G satisfy the condition.

Ex

You might also like