Representation of Relation in Graphs and Matrices
Last Updated :
23 Jul, 2025
Understanding how to represent relations in graphs and matrices is fundamental in engineering mathematics. These representations are not only crucial for theoretical understanding but also have significant practical applications in various fields of engineering, computer science, and data analysis. This article will explore different ways to represent relations using graphs and matrices, their properties, and applications in engineering.
What is a Relation?
A relation is a connection or association between elements of two sets. In mathematical terms, if we have two sets A and B, a relation R from A to B is a subset of the Cartesian product A x B.
Read More: Relations in Maths
Representation of Relation in Graphs
Graphs provide a visual way to represent relations. There are different types of graphs used for this purpose, including directed graphs (digraphs) and undirected graphs. Here's a detailed look at these representations:
Directed Graphs (Digraphs)
A directed graph consists of nodes or vertices connected by directed edges or arcs. Let R is relation from set A to set B defined as (a,b) ? R, then in directed graph-it is represented as edge(an arrow from a to b) between (a,b).
Properties
- A relation R is reflexive if there is a loop at every node of a directed graph.
- A relation R is irreflexive if there is no loop at any node of directed graphs.
- A relation R is symmetric if, for every edge between distinct nodes, an edge is always present in the opposite direction.
- A relation R is asymmetric if there are never two edges in opposite directions between distinct nodes.
- A relation R is transitive if there is an edge from a to b and b to c, then there is always an edge from a to c.
Example:
The directed graph of relation R = {(a,a),(a,b),(b,b),(b,c),(c,c),(c,b),(c,a)} is represented as:

