Closure of Relations
Closure of Relations: Reflexive, Symmetric, and Transitive Closures
Sometimes a relation R on a set A is missing a property we want it to have. The closure of R with respect to a property P is the smallest relation S such that R⊆S and S has property P. 'Smallest' means we add only the pairs the property forces, never more, and we never remove a pair of R.
Directed graph of the relation R={(1,2),(2,3),(3,1),(3,4)} on A={1,2,3,4}, used to build its closures.
Reflexive Closure
To make R reflexive we must guarantee (a,a) for every a∈A:
Symmetric Closure
To make R symmetric we must include the reverse of every pair:
Transitive Closure
Transitivity says: if (a,b) and (b,c) are in R, then (a,c) must be too. This can cascade through chains, so:
where Rn is the set of pairs joined by a path of exactly n arrows. Equivalently, (x,y)∈t(R) exactly when there is a directed path of length ≥1 from x to y in the digraph of R.
On a finite set with |A|=m, the union through R^m suffices: for x≠y, any reachable pair has a simple-path witness of length at most m−1, while a positive-length return path from x to itself has a simple-cycle witness of length at most m.
Reflexive and Symmetric Are One Pass; Transitive Is Not
Adding the diagonal cannot create a new missing diagonal pair, and adding (b,a) cannot create a new missing reverse, so r and s each finish in a single sweep. Transitivity is different: a pair you add can immediately combine with an existing pair to force another.
Warshall's algorithm is the systematic way to run that cascade to completion, sweeping once per element of A and asking, for each k, whether a path can now be routed through k.
Worked Example
Let A={1,2,3} and R={(1,2),(2,3)}.
- r(R)={(1,2),(2,3),(1,1),(2,2),(3,3)}, three pairs added.
- s(R)={(1,2),(2,3),(2,1),(3,2)}, two pairs added.
- t(R)={(1,2),(2,3),(1,3)}, one pair added, because 1→2→3.
For the same relation R={(1,2),(2,3),(3,1),(3,4)} on A={1,2,3,4} shown in the figure, how many new ordered pairs are added when forming the reflexive closure r(R)?
Give your answer in pairs.
Directed graph of the relation R={(1,2),(2,3),(3,1),(3,4)} on A={1,2,3,4}, used to build its closures.
Let A={a,b,c,d} and R={(a,b),(b,c),(c,d)}. What is the transitive closure t(R)?