next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
Posets :: transitiveClosure

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

Synopsis

Description

This function uses the floydWarshall method from the Graphs package and is used by the poset constructor to compute RelationMatrix from Relations in a Poset.
i1 : I = {a,b,c,d,e}; -- the ground set
i2 : R = {(a,b),(b,c),(a,c),(a,d),(d,e)}; -- relations
i3 : transitiveClosure(I,R)

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

              5        5
o3 : Matrix ZZ  <--- ZZ

Caveat

Output matrix is over RR.

See also

Ways to use transitiveClosure :