Since, there is loop at every node, it is reflexive but it is neither symmetric nor antisymmetric as there is an edge from a to b but no opposite edge from b to a and also directed edge from b to c in both directions. R is not transitive as there is an edge from a to b and b to c but no edge from a to c.
Undirected Graphs
In an undirected graph, edges have no direction. This type of representation is used when the relation is symmetric, meaning if a is related to b, then b is also related to a.
Example:
If the relation R on set A = {1,2,3} is such that R={(1,2),(2,3)}, the undirected graph will have vertices 1, 2, and 3, with edges between 1 and 2, and 2 and 3.
Types of Relation in Graphs and Matrices
1. Combining Relation:
Suppose R is a relation from set A to B and S is a relation from set B to C, the combination of both the relations is the relation which consists of ordered pairs (a,c) where a ∈ A and c ∈ C and there exist an element b ∈ B for which (a,b) ∈ R and (b,c) ∈ S. This is represented as RoS.
2. Inverse Relation:
A relation R is defined as (a,b) ? R from set A to set B, then the inverse relation is defined as (b,a) ? R from set B to set A. Inverse Relation is represented as R-1
R-1 = {(b,a) | (a,b) ? R}.
3. Complementary Relation:
Let R be a relation from set A to B, then the complementary Relation is defined as {(a,b) } where (a,b) is not. R.
Representation of Relation in Graphs and Matrices
Matrices provide an algebraic way to represent relations. The relation matrix is a two-dimensional array where the rows represent elements of set A and the columns represent elements of set B. If there is a relation between ai ∈ A and bj ∈ B, then the entry mij in the matrix is 1; otherwise, it is 0.
Applications in Engineering
Relations and their representations are widely used in engineering for various purposes:
1. Network Analysis
Graphs and matrices are extensively used in network analysis, including communication networks, transportation networks, and electrical grids. They help in understanding the connectivity and flow of information or resources.
2. Control Systems
In control systems engineering, state transition graphs and matrices represent system states and transitions, aiding in the design and analysis of control strategies.
3. Data Structures and Algorithms
In computer science, graphs and matrices are fundamental in designing algorithms for searching, sorting, and optimization problems.
4. Database Management
Relations form the basis of relational databases, where tables (matrices) are used to store and manage data efficiently.
Practice Problems on Representation of Relation in Graphs and Matrices
Problem 1: Given the set ( A = {1, 2, 3} ) and the relation ( R = {(1, 2), (2, 3), (3, 1)} ), represent this relation graphically and using an adjacency matrix. Determine if the relation is reflexive, symmetric, or transitive.
Problem 2: Given the set A={1,2,3,4,5} and the relation R={(1,2),(2,3),(3,4),(4,5)}, represent this relation using a graph and an adjacency matrix. Check if the relation is reflexive, symmetric, or transitive.
Problem 3: For the set ( C = {a, b, c, d} ), a relation ( T ) is given as ( T = {(a, b), (b, c), (c, d), (d, a)} ). Create the adjacency matrix and check if the relation is transitive.
Problem 4: Define a relation ( U ) on the set ( D = {1, 2, 3, 4} ) by ( U = {(1, 2), (2, 1), (3, 4), (4, 3)} ). Represent the relation graphically and using a matrix. Is the relation symmetric?
Problem 5: For the set C={a,b,c}, a relation T is given as T={(a,b),(b,a),(b,c)}. Create the corresponding graph and adjacency matrix. Verify if the relation is symmetric and transitive.
Problem 6: Given the set ( F = {m, n, o} ) and the relation ( W = {(m, n), (n, o), (o, m), (m, m)} ), represent this relation using both a graph and a matrix. Check if it is reflexive, symmetric, or transitive.
Problem 7: Construct the relation ( X ) on the set ( G = {1, 2, 3} ) that is reflexive, symmetric, and transitive. Represent ( X ) graphically and using an adjacency matrix.
Problem 8: For the set ( H = {a, b, c} ), a relation ( Y ) is defined as ( Y = {(a, a), (b, b), (c, c)} ). Create the corresponding graph and matrix. Determine the properties of this relation.
Problem 9: For the set H={a,b,c,d}, a relation Y is defined as Y={(a,a),(b,b),(c,c),(d,d)}. Create the corresponding graph and matrix. Determine the properties of this relation.
Problem 10: Define a relation ( R_1 ) on the set ( J = {x, y, z} ) by ( R_1 = {(x, y), (y, x), (y, z)} ). Represent this relation using a graph and a matrix. Determine if the relation is symmetric and/or transitive.
Related Articles:
Conclusion
Understanding the representation of relations in graphs and matrices is crucial for various fields of engineering and computer science. These representations provide a clear and structured way to visualize and analyze connections between elements, aiding in the development of efficient solutions to complex problems.
Similar Reads
Engineering Mathematics Tutorials Engineering mathematics is a vital component of the engineering discipline, offering the analytical tools and techniques necessary for solving complex problems across various fields. Whether you're designing a bridge, optimizing a manufacturing process, or developing algorithms for computer systems,
3 min read
Linear Algebra
MatricesMatrices are key concepts in mathematics, widely used in solving equations and problems in fields like physics and computer science. A matrix is simply a grid of numbers, and a determinant is a value calculated from a square matrix.Example: \begin{bmatrix} 6 & 9 \\ 5 & -4 \\ \end{bmatrix}_{2
3 min read
Row Echelon FormRow Echelon Form (REF) of a matrix simplifies solving systems of linear equations, understanding linear transformations, and working with matrix equations. A matrix is in Row Echelon form if it has the following properties:Zero Rows at the Bottom: If there are any rows that are completely filled wit
4 min read
Eigenvalues and EigenvectorsEigenvalues and eigenvectors are fundamental concepts in linear algebra, used in various applications such as matrix diagonalization, stability analysis and data analysis (e.g., PCA). They are associated with a square matrix and provide insights into its properties.Eigen value and Eigen vectorTable
10 min read
System of Linear EquationsA system of linear equations is a set of two or more linear equations involving the same variables. Each equation represents a straight line or a plane and the solution to the system is the set of values for the variables that satisfy all equations simultaneously.Here is simple example of system of
5 min read
Matrix DiagonalizationMatrix diagonalization is the process of reducing a square matrix into its diagonal form using a similarity transformation. This process is useful because diagonal matrices are easier to work with, especially when raising them to integer powers.Not all matrices are diagonalizable. A matrix is diagon
8 min read
LU DecompositionLU decomposition or factorization of a matrix is the factorization of a given square matrix into two triangular matrices, one upper triangular matrix and one lower triangular matrix, such that the product of these two matrices gives the original matrix. It is a fundamental technique in linear algebr
6 min read
Finding Inverse of a Square Matrix using Cayley Hamilton Theorem in MATLABMatrix is the set of numbers arranged in rows & columns in order to form a Rectangular array. Here, those numbers are called the entries or elements of that matrix. A Rectangular array of (m*n) numbers in the form of 'm' horizontal lines (rows) & 'n' vertical lines (called columns), is calle
4 min read
Sequence & Series
Calculus
Limits, Continuity and DifferentiabilityLimits, Continuity, and Differentiation are fundamental concepts in calculus. They are essential for analyzing and understanding function behavior and are crucial for solving real-world problems in physics, engineering, and economics.Table of ContentLimitsKey Characteristics of LimitsExample of Limi
10 min read
Cauchy's Mean Value TheoremCauchy's Mean Value theorem provides a relation between the change of two functions over a fixed interval with their derivative. It is a special case of Lagrange Mean Value Theorem. Cauchy's Mean Value theorem is also called the Extended Mean Value Theorem or the Second Mean Value Theorem.According
7 min read
Taylor SeriesA Taylor series represents a function as an infinite sum of terms, calculated from the values of its derivatives at a single point.Taylor series is a powerful mathematical tool used to approximate complex functions with an infinite sum of terms derived from the function's derivatives at a single poi
8 min read
Inverse functions and composition of functionsInverse Functions - In mathematics a function, a, is said to be an inverse of another, b, if given the output of b a returns the input value given to b. Additionally, this must hold true for every element in the domain co-domain(range) of b. In other words, assuming x and y are constants, if b(x) =
3 min read
Definite Integral | Definition, Formula & How to CalculateA definite integral is an integral that calculates a fixed value for the area under a curve between two specified limits. The resulting value represents the sum of all infinitesimal quantities within these boundaries. i.e. if we integrate any function within a fixed interval it is called a Definite
8 min read
Application of Derivative - Maxima and MinimaDerivatives have many applications, like finding rate of change, approximation, maxima/minima and tangent. In this section, we focus on their use in finding maxima and minima.Note: If f(x) is a continuous function, then for every continuous function on a closed interval has a maximum and a minimum v
6 min read
Probability & Statistics
Mean, Variance and Standard DeviationMean, Variance and Standard Deviation are fundamental concepts in statistics and engineering mathematics, essential for analyzing and interpreting data. These measures provide insights into data's central tendency, dispersion, and spread, which are crucial for making informed decisions in various en
10 min read
Conditional ProbabilityConditional probability defines the probability of an event occurring based on a given condition or prior knowledge of another event. It is the likelihood of an event occurring, given that another event has already occurred. In probability, this is denoted as A given B, expressed as P(A | B), indica
12 min read
Bayes' TheoremBayes' Theorem is a mathematical formula used to determine the conditional probability of an event based on prior knowledge and new evidence. It adjusts probabilities when new information comes in and helps make better decisions in uncertain situations.Bayes' Theorem helps us update probabilities ba
13 min read
Probability Distribution - Function, Formula, TableA probability distribution is a mathematical function or rule that describes how the probabilities of different outcomes are assigned to the possible values of a random variable. It provides a way of modeling the likelihood of each outcome in a random experiment.While a Frequency Distribution shows
13 min read
Covariance and CorrelationCovariance and correlation are the two key concepts in Statistics that help us analyze the relationship between two variables. Covariance measures how two variables change together, indicating whether they move in the same or opposite directions. Relationship between Independent and dependent variab
6 min read
Practice Questions