雨中的城市广场、树木和卢浮宫建筑
雨天下午的卢浮宫 · Camille Pissarro / National Gallery of Art

A relation may fail to have a desired property because some pairs are missing. A closure repairs this by adding every required pair and no unnecessary ones. Reflexive closure adds missing loops, symmetric closure adds missing reverse edges, and transitive closure adds the shortcuts forced by directed walks.

The operations and powers in Note 1.2 and the matrix and digraph representations in Note 1.4 provide three ways to describe these constructions. Throughout this note, RR is a relation on a specified set AA, and IA={(a,a):a∈A}I_A=\{(a,a):a\in A\} is its identity relation.

1. Closures and Minimality

For a property PP, a PP-closure of RR, when it exists, is a relation C⊆A×AC\subseteq A\times A satisfying all three conditions:

  1. Containment: R⊆CR\subseteq C.
  2. The required property: CC has property PP.
  3. Leastness under inclusion: whenever R⊆S⊆A×AR\subseteq S\subseteq A\times A and SS has property PP, we have C⊆SC\subseteq S.

The third condition means that every pair added to RR is forced: it must occur in every possible relation with the first two conditions. Finding just one larger relation with property PP does not establish that it is the closure.

If two relations CC and DD both satisfy these conditions, leastness gives C⊆DC\subseteq D and D⊆CD\subseteq C, so C=DC=D. A closure is therefore unique whenever it exists.

The underlying set matters. The reflexive closure of the empty relation on {a}\{a\} is {(a,a)}\{(a,a)\}, while on {a,b}\{a,b\} it is {(a,a),(b,b)}\{(a,a),(b,b)\}, even though the original set of pairs is the same.

Not every property permits a closure for every input. For example, if (a,a)∈R(a,a)\in R, no irreflexive relation can contain RR: adding pairs cannot remove that loop. The three closure constructions below, however, exist for every relation on AA.

2. Reflexive and Symmetric Closures

Constructions and Their Proofs

The reflexive closure is

r(R)=R∪IA.\boxed{r(R)=R\cup I_A}.

It contains RR and every pair (a,a)(a,a), so it is reflexive. Any reflexive relation SS containing RR must also contain IAI_A, hence must contain R∪IAR\cup I_A. This proves leastness. Existing loops remain unchanged; only missing loops are added.

The symmetric closure is

s(R)=R∪R−1.\boxed{s(R)=R\cup R^{-1}}.

It contains RR. If (a,b)(a,b) belongs to either RR or R−1R^{-1}, its reverse belongs to the other, so the union is symmetric. If a symmetric relation SS contains RR, it must contain the reverse of every pair of RR, and therefore R−1⊆SR^{-1}\subseteq S. Thus R∪R−1⊆SR\cup R^{-1}\subseteq S, proving leastness.

With a fixed ordering of the finite set AA, these constructions have equivalent matrix and graph forms:

ClosureZero-one matrixDigraph construction
ReflexiveMr(R)=MR∨InM_{r(R)}=M_R\lor I_nAdd a loop at every vertex lacking one
SymmetricMs(R)=MR∨MRTM_{s(R)}=M_R\lor M_R^{\mathsf T}Add a reverse edge wherever it is missing

Here n=∣A∣n=|A|, InI_n is the identity matrix, and ∨\lor is entrywise OR. Symmetric closure does not automatically add loops: reversing an edge between distinct vertices does not create one.

Example: Two different repairs of the same relation. Let A={a,b,c,d}A=\{a,b,c,d\} and R={(a,a),(a,b),(c,b)}R=\{(a,a),(a,b),(c,b)\}. Find its reflexive and symmetric closures, and determine how the isolated vertex dd changes in each construction.

Show solution and steps

The loop at aa is already present; the loops at b,c,db,c,d are missing. Therefore

r(R)={(a,a),(a,b),(c,b),(b,b),(c,c),(d,d)}.r(R)=\{(a,a),(a,b),(c,b),(b,b),(c,c),(d,d)\}.

The missing reverses are (b,a)(b,a) and (b,c)(b,c), giving

s(R)={(a,a),(a,b),(c,b),(b,a),(b,c)}.s(R)=\{(a,a),(a,b),(c,b),(b,a),(b,c)\}.

