Representing Relations Table and Graph
In this class, We discuss the Representing Relations Table and Graph.
The reader should have prior knowledge of Introduction to Relations. Click here.
Relation matrix:
A = {1, 2, 3, 4}
B = {b1, b2, b3}
R = {(1, b2), (1, b3), (3, b2), (4, b3)}
The below diagram shows the matrix representation of relations.
We place 1 when a relation is present—otherwise 0.
Example 2:
A = {1, 2, 3, 4}
R = {(1, 1), (2, 3), (3, 1), (4, 4)}
The diagram below shows the matrix representation.
Representing relations using a graph.
aRb or (a,b)
The diagram below shows the graph for aRb.
aRa, aRb ∩ bRa, aRb ∩ bRc ∩ cRa
The diagrams below show the relations.
Example:
A = {5, 6, 7, 8}
R = {(8, 5), (8, 6), (8, 7), (7, 5), (7, 6), (6, 5)}
The below diagram shows the graph.