![]() |
Graph theory is a branch of mathematics that studies the properties and applications of graphs. A graph is a collection of vertices (also called nodes) connected by edges (also called links). Graphs are used to model pairwise relations between objects, making them a powerful tool for representing and analyzing complex systems in various fields. In this article, we will discuss all the fundamentals of graph theory, from its definition to its types, and various ways to represent graphs as well. Table of Content What is a Graph?A graph is a mathematical structure used to model pairwise relations between objects. It consists of two primary components: vertices (also called nodes) and edges (also called links). Definition of Graph
For example, G = (V, E) is a graph such that,
This graph can be represented as follows: Examples in Real LifeSome common real life examples of graphs are:
Basic Concepts in Graph TheorySome of the basic concepts in graph theory are:
Let’s discuss these concepts in detail as follows: Vertex or NodesA vertex is a point where lines meet in a graph and is denoted by an alphabet. It can also be called a node or a junction. In graph theory, a vertex is one of the points that the graph is defined on and can be connected by edges. It is often represented by alphabets, numbers, or alphanumeric values. Edge or LinksIn mathematics, a line that joins two vertices to form a link in a graph is called an edge. It can have more than one edge from a single vertex, but it must have a beginning and an ending vertex in order to exist. An edge can be directed (having a defined path) or undirected (having no direction), often referred to as a line, branch, link, or arc. It is analogous to having an undirected edge link two vertices when there are two directed edges between them. Therefore, in mathematical contexts, edges are essential for joining vertices and creating connections. Multiple EdgesIn graph theory, multiple edges (also known as parallel edges) refer to two or more edges that connect the same pair of vertices. Graphs that allow multiple edges between pairs of vertices are known as multigraphs. LoopA loop is a special type of graph where both endpoints of an edge are the same vertices or when an edge starts from itself and end on itself too, it is called a loop. Types of GraphsThere are various types of graphs in graph theory, some of these are:
Let’s discuss these types in detail as follows: Null Graph
In other words, a null graph has vertices but no edges connecting any pairs of vertices. Consider a null graph with three vertices:
Trivial Graph
Consider a trivial graph with one vertices:
Simple Graph
This means that a simple graph does not contain any loops (edges that connect a vertex to itself) or multiple edges between the same pair of vertices. Consider a simple graph with four vertices:
Undirected Graph
This means that the relationship between any pair of connected vertices is mutual. In an undirected graph, the edge (u, v) is identical to the edge (v, u). Consider an undirected graph with four vertices:
Directed Graph
In other words, each edge has a starting vertex (source) and an ending vertex (destination), indicating a one-way relationship between the vertices. Consider a directed graph with four vertices:
Weighted Graphs
These weights can represent various quantities such as distances, costs, capacities, or any other metric that quantifies the relationship between vertices. Consider a weighted graph with four vertices
Complete GraphIf every vertex in a graph G is linked to every other vertex in the graph, then the graph is said to be complete. Therefore, every graph G has to be linked. Kn represents the whole graph with n vertices. Consider a complete graph with four vertices:
Bipartite Graphs
This means that every edge in a bipartite graph connects a vertex in one set to a vertex in the other set. Consider a bipartite graph with vertex sets:
Cycle Graph
In a cycle graph, each vertex has exactly two neighbors, creating a closed loop. Consider a cycle graph C4 with four vertices:
Some other Important GraphsSome other important graphs includes:
Tree
In other words, a tree is a connected graph with no cycles. Trees are fundamental structures in graph theory and have numerous applications in computer science, biology, and other fields. Consider a tree with five vertices:
Eulerian Graph
If this trail is a circuit (i.e., it starts and ends at the same vertex), it is called an Eulerian circuit.Eulerian graphs are named after the Swiss mathematician Leonhard Euler, who introduced this concept while solving the famous Seven Bridges of Königsberg problem. Consider an undirected graph with vertices:
Hamiltonian Graph
If the graph contains a Hamiltonian path (a path that visits each vertex exactly once but does not necessarily return to the starting vertex), it is called a semi-Hamiltonian graph. Consider a Hamiltonian graph with five vertices:
Representations of GraphsOther then graphical representation, there are some more important representations of graphs such as
Let’s discuss these representation with examples: Adjacency MatrixAn adjacency matrix is a way of representing a graph as a matrix of booleans (0s and 1s) or numbers. The matrix is a 2D array of size n × n, where n is the number of vertices in the graph. Each cell a[i][j] in the matrix indicates whether there is an edge from vertex i to vertex j. In weighted graphs, the cell a[i][j] can contain the weight of the edge instead of a boolean value. Consider an undirected graph with four vertices
The adjacency matrix for this graph is:
Adjacency ListAn adjacency list is a way of representing a graph where each vertex has a list of all the vertices it is connected to. This representation is particularly efficient for sparse graphs where the number of edges is much less than the number of vertices squared. Consider an undirected graph with four vertices
The adjacency list representation for this graph is:
Incidence MatrixAn incidence matrix is a way of representing a graph that shows the relationship between vertices and edges. It is a 2D array of size n × m, where n is the number of vertices and m is the number of edges in the graph. Each cell in the matrix indicates whether a given vertex is incident to a given edge. Consider an undirected graph with four vertices
The incidence matrix for this graph is:
Applications of Graph TheorySome of the common applications of graph theory are:
FAQs on Graph TheoryDefine graph.
How are graphs classified?
What is graph traversal?
How do I find the shortest path in a graph?
What is a minimum spanning tree?
|
Reffered: https://www.geeksforgeeks.org
Mathematics |
Related |
---|
![]() |
![]() |
![]() |
![]() |
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 15 |