Answer to Question #280882 in Discrete Mathematics for Ashwini

Question #280882

Consider a relation R= {(1, 1) (1, 3), (2, 2), (2,3) (3,123 on the set A = {1,2,37 Find transitive using warshalls algorithm... closure of the relation R consider

1
Expert's answer
2021-12-21T12:38:05-0500

the transitive closure of a binary relation R on a set X is the smallest relation on X that contains R and is transitive


 steps of Warshall’s Algorithm:

Step 1: Execute W:=MR,k:=0W:=M_R, k:=0

Step 2: Execute k:=k+1k:=k+1

Step 3: For all iki\ne k such that wik=1w_{ik}=1, and for all jj execute the operation wij:=wijwkjw_{ij}:=w_{ij}\lor w_{kj}

Step 4: If k=nk=n, then stop: the solution is W=MRW=M_{R^*}, else go to step 2.


in our case:

MR=(101011100)M_R=\begin{pmatrix} 1 &0&1 \\ 0 & 1&1\\ 1&0&0 \end{pmatrix}


k = 1:

w31=1w_{31}=1


W1=(101011101)W_1=\begin{pmatrix} 1 &0&1 \\ 0 & 1&1\\ 1&0&1 \end{pmatrix}


k =3:

w13=1w_{13}=1


W2=(101011101)W_2=\begin{pmatrix} 1 &0&1 \\ 0 & 1&1\\ 1&0&1 \end{pmatrix}


w23=1w_{23}=1


W3=(101111101)W_3=\begin{pmatrix} 1 &0&1 \\ 1 & 1&1\\ 1&0&1 \end{pmatrix}


transitive closure:

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


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment