<?xml version="1.0" encoding="utf-8" ?> <!-- for emacs: -*- coding: utf-8 -*- --> <!-- Apache may like this line in the file .htaccess: AddCharset utf-8 .html --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head><title>transitiveClosure -- computes the transitive closure of a given set of relations.</title> <link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/> </head> <body> <table class="buttons"> <tr> <td><div><a href="___Vertices.html">next</a> | <a href="___Relations.html">previous</a> | <a href="___Vertices.html">forward</a> | <a href="___Relations.html">backward</a> | up | <a href="index.html">top</a> | <a href="master.html">index</a> | <a href="toc.html">toc</a> | <a href="http://www.math.uiuc.edu/Macaulay2/">Macaulay2 web site</a></div> </td> </tr> </table> <hr/> <div><h1>transitiveClosure -- computes the transitive closure of a given set of relations.</h1> <div class="single"><h2>Synopsis</h2> <ul><li><div class="list"><dl class="element"><dt class="heading">Usage: </dt><dd class="value"><div><tt>M = transitiveClosure(I,R)</tt></div> </dd></dl> </div> </li> <li><div class="single">Inputs:<ul><li><span><tt>I</tt>, <span>a <a href="../../Macaulay2Doc/html/___List.html">list</a></span>, ground set</span></li> <li><span><tt>R</tt>, <span>a <a href="../../Macaulay2Doc/html/___List.html">list</a></span>, of pairs of elements in the ground set I.</span></li> </ul> </div> </li> <li><div class="single">Outputs:<ul><li><span><tt>M</tt>, <span>a <a href="../../Macaulay2Doc/html/___Matrix.html">matrix</a></span>, whose (i,j) entry is 1 if (i,j) is a relation and 0 otherwise.</span></li> </ul> </div> </li> </ul> </div> <div class="single"><h2>Description</h2> <div><div>This function uses allPairsShortestPath method is used by the poset constructor to compute RelationMatrix from Relations in a Poset.</div> <table class="examples"><tr><td><pre>i1 : I = {a,b,c,d,e}; -- the ground set</pre> </td></tr> <tr><td><pre>i2 : R = {(a,b),(b,c),(a,c),(a,d),(d,e)}; -- relations</pre> </td></tr> <tr><td><pre>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 RR <--- RR 53 53</pre> </td></tr> </table> </div> </div> <div class="single"><h2>Caveat</h2> <div><div>Output matrix is over RR.</div> </div> </div> <div class="single"><h2>See also</h2> <ul><li><span><a href="___Poset.html" title="a class for partially ordered sets (posets)">Poset</a> -- a class for partially ordered sets (posets)</span></li> <li><span><a href="_poset.html" title="creating a poset">poset</a> -- creating a poset</span></li> <li><span><a href="___Relations.html" title="a set of relations in the poset that generates all other relations">Relations</a> -- a set of relations in the poset that generates all other relations</span></li> <li><span><a href="___Relation__Matrix.html" title="the matrix expressing all of the relations between elements in a Poset">RelationMatrix</a> -- the matrix expressing all of the relations between elements in a Poset</span></li> <li><span><a href="_all__Pairs__Shortest__Path.html" title="computes lengths of shortest paths between all pairs in a directed graph">allPairsShortestPath</a> -- computes lengths of shortest paths between all pairs in a directed graph</span></li> </ul> </div> <div class="waystouse"><h2>Ways to use <tt>transitiveClosure</tt> :</h2> <ul><li>transitiveClosure(List,List)</li> </ul> </div> </div> </body> </html>