0% found this document useful (0 votes)
4 views

Graphs

A graph data structure consists of nodes (vertices) and connections (edges) between them, represented as (V, E). There are various types of graphs including finite, infinite, trivial, simple, multigraph, null, complete, weighted, directed, undirected, connected, and disconnected graphs, each defined by specific characteristics. Understanding these types is essential for utilizing graphs effectively in data structures.

Uploaded by

sahilnagaland
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Graphs

A graph data structure consists of nodes (vertices) and connections (edges) between them, represented as (V, E). There are various types of graphs including finite, infinite, trivial, simple, multigraph, null, complete, weighted, directed, undirected, connected, and disconnected graphs, each defined by specific characteristics. Understanding these types is essential for utilizing graphs effectively in data structures.

Uploaded by

sahilnagaland
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

INTRODUCTION TO 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).

It is represented as (V, E) that represents

● A collection of vertices V
● A collection of edges E, represented as ordered pairs of vertices (u,v

Types of Graphs in Data Structures

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.

7. COMPLETE GRAPH: If a graph G= (V, E) is also a simple graph, it is complete. Using


the edges, with n number of vertices must be connected. It's also known as a full graph
because each vertex's degree must be n-1.

8. WEIGHTED GRAPH: A graph G= (V, E) is called a labeled or weighted graph because


each edge has a value or weight representing the cost of traversing that edge.

9. DIRECTED GRAPH: A directed graph also referred to as a digraph, is a set of nodes


connected by edges, each with a direction.
10. UNDIRECTED GRAPH: An undirected graph comprises a set of nodes and links
connecting them. The order of the two connected vertices is irrelevant and has no
direction. You can form an undirected graph with a finite number of vertices and edges.

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.

You might also like