Graphrepresentation
Graphrepresentation
G1
In G1, edge (V, V) forming a loop at vertexV.
Adjacent Edges:
• Two distinct edges that share an end vertex.
• Example- In G1, edges e1 and e2 share same end vertex v1 .
G1
Graph Terminologies:
Edge Cost:
• Value that an edge holds to travel to another vertex.
• Weight of an edge/Edge Weight is referred as "cost" of the edge.
• In applications, weight may be a measure of the length of a route,
the capacity of a line, the energy required to move between
locations along a route, etc.
Sequential Representation:
This representation of a graph can be
represented by means of matrices:
• Adjacency Matrix
• Incidence matrix
• Path matrix
Graph Representation
Sequential Representation:
1. Adjacency Matrix:
This matrix includes information about the
adjacent nodes.
2. Incidence Matrix:
This matrix includes information about the incidence of
edges on the nodes.
2. Edge Lists
• For Example:
G= (V,E) =( [V1, V2, V3, V4, V5, V6],
[(V1, V2),(V1, V3),(V2, V3),(V3,V4),
(V4, V1),(V4, V5),(V4, V6),(V5, V4)])
Types of Graphs
G1
Regular Graph
In G2, there are four vertices named vertex E, F, G
and F.
Degree of all 4 vertices of G2 is 2 as only two
edges are associated with all vertices of G2.
G2 is also a regular graph as all nodes have same
degree of 2.
G2
Complete Graph/ Full Graph
A simple graph G=(V, E) with “n” vertices is called a
Complete Graph, if the degree of each vertex is n-1,
i.e., one vertex is attached with n-1 edges.
G1 G2 G3
G1
G2
Acyclic Graph
A graph is called an acyclic graph if there are no or
zero cycles present in the graph
G1
Simple Graph
A simple graph is a graph that does not contain
more than one edge between the pair of vertices.
No self-loops and no parallel edges are present in
the simple graph.
Example- A simple railway track connecting
different cities is an example of a simple graph.
Simple Graph
G1
G1
G1
G1
THANKYOU