In set theory, composition is an operation on relations.
Let R be a relation between X and Y and S a relation S between Y and Z. The composite relation R.S between X and Z is defined by
If we equate a relation with its graph, then we may write
Function composition may be regarded as relation composition on functional relations.