Macaulay2 » Documentation
Packages » Posets :: transitiveClosure
next | previous | forward | backward | up | index | toc

transitiveClosure -- computes the transitive closure of a set of relations

Synopsis

Description

This method uses the descendants method from the Graphs package to compute the RelationMatrix from the relations $R$.

i1 : G = {1,2,3,4,5};
i2 : R = {{1,2}, {1,3}, {2,4}, {3,4}, {4,5}};
i3 : transitiveClosure(G, R)

o3 = | 1 1 1 1 1 |
     | 0 1 0 1 1 |
     | 0 0 1 1 1 |
     | 0 0 0 1 1 |
     | 0 0 0 0 1 |

              5       5
o3 : Matrix ZZ  <-- ZZ

See also

Ways to use transitiveClosure :

For the programmer

The object transitiveClosure is a method function.