Vertex dd receives a loop in the reflexive closure. It remains isolated in the symmetric closure because no original edge has dd as an endpoint. In both cases it remains part of the underlying set.

Original diagrams of R with a loop at a and edges a to b and c to b, its reflexive closure below, and its symmetric closure on the right

Figure 1. The original relation is at upper left, its reflexive closure below, and its symmetric closure at upper right. Vertex d receives a loop only in the reflexive closure.

3. Transitive Closure and Reachability

From Walks to Forced Pairs

A directed walk of length mm from aa to bb is a sequence

a=x0,x1,…,xm=ba=x_0,x_1,\ldots,x_m=b

such that (xi−1,xi)∈R(x_{i-1},x_i)\in R for every 1≤i≤m1\le i\le m. Vertices and edges may repeat. Its length counts edges, not vertices. A length-zero walk stays at its starting vertex and uses no edge.

For each positive integer mm,

(a,b)∈Rm⟺there is a directed walk of exactly m edges from a to b.(a,b)\in R^m \quad\Longleftrightarrow\quad \text{there is a directed walk of exactly $m$ edges from $a$ to $b$}.

For m=1m=1, this is the definition of an edge. Inductively, membership in Rm+1=Rm∘RR^{m+1}=R^m\circ R means that an initial edge can be followed by an mm-edge walk. Conversely, splitting a walk after its first edge gives the intermediate element required for this composition.

The relation of positive-length reachability is

R+=⋃m≥1Rm.\boxed{R^+=\bigcup_{m\ge1}R^m}.

It is the transitive closure, also denoted t(R)t(R). The three closure conditions explain why:

  • It contains RR because the union includes R1R^1.
  • If aa reaches bb and bb reaches cc by positive-length walks, concatenating those walks gives a positive-length walk from aa to cc. Hence R+R^+ is transitive.
  • Any transitive relation containing RR must contain the endpoints of every finite positive-length walk in RR. It therefore contains every RmR^m and their union. This proves leastness.

Adding only the shortcuts from the original two-edge walks may leave longer connections unresolved. The closure must account for walks of every positive length, including those that create new two-edge connections after earlier additions.

Positive Length and Zero Length

This series uses the following distinct notations:

R+=⋃m≥1Rm,R∗=⋃m≥0Rm=IA∪R+,R0=IA.R^+=\bigcup_{m\ge1}R^m, \qquad R^*=\bigcup_{m\ge0}R^m=I_A\cup R^+, \qquad R^0=I_A.

R∗R^* is the reflexive transitive closure. It includes the length-zero walk at every vertex. In contrast, (a,a)∈R+(a,a)\in R^+ only if there is a positive-length closed walk from aa back to itself. A transitive closure can therefore add some loops without being reflexive on the whole set.

For example, the transitive closure of R={(a,b)}R=\{(a,b)\} on A={a,b}A=\{a,b\} is RR itself. There is no positive-length return walk at either vertex, so neither loop belongs to R+R^+. Both loops belong to R∗R^*.

A Relation with a Return Walk and an Outgoing Chain

Example: Powers and transitive closure. On A={1,2,3,4}A=\{1,2,3,4\}, let

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

Find R2R^2, R3R^3, and R+R^+. Give the matrix of R+R^+ in the order 1,2,3,41,2,3,4, and explain which loops the closure contains.

Show solution and steps

List the endpoints of walks of the indicated length:

R2={(1,1),(1,3),(2,2),(2,4)},R3={(1,2),(1,4),(2,1),(2,3)}.\begin{aligned} R^2&=\{(1,1),(1,3),(2,2),(2,4)\},\\ R^3&=\{(1,2),(1,4),(2,1),(2,3)\}. \end{aligned}

From either 1 or 2, all four vertices can be reached. From 3, only 4 can be reached by a positive-length walk. Vertex 4 has no outgoing edge. Consequently,

R+={(1,1),(1,2),(1,3),(1,4),(2,1),(2,2),(2,3),(2,4),(3,4)},\begin{aligned} R^+=\{&(1,1),(1,2),(1,3),(1,4),\\ &(2,1),(2,2),(2,3),(2,4),(3,4)\}, \end{aligned}

