0% found this document useful (0 votes)
8 views6 pages

Data Structure: Graph: Basic Terminologies and Representations Graph:-Graph

A graph is a data structure consisting of vertices and edges that represent connected data, such as social media networks or Google Maps. Key terminologies include vertices (nodes), edges (connections), weights (data associated with edges), and paths (routes between vertices). Various types of graphs include weighted, unweighted, directed, undirected, connected, disconnected, multi graphs, dense graphs, and sparse graphs.

Uploaded by

rofad62335
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)
8 views6 pages

Data Structure: Graph: Basic Terminologies and Representations Graph:-Graph

A graph is a data structure consisting of vertices and edges that represent connected data, such as social media networks or Google Maps. Key terminologies include vertices (nodes), edges (connections), weights (data associated with edges), and paths (routes between vertices). Various types of graphs include weighted, unweighted, directed, undirected, connected, disconnected, multi graphs, dense graphs, and sparse graphs.

Uploaded by

rofad62335
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/ 6

Graph: Basic Terminologies and Representations

Graph:-
A graph is a data structure that stores connected data. In other words, a graph G (or g) is defined
as a set of vertices (V) and edges (E) that connects vertices. The examples of graph are a social media
network, computer network, Google Maps, etc.
Each graph consists of edges and vertices (also called nodes). Each vertex and edge have a
relation. Where vertex represents the data and edge represents the relation between them. Vertex
is denoted by a circle with a label on them. Edges are denoted by a line that connects nodes
(vertices).

Graph Terminology
Vertex: Vertices are the point that joints edges. It represents the data. It is also known as a node.
It is denoted by a circle and it must be labeled. To construct a graph there must be at least a node.
For example, house, bus stop, etc.
Edge: An edge is a line that connects two vertices. It represents the relation between the vertices.
Edges are denoted by a line. For example, a path to the bus stop from your house.
Weight: It is labeled to edge. For example, the distance between two cities is 100 km, then the
distance is called weight for the edge.
Path: The path is a way to reach a destination from the initial point in a sequence.

Types of Graph

• Weighted Graph: In a weighted graph, each edge contains some data (weight)
such as distance, weight, height, etc. It denoted as w(e). It is used to calculate the
cost of traversing from one vertex to another. The following figure represents a
weighted graph.
• Unweighted Graph: A graph in which edges are not associated with any value is
called an unweighted graph. The following figure represents an unweighted graph.

• Directed Graph: A graph in which edges represent direction is called a directed


graph. In a directed graph, we use arrows instead of lines (edges). Direction denotes
the way to reach from one node to another node. Note that in a directed graph, we
can move either in one direction or in both directions. The following figure represents
a directed graph.
• Undirected Graph: A graph in which edges are bidirectional is called an undirected
graph. In an undirected graph, we can traverse in any direction. Note that we can use
the same path for return through which we have traversed. While in the directed
graph we cannot return from the same path.

• Connected Graph: A graph is said to be connected if there exists at least one path
between every pair of vertices. Note that a graph with only a vertex is a connected
graph.
There are two types of connected graphs.
• Weekly Connected Graph: A graph in which nodes cannot be visited by a single path
is called a weekly connected graph.

• Strongly Connected Graph: A graph in which nodes can be visited by a single


path is called a strongly connected graph.
• Disconnected Graph: A graph is said to be disconnected if there is no path between
a pair of vertices is called a disconnected graph. A disconnected graph may consist of
two or more connected graphs.

• Multi Graph: A graph that has multiple edges connecting the same pair of nodes.
The following figure represents a multi-graph.
• Dense Graph: A graph in which the number of edges is close to the maximal number
of edges, the graph is called the dense graph. The following figure represents a dense
graph.

• Sparse Graph: A graph in which the number of edges is close to the minimal number
of edges, the graph is called the sparse graph. It can be a disconnected graph. The
following figure represents a sparse graph.

You might also like