Professional Documents
Culture Documents
Graph 032001
Graph 032001
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.
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.
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}.
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
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.
Handshaking Theorem
n
Let G be a graph with n vertices and e edges. Then deg(v ) 2e
i 1
i .
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
PATH(Open) Trail(Open)
v-No Repeat v-Repeat
e-No Repeat e-No Repeat
Walk:
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.
Proof:
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
Ex:
Cut – Edge(bridge)
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.
Ex