Solution to Let A={1,2,3,4,5} and R be the relation on A such that R={(1,1),(1,4),(2,2),(3,4),(3,5),(4,1),(5,2),(5,5)}. Find the transitive … - Sikademy
Author Image

Archangel Macsika

Let A={1,2,3,4,5} and R be the relation on A such that R={(1,1),(1,4),(2,2),(3,4),(3,5),(4,1),(5,2),(5,5)}. Find the transitive closure of R by Warshall's Algorithm

The Answer to the Question
is below this banner.

Can't find a solution anywhere?

NEED A FAST ANSWER TO ANY QUESTION OR ASSIGNMENT?

Get the Answers Now!

You will get a detailed answer to your question or assignment in the shortest time possible.

Here's the Solution to this Question

Let A=\{1,2,3,4,5\} and R be the relation on A such that R=\{(1,1),(1,4),(2,2),(3,4),(3,5),(4,1),(5,2),(5,5)\}. Let us find the transitive closure of R by Warshall's Algorithm:


W^{(0)}=M_R=\begin{pmatrix} 1 & 0 & 0 & 1 & 0\\ 0 & 1 & 0 & 0 & 0\\ 0 & 0 & 0 & 1 & 1\\ 1 & 0 & 0 & 0 & 0\\ 0 & 1 & 0 & 0 & 1 \end{pmatrix}



W^{(1)}=\begin{pmatrix} 1 & 0 & 0 & 1 & 0\\ 0 & 1 & 0 & 0 & 0\\ 0 & 0 & 0 & 1 & 1\\ 1 & 0 & 0 & 1 & 0\\ 0 & 1 & 0 & 0 & 1 \end{pmatrix}


W^{(2)}=\begin{pmatrix} 1 & 0 & 0 & 1 & 0\\ 0 & 1 & 0 & 0 & 0\\ 0 & 0 & 0 & 1 & 1\\ 1 & 0 & 0 & 1 & 0\\ 0 & 1 & 0 & 0 & 1 \end{pmatrix}


W^{(3)}=\begin{pmatrix} 1 & 0 & 0 & 1 & 0\\ 0 & 1 & 0 & 0 & 0\\ 0 & 0 & 0 & 1 & 1\\ 1 & 0 & 0 & 1 & 0\\ 0 & 1 & 0 & 0 & 1 \end{pmatrix}


W^{(4)}=\begin{pmatrix} 1 & 0 & 0 & 1 & 0\\ 0 & 1 & 0 & 0 & 0\\ 1 & 0 & 0 & 1 & 1\\ 1 & 0 & 0 & 1 & 0\\ 0 & 1 & 0 & 0 & 1 \end{pmatrix}


M_{R^*}=W^{(5)}=\begin{pmatrix} 1 & 0 & 0 & 1 & 0\\ 0 & 1 & 0 & 0 & 0\\ 1 & 1 & 0 & 1 & 1\\ 1 & 0 & 0 & 1 & 0\\ 0 & 1 & 0 & 0 & 1 \end{pmatrix}


It follows that the transitive closure R^* of R is the following:


R^*=\{(1,1),(1,4),(2,2),(3,1),(3,2),(3,4),(3,5),(4,1),(4,4),(5,2),(5,5)\}.

Related Answers

Was this answer helpful?

Join our Community to stay in the know

Get updates for similar and other helpful Answers

Question ID: mtid-5-stid-8-sqid-1276-qpid-1014