Warshall's algorithm in transitive closure

728 Views Asked by At

Let $A=\{0,1,2,3\}$ and let $R$ and $S$ be the relations on $A$ described by the matrices

$M_R= \begin{bmatrix} 0 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix}$

$M_S= \begin{bmatrix} 1 & 1 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 1 \\ \end{bmatrix}$

Question 1

Compare $M_{R^{-1}}$, $M_{R \cap S}$, $M_{R \circ S}$.

Question 2

Use Warshall's algorithm to compute the transitive closure of $R \cup S$.

Can anyone help me step by step how to deal with these matrices? Especially Warshall's algorithm, I really don't understand even though studying my lecture notes.