discrete maths assignment
TRANSCRIPT
Presented By:
KESHAV SOMANI
BBA(E-COMM)IIISEM.
ROLLNO.56417
MATRIX REPRESENTATION OF GRAPH
Graph is a set of edges and vertices.
Graph can be represented in the form of matrix.
Different matrix that can be formed are:
1. Incidence Matrix
2. Adjacency Matrix
3. Cut-Set Matrix
4. Circuit Matrix
5. Path Matrix
Edge connected to the vertex is known as incidence edge to that vertex.
If vertex is incident on vertex then put 1 else 0.
V6
V4
V5V2
V3
h
ec
f
d
V1 a
b
aij =1, if edge ej is incident on vertex vi
=0, otherwise
0 000 101 011 010 00
1 011 10 10
1
d fea cb
V4
V1V2V3
g h
0011
0000
Edges
Ver
tex
1 110 000 00
0 00V6V5 1
011
Vertex
1
2
3
4
5
6
Edges
a, b
a, b, c, f
c, d, g
d, e
d, e, f, g, h
h
If two vertices are connected by single path than they are known as adjacent vertices.
If vertex is connected to itself then vertex is said to be adjacent to itself.
If vertex is adjacent then put 1 else 0.
V6
V4
V5V2
V3
h
ec
f
d
V1 a
b
0 00
0 01
1 01
1 01
1 10
0 10
0 10
0 11
0 00
0 01
1 1
0 01
0
V
4
V6V5V1 V3V2
V1
V2
V3
V4
V5
V6
Vertices
Ver
tice
s
V6
V4
V5V2
V3
h
ec
f
d
V1 a
b
Cut set is a “Set of edges in a graph whose removal leaves the graph disconnected”.
If edge of graph is a part of given cut set then put 1 else 0.
1 10
0 01
0 00
0 001 01
0 00
0 1
0 00
0
d fea cb
4
1
2
3
g h
1
1
0
0
0
0
1
0
Edges
Cut
Set
s
Cut Set
1
2
3
4
Edges
f, g, d
c, g, e
h
a, b
Cij =1, if jth cutset contains edge
=0, otherwise
V6
V4
V5V2
V3
h
ec
f
d
V1 a
b
Circuit can be defined as “A close walk in which no vertex/edge can appear twice”.
If edge of graph is a part of given circuit then put 1 else 0.
1 01
0 10
1 11
0 001 01
0 00
0 1
0 10
0
d fea cb
4
1
2
3
g h
1
1
0
0
0
0
0
0
Edges
Cir
cuit
s
Circuit
1
2
3
4
Edges
d, e, g
c, f, g
c, d, e, f
a, b
Cij =1, if circuit contains edge
=0, otherwise
V6
V4
V5V2
V3
h
ec
f
d
V1 a
b
Path can be defined as “A open walk in which no vertex/edge can appear twice”.
If edge of graph is a part of given path then put 1 else 0. Path
1
2
3
4
5
6
Edges
a, f, h
a, c, g, h
a, c, d, e, h
b, f, h
b, c, g, h
b,c, d, e, h
P( Vj,Vi)=1,if edge is on path
=0, otherwise
Ex: P ( V1,V6)
0 10
0 00
1 01
0 100 01
1 00
1 1
1 10
0
d fea cb
4
1
2
3
g h
0
1
0
0
1
1
1
1
EdgesP
aths
0 00
1 010 11
0 11
6
5 1
0
1
1
A graph, G, consist of two sets, V and E. E is set of pairs of vertices called edges. V is a finite, nonempty
set of vertices.
The vertices of a graph G can be represented as V(G). Likewise, the edges of a graph, G, can be represented
as E(G). Graphs can be either undirected graphs or directed
graphs. For a undirected graph, a pair of vertices (u, v) or (v, u)
represent the same edge. For a directed graph, a directed pair <u, v> has u as the
tail and the v as the head. Therefore, <u, v> and <v, u> represent different edges.
0
3
1 2
0
1
3 4
2
5 6
1
2
V(G2) = {0, 1, 2, 3, 4, 5, 6}
E(G2) = {(0, 1), (0, 2), (1, 3), (1, 4), (2, 5), (2, 6)}
(a) G1
V(G1) = {0, 1, 2, 3}
E(G1) = {(0, 1), (0, 2), (0, 3), (1, 2), (1, 3), (2, 3)}
(c) G3) = {0,
(c) G3
V(G3 1, 2}
E(G3) = {<0, 1>, <1, 0>, <1, 2>}
There are several roughly equivalent definitions
of a graph. Most commonly, a graph G is
defined as an ordered pair G=(V,E) ,
where V={v1 ,v2,….} is called the
graph's vertex-set and E= {e1,e2,…} is called
the graph's edge-set.
A graph may not have an edge from a vertex back to itself. (v, v) or <v, v> are called self edge or self loop. If a
graph with self edges, it is called a graph with self edges.
v1 A graph man not have multiple occurrences of the same edge.
If without this restriction, it is called a multigraph.
(a) Graph with a self edge
0
2
1 1
2
3
(b) Multigraph
Degree of a vertex: The degree of a vertex is the number of edges incident to that vertex.
If G is a directed graph, then we define
in-degree of a vertex: is the number of edges for which vertex is the head.
out-degree of a vertex: is the number of edges for which the vertex is the tail.
Let G(V, E) be a graph with n vertices, n ≥ 1. The adjacency matrix of G is a two-dimensional nxn array, A. A[i][j] = 1 iff the edge (i, j) is in E(G).
The adjacency matrix for a undirected graph is symmetric, it may not be the case for a directed graph.
For an undirected graph the degree of any vertex i is its row sum.
For a directed graph, the row sum is the out-degree and the column sum is the in-degree.
Planar graphs are graphs that may be drawn on a 2-dimensional plane without having any of the edges intersect. Below are several planar graphs that are also complete graphs.