Graphs
Graphs
A graph data structure is a collection of nodes that have data and are connected to
other nodes. It is a non-linear data structure that consists of vertices (a point or an object in the
Graph, also called nodes) and edges (used to connect two vertices with each other).
● A collection of vertices V
● A collection of edges E, represented as ordered pairs of vertices (u,v
1. FINITE GRAPH: The graph G=(V, E) is called a finite graph if the number of vertices
and edges in the graph is limited in number
2. INFINITE GRAPH:
The graph G=(V, E) is called an infinite graph if the number of vertices and edges in the
graph is interminable.
3. TRIVIAL GRAPH: A graph G= (V, E) is trivial if it contains only a single vertex and no
edges.
4. SIMPLE GRAPH: If each pair of nodes or vertices in a graph G=(V, E) has only one
edge, it is a simple graph. As a result, there is just one edge linking two vertices,
depicting one-to-one interactions between two elements.
5. MULTI GRAPH: If there are numerous edges between a pair of vertices in a graph G=
(V, E), the graph is referred to as a multigraph. There are no self-loops in a Multigraph.
6. NULL GRAPH: If several vertices but no edges connect them, a graph G= (V, E) is a
null graph.
11. CONNECTED GRAPH: If there is a path between one vertex of a graph data structure
and any other vertex, the graph is connected.
12. DISCONNECTED GRAPH: When there is no edge linking the vertices, you refer to the
null graph as a disconnected graph.