- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# Representation of Relations using Graph

A relation can be represented using a directed graph.

The number of vertices in the graph is equal to the number of elements in the set from which the relation has been defined. For each ordered pair (x, y) in the relation R, there will be a directed edge from the vertex ‘x’ to vertex ‘y’. If there is an ordered pair (x, x), there will be a self- loop on vertex ‘x’.

Suppose, there is a relation R = { (1, 1), (1,2), (3, 2) } on set S = { 1, 2, 3 }, it can be represented by the following graph −

- Related Questions & Answers
- Types of Relations
- Weighted Graph Representation in Data Structure
- Relations of a Set
- Find the Number of Reflexive Relations on a Set using C++
- Representation of fractions
- Representation of Graphs
- Practice Set for Recurrence Relations
- Matrix Representation of Graphs
- Explain the unary operations of algebra relations in DBMS?
- Array Representation Of Binary Heap
- Explain Set relations and operations in TOC?
- What are Precedence Relations in Operator Grammar?
- Complement of Graph
- Connectivity of Graph
- Types of Graph

Advertisements