Definition 6.5.1. Transitive Closure.
Let be a set and be a relation on The transitive closure of denoted by is the smallest transitive relation that contains as a subset.
1.0. S = R
2.0 T= S*(I+S)
3.0 While T != S
3.1 S = T
3.2 T= S*(I+S) // using Boolean arithmetic
4.0 Return T
1.0 T = R
2.0 for k = 1 to n:
for i = 1 to n:
for j = 1 to n:
T[i,j]= T[i,j] + T[i,k] * T[k,j]
3.0 Return T