In Section 6.1, we studied relations and one important operation on relations, namely composition. This operation enables us to generate new relations from previously known relations. In Section 6.3, we discussed some key properties of relations. We now wish to consider the situation of constructing a new relation from an existing relation where, first, contains and, second, satisfies the transitive property.
Consider a telephone network in which the main office is connected to, and can communicate to, individuals and . Both and can communicate to another person, ; however, the main office cannot communicate with . Assume communication is only one way, as indicated. This situation can be described by the relation . We would like to change the system so that the main office can communicate with person and still maintain the previous system. We, of course, want the most economical system.
Let , and let be a relation on . This relation is called the successor relation on since each element is related to its successor. How do we compute ? By inspection we note that must be in . Letβs analyze why. This is so because and , and the transitive property forces to be in .
In general, it follows that if and then . This condition is exactly the membership requirement for the pair to be in the composition . So every element in must be an element in . So we now know that, contains at least . In particular, for this example, since and , we have
Is the relation transitive? Again, by inspection, is not an element of , but and . Therefore, the composition produces , and it must be an element of since and are required to be in . This shows that . This process must be continued until the resulting relation is transitive. If is finite, as is true in this example, the transitive closure will be obtained in a finite number of steps. For this example,
Subsection6.5.2Algorithms for computing transitive closure
Let be a relation on the set with relation matrix . The matrix of the transitive closure , can be computed by the equation . By using ordinary polynomial evaluation methods, you can compute with matrix multiplications:
Notice how each matrix multiplication doubles the number of terms that have been added to the sum that you currently have computed. In algorithmic form, we can compute as follows.
Often the higher-powered terms in do not contribute anything to . When the condition becomes true in Step 3, this is an indication that no higher-powered terms are needed.
To compute using this algorithm, you need to perform no more than matrix multiplications, where is the least integer that is greater than or equal to . For example, if is a relation on 25 elements, no more than matrix multiplications are needed.
A second algorithm, Warshallβs Algorithm, reduces computation time to the time that it takes to multiply two square matrices with the same order as the relation matrix in question.
Let and . Compute using the matrix representation of . Verify your results by checking against the result obtained directly from the definition of transitive closure.
By the definition of transitive closure, is the smallest relation which contains ; therefore, it is transitive. The transitive closure of , , is the smallest transitive relation that contains . Since is transitive, .
The transitive closure of a symmetric relation is symmetric, but it may not be reflexive. If one element is not related to any elements, then the transitive closure will not relate that element to others.
The definition of the Transitive Closure of refers to the βsmallest transitive relation that contains as a subset.β Show that the intersection of all transitive relations on containing is a transitive relation containing and is precisely .