Graph
Graph
๐ Introduction to Graph๐
A graph is a non-linear data structure used to represent relationships between different objects. It consists of a set of vertices (nodes) and a set of edges that connect pairs of vertices. Graphs are widely used in computer science to model real-world problems such as computer networks, social networks, transportation systems, and web page links.
Formally, a graph G is defined as G = (V, E), where:
-
V is a finite set of vertices (nodes)
-
E is a set of edges that connect the vertices
Definition of Graph ๐
A graph is a non-linear data structure that consists of a finite set of vertices (nodes) and a set of edges that connect pairs of vertices.
Formally, a graph is defined as:
G = (V, E)
where:-
V is a set of vertices (nodes)
Simple Definition of Graph๐
A graph is a collection of vertices (nodes) and edges that connect the vertices.
- E is a set of edges connecting the vertices
๐Types of Graph ๐
Graphs can be classified into different types based on their structure and properties:
-
Undirected Graph
A graph in which edges have no direction. The connection between vertices is bidirectional.
Example: Friendship network.
-
Directed Graph (Digraph)
A graph in which edges have a direction, represented by arrows.
Example: One-way roads, web page links.
-
Weighted Graph
A graph in which each edge is assigned a weight or cost.
Example: Distance between cities.
-
Unweighted Graph
A graph in which edges do not have weights; all edges are treated equally.
-
Simple Graph
A graph with no self-loops and no multiple edges between the same pair of vertices.
-
Multigraph
A graph that allows multiple edges between the same pair of vertices. -
Complete Graph
A graph in which every vertex is connected to every other vertex.
-
Connected Graph
A graph in which there is a path between every pair of vertices.
-
Disconnected Graph
A graph in which at least one vertex is not connected to others.
-
๐ Types of Graph (Short ):-๐
-
Undirected Graph – Edges have no direction.
-
Directed Graph – Edges have direction.
-
Weighted Graph – Edges have weights or costs.
-
Unweighted Graph – Edges have no weights.
-
Simple Graph – No loops or multiple edges.
-
Complete Graph – Every vertex is connected to all others.
-
Connected Graph – Path exists between every pair of vertices.
-
Disconnected Graph – Some vertices are not connected.
-
Cyclic Graph – Contains at least one cycle.
Comments
Post a Comment