and

MR+=[1111111100010000].M_{R^+}=\begin{bmatrix} 1&1&1&1\\ 1&1&1&1\\ 0&0&0&1\\ 0&0&0&0 \end{bmatrix}.

The walks 1→2→11\to2\to1 and 2→1→22\to1\to2 force the loops at 1 and 2. There is no positive-length return walk at 3 or 4. Thus R+R^+ is transitive but is not reflexive on AA.

Original diagrams of R in blue, its even powers from the second power onward in green, and its odd powers from the third power onward in red

Figure 2. The three panels show R, its positive even powers, and its odd powers from the third onward. Their union gives the transitive closure whose matrix is displayed above.

The powers do not eventually become constant: R4=R2R^4=R^2 and R5=R3R^5=R^3, and this alternation continues. A power records an exact walk length, whereas the closure collects all positive lengths. In this example, R∪R2∪R3R\cup R^2\cup R^3 already gives the full closure.

4. Finite Computation and Closure Properties

Why the First n Powers Are Enough

Let AA be finite and nonempty with ∣A∣=n|A|=n. If a positive-length walk from aa to bb exists, choose one with the smallest positive length.

If a≠ba\ne b, this shortest walk cannot repeat a vertex. A repeated vertex would enclose a closed portion that could be deleted, leaving a shorter walk with the same distinct endpoints. It therefore uses at most nn vertices and n−1n-1 edges.

If a=ba=b, a shortest positive return walk has no repeated vertex other than its first and last vertex. An internal repetition could again be deleted, and an earlier return to aa would itself be a shorter positive return walk. Such a walk has at most nn edges.

Combining the two cases gives

R+=R∪R2∪⋯∪Rn.\boxed{R^+=R\cup R^2\cup\cdots\cup R^n}.

For its matrix, with Boolean powers as in Note 1.4,

MR+=MR∨MR[2]∨⋯∨MR[n].M_{R^+}=M_R\lor M_R^{[2]}\lor\cdots\lor M_R^{[n]}.

The bound must include nn, even though distinct endpoints require at most n−1n-1 edges. In the directed cycle 1→2→3→11\to2\to3\to1, the first positive return to 1 has length 3. Truncating at n−1=2n-1=2 would miss (1,1)(1,1) and the other two loops.

This result bounds the powers needed in the union; it does not say that RnR^n equals the closure or that later powers stop changing. If A=∅A=\varnothing, its only relation and all three closures are empty.

Properties Shared by the Three Constructions

For C=r,s,C=r,s, or tt, the following laws hold on the same underlying set:

LawStatementReason
ExtensivenessR⊆C(R)R\subseteq C(R)A closure contains its input
Fixed-point criterionC(R)=RC(R)=R iff RR already has the required propertyRR itself is then the least suitable superrelation
MonotonicityR⊆S  ⟹  C(R)⊆C(S)R\subseteq S\implies C(R)\subseteq C(S)C(S)C(S) has the property and contains RR, so leastness applies
IdempotenceC(C(R))=C(R)C(C(R))=C(R)The first closure already has the required property

The fixed-point criterion gives quick tests: r(R)=Rr(R)=R precisely when RR is reflexive, s(R)=Rs(R)=R precisely when it is symmetric, and t(R)=Rt(R)=R precisely when it is transitive. Idempotence concerns applying the same closure twice; it does not say that different closure operations are interchangeable.

5. Worked Practice and Self-Check

Computing All Three Closures

Exercise. On A={1,2,3,4}A=\{1,2,3,4\}, let

Q={(1,1),(1,4),(2,3),(3,1),(3,3),(4,4)}.Q=\{(1,1),(1,4),(2,3),(3,1),(3,3),(4,4)\}.

Find r(Q)r(Q), s(Q)s(Q), and t(Q)t(Q). For each, list the pairs added to QQ, then give the complete resulting relation.

Show solution and steps

Reflexive closure. Only the loop at 2 is missing:

r(Q)=Q∪{(2,2)}={(1,1),(1,4),(2,2),(2,3),(3,1),(3,3),(4,4)}.r(Q)=Q\cup\{(2,2)\} =\{(1,1),(1,4),(2,2),(2,3),(3,1),(3,3),(4,4)\}.

