Definition 6.4.1. Adjacency Matrix.
Let \(A = \{a_1,a_2,\ldots , a_m\}\) and \(B= \{b_1,b_2,\ldots , b_n\}\) be finite sets of cardinality \(m\) and \(n\text{,}\) respectively. Let \(r\) be a relation from \(A\) into \(B\text{.}\) Then \(r\) can be represented by the \(m\times n\) matrix \(R\) defined by
\begin{equation*}
R_{ij}= \left\{
\begin{array}{cc}
1 & \textrm{ if } a_i r b_j \\
0 & \textrm{ otherwise} \\
\end{array}\right.
\end{equation*}
\(R\) is called the adjacency matrix (or the relation matrix) of \(r\text{.}\)