The transitive closure of a relation is the smallest transitive relation that includes the original. It's formed by adding minimal…