Symmetric closure. Reverse each pair of QQ. Existing loops are their own reverses; the missing reverses are (1,3),(3,2),(4,1)(1,3),(3,2),(4,1). Thus

s(Q)={(1,1),(1,3),(1,4),(2,3),(3,1),(3,2),(3,3),(4,1),(4,4)}.\begin{aligned} s(Q)=\{&(1,1),(1,3),(1,4),(2,3),\\ &(3,1),(3,2),(3,3),(4,1),(4,4)\}. \end{aligned}

Transitive closure. The walk 2→3→12\to3\to1 forces (2,1)(2,1), 3→1→43\to1\to4 forces (3,4)(3,4), and 2→3→1→42\to3\to1\to4 forces (2,4)(2,4). The reachable targets are

StartTargets reachable by positive-length walks
11, 4
21, 3, 4
31, 3, 4
44

No further targets are reachable. Therefore

t(Q)={(1,1),(1,4),(2,1),(2,3),(2,4),(3,1),(3,3),(3,4),(4,4)}.\begin{aligned} t(Q)=\{&(1,1),(1,4),(2,1),(2,3),(2,4),\\ &(3,1),(3,3),(3,4),(4,4)\}. \end{aligned}

The added pairs are exactly {(2,1),(2,4),(3,4)}\{(2,1),(2,4),(3,4)\}. In particular, no loop at 2 is forced: there is no walk returning to 2.

Review Questions

  1. On A={a,b,c,d}A=\{a,b,c,d\}, let R={(a,b),(b,c)}R=\{(a,b),(b,c)\}. Find R+R^+ and R∗R^*. Which pairs distinguish them?
  2. On A={1,2}A=\{1,2\}, let R={(1,2),(2,1)}R=\{(1,2),(2,1)\}. Is its symmetric closure transitive? Find its transitive closure and explain why it adds loops.
  3. Suppose R⊆S⊆A2R\subseteq S\subseteq A^2 and SS is transitive. Prove t(R)⊆St(R)\subseteq S. Must equality hold? Give a counterexample if not.
Show self-check answers
  1. Only (a,c)(a,c) is newly reachable, so R+={(a,b),(b,c),(a,c)}R^+=\{(a,b),(b,c),(a,c)\}. Then R∗=R+∪{(a,a),(b,b),(c,c),(d,d)}R^*=R^+\cup\{(a,a),(b,b),(c,c),(d,d)\}. None of these four loops belongs to R+R^+ because the original graph has no positive-length closed walk.
  2. RR is already symmetric, so s(R)=Rs(R)=R. It is not transitive: (1,2)(1,2) and (2,1)(2,1) force (1,1)(1,1), which is absent. Its transitive closure is A2={(1,1),(1,2),(2,1),(2,2)}A^2=\{(1,1),(1,2),(2,1),(2,2)\}. Both loops are endpoints of two-edge return walks.
  3. This is the leastness condition for the transitive closure: every pair in t(R)t(R) is forced in every transitive superrelation of RR. Equality is not required. On A={1,2}A=\{1,2\}, take R=∅R=\varnothing and S=IAS=I_A. Then t(R)=∅t(R)=\varnothing but S≠∅S\ne\varnothing.

For a systematic matrix computation of the same reachability relation, continue to Note 1.6: Computing Transitive Closures with the Warshall Algorithm.

Glossary and Sources

TermMain idea
ClosureThe least relation containing the input and satisfying a specified property
Reflexive closureAdd every missing pair (a,a)(a,a)
Symmetric closureAdd the reverse of every pair
Transitive closure R+R^+Record all positive-length reachability
Reflexive transitive closure R∗R^*Include zero-length reachability as well
IdempotenceApplying the same closure again leaves the result unchanged
  • Course slides.
  • Figures 1 and 2 are cropped from course slides, with their original diagram labels retained. The review questions and their explanations are constructed from the definitions.
  • The notation R+R^+ denotes positive-length reachability throughout this series; R∗R^* includes the identity relation. The distinction is defined in Section 3 above.

Updated:

RelationsClosuresReachability