<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>GAP (SgpViz) - Chapter 3: Drawings of semigroups </title> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <meta name="generator" content="GAPDoc2HTML" /> <link rel="stylesheet" type="text/css" href="manual.css" /> </head> <body> <div class="chlinktop"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a> <a href="chap1.html">1</a> <a href="chap2.html">2</a> <a href="chap3.html">3</a> <a href="chap4.html">4</a> <a href="chapBib.html">Bib</a> <a href="chapInd.html">Ind</a> </div> <div class="chlinkprevnexttop"> <a href="chap0.html">Top of Book</a> <a href="chap2.html">Previous Chapter</a> <a href="chap4.html">Next Chapter</a> </div> <p><a id="X826F747F81441D2E" name="X826F747F81441D2E"></a></p> <div class="ChapSects"><a href="chap3.html#X826F747F81441D2E">3 <span class="Heading"> Drawings of semigroups </span></a> <div class="ContSect"><span class="nocss"> </span><a href="chap3.html#X7F71117D7F0259B8">3.1 <span class="Heading"> Drawing the D-class of an element of a semigroup </span></a> <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3.html#X87448A11856B0F2D">3.1-1 DrawDClassOfElement</a></span> </div> <div class="ContSect"><span class="nocss"> </span><a href="chap3.html#X81CCF2BB81C4DF6F">3.2 <span class="Heading"> Drawing the D-classes of a semigroup </span></a> <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3.html#X7BDBEDA37ADCAADE">3.2-1 DrawDClasses</a></span> </div> <div class="ContSect"><span class="nocss"> </span><a href="chap3.html#X789D5E5A8558AA07">3.3 <span class="Heading">Cayley graphs</span></a> <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3.html#X7EB36DB07C6F58A0">3.3-1 DrawRightCayleyGraph</a></span> <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3.html#X86798CC9823D1DB2">3.3-2 DrawCayleyGraph</a></span> </div> <div class="ContSect"><span class="nocss"> </span><a href="chap3.html#X8641B3A6846AAFB5">3.4 <span class="Heading">Schutzenberger graphs</span></a> <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3.html#X7B7B58B77EA25719">3.4-1 DrawSchutzenbergerGraphs</a></span> </div> <div class="ContSect"><span class="nocss"> </span><a href="chap3.html#X7F5419527FFCD1DF">3.5 <span class="Heading">Drawings output formats</span></a> <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3.html#X844AA65E815BCFDF">3.5-1 DrawingsListOfExtraFormats</a></span> <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3.html#X7CE046CE786F76D5">3.5-2 DrawingsExtraFormat</a></span> <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3.html#X87B43746819C55F3">3.5-3 SetDrawingsExtraFormat</a></span> </div> <div class="ContSect"><span class="nocss"> </span><a href="chap3.html#X795DD98D86A1A441">3.6 <span class="Heading">Drawings extra graph attributes</span></a> <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3.html#X7A3895EB7C0573DD">3.6-1 DrawingsExtraGraphAttributes</a></span> <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3.html#X7B652A9179C45291">3.6-2 SetDrawingsExtraGraphAttributes</a></span> <span class="ContSS"><br /><span class="nocss"> </span><a href="chap3.html#X7B915CC480D0ABF0">3.6-3 ClearDrawingsExtraGraphAttributes</a></span> </div> </div> <h3>3 <span class="Heading"> Drawings of semigroups </span></h3> <p>There are some pictures that may give a lot of information about a semigroup. This is the case of the egg-box picture of the D-classes, the right Cayley graph of a finite monoid and the Schutzenberger graphs of a finite inverse monoid.</p> <p><a id="X7F71117D7F0259B8" name="X7F71117D7F0259B8"></a></p> <h4>3.1 <span class="Heading"> Drawing the D-class of an element of a semigroup </span></h4> <p><a id="X87448A11856B0F2D" name="X87448A11856B0F2D"></a></p> <h5>3.1-1 DrawDClassOfElement</h5> <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">> DrawDClassOfElement</code>( <var class="Arg">arg</var> )</td><td class="tdright">( function )</td></tr></table></div> <p>This function takes as arguments a semigroup followed by a transformation which is the element whose D-class will be drawn. Optionally we can then specify n lists of elements and the elements of each list will be drawn in different colours. Finally, we may specify a string name the file that will be used to write the drawing of the class (in PostScript format) and if the last argument is the integer <code class="code">1</code> then the elements will appear as transformations, otherwise they will appear as words. The idempotents will be marked with a * before them.</p> <p>This last optional argument may also be the integer <code class="code">2</code> and in this case the elements will appear as integers, where <code class="code">i</code> represents the element <code class="code">Elements(S)[i]</code>.</p> <table class="example"> <tr><td><pre> gap> DrawDClassOfElement(poi3, Transformation([1,4,3,4])); gap> DrawDClassOfElement(poi3, Transformation([1,4,3,4]),1); gap> DrawDClassOfElement(poi3, Transformation([1,4,3,4]), [Transformation( [ 2, 3, 4, 4 ] )],1); gap> DrawDClassOfElement(poi3, Transformation([1,4,3,4]), [Transformation( [ 2, 3, 4, 4 ] ), Transformation( [ 2, 4, 3, 4 ] )], [Transformation( [ 2, 4, 3, 4 ] )],1); gap> DrawDClassOfElement(poi3, Transformation([1,4,3,4]), [Transformation( [ 2, 4, 3, 4 ] )],"Dclass",1); </pre></td></tr></table> <p>This is the image produced by the first command in the previous example: <br><br><center><img src="images/dclass1.png"></center><br> <br><br> This is the image produced by the fourth command in the previous example: <br><br><center><img src="images/dclass2.png"></center><br> <br><br> This is the image produced by the last command in the previous example: <br><br><center><img src="images/dclass3.png"></center><br> <br><br></p> <p><a id="X81CCF2BB81C4DF6F" name="X81CCF2BB81C4DF6F"></a></p> <h4>3.2 <span class="Heading"> Drawing the D-classes of a semigroup </span></h4> <p><a id="X7BDBEDA37ADCAADE" name="X7BDBEDA37ADCAADE"></a></p> <h5>3.2-1 DrawDClasses</h5> <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">> DrawDClasses</code>( <var class="Arg">arg</var> )</td><td class="tdright">( function )</td></tr></table></div> <p>This function is similar to the previous one, except that this one draws all the D-classes of the semigroup given as the first argument. It then takes optionally n lists of elements and the elements of each list will be drawn in different colours. It also accepts a string specifying the name of the file in which the drawing will be written and the last, optional, argument, the integer <code class="code">1</code>, to specify whether the elements will appear as words or as transformations as in the previous function. The idempotents will be marked with a * before them.</p> <p>This last optional argument may also be the integer <code class="code">2</code> and in this case the elements will appear as integers, where <code class="code">i</code> represents the element <code class="code">Elements(S)[i]</code>.</p> <table class="example"> <tr><td><pre> gap> DrawDClasses(poi3,"DClasses"); gap> DrawDClasses(poi3, [Transformation( [ 2, 3, 4, 4 ] ), Transformation( [ 2, 4, 3, 4 ] )], [Transformation( [ 2, 4, 3, 4 ] )],1); </pre></td></tr></table> <p>This is the image produced by the first command in the previous example: <br><br><center><img src="images/dclasses1.png"></center><br> <br><br> This is the image produced by the second command in the previous example: <br><br><center><img src="images/dclasses2.png"></center><br> <br><br></p> <p><a id="X789D5E5A8558AA07" name="X789D5E5A8558AA07"></a></p> <h4>3.3 <span class="Heading">Cayley graphs</span></h4> <p><a id="X7EB36DB07C6F58A0" name="X7EB36DB07C6F58A0"></a></p> <h5>3.3-1 DrawRightCayleyGraph</h5> <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">> DrawRightCayleyGraph</code>( <var class="Arg">S</var> )</td><td class="tdright">( function )</td></tr></table></div> <p>Draws the right Cayley graph of a finite monoid or semigroup <var class="Arg">S</var>.</p> <p><a id="X86798CC9823D1DB2" name="X86798CC9823D1DB2"></a></p> <h5>3.3-2 DrawCayleyGraph</h5> <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">> DrawCayleyGraph</code>( <var class="Arg">S</var> )</td><td class="tdright">( function )</td></tr></table></div> <p>This function is a synonym of <code class="func">DrawRightCayleyGraph</code> (<a href="chap3.html#X7EB36DB07C6F58A0"><b>3.3-1</b></a>).</p> <p>For example, the command <code class="code">DrawCayleyGraph(b21);</code> would produce the following image (where state <code class="code">i</code> represents the element <code class="code">Elements(S)[i]</code>, the neutral element is colored in "light blue" and all other idempotents are colored in "light coral"): <br><br><center><img src="images/cgb21.png"></center><br></p> <p><a id="X8641B3A6846AAFB5" name="X8641B3A6846AAFB5"></a></p> <h4>3.4 <span class="Heading">Schutzenberger graphs</span></h4> <p><a id="X7B7B58B77EA25719" name="X7B7B58B77EA25719"></a></p> <h5>3.4-1 DrawSchutzenbergerGraphs</h5> <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">> DrawSchutzenbergerGraphs</code>( <var class="Arg">S</var> )</td><td class="tdright">( function )</td></tr></table></div> <p>Draws the Schutzenberger graphs of the inverse semigroup <var class="Arg">S</var>.</p> <p>For example, <code class="code">DrawSchutzenbergerGraphs(poi3);</code> would produce the following:</p> <p><br><center><img src="images/schutzenberger.gif"></center><br></p> <p><a id="X7F5419527FFCD1DF" name="X7F5419527FFCD1DF"></a></p> <h4>3.5 <span class="Heading">Drawings output formats</span></h4> <p>By default, when a drawing is requested, it is outputted in PostScript format. Since <code class="code">graphviz</code> allows other output formats (see <span class="URL"><a href="http://www.graphviz.org/doc/info/output.html">http://www.graphviz.org/doc/info/output.html</a></span>), it is possible to also request a drawing in a format other than PostScript.</p> <p><a id="X844AA65E815BCFDF" name="X844AA65E815BCFDF"></a></p> <h5>3.5-1 DrawingsListOfExtraFormats</h5> <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">> DrawingsListOfExtraFormats</code></td><td class="tdright">( global variable )</td></tr></table></div> <p>This is a global variable which holds the valid output formats for a drawing. It currently has the value: <code class="code">["dia", "fig", "gd", "gd2", "gif", "hpgl", "jpg", "mif", "mp", "pcl", "pic", "plain", "plain-ext", "png", "ps", "ps2", "svg", "svgz", "vrml", "vtx", "wbmp", "none"]</code> (see <span class="URL"><a href="http://www.graphviz.org/doc/info/output.html">http://www.graphviz.org/doc/info/output.html</a></span> for their description).</p> <p><a id="X7CE046CE786F76D5" name="X7CE046CE786F76D5"></a></p> <h5>3.5-2 DrawingsExtraFormat</h5> <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">> DrawingsExtraFormat</code></td><td class="tdright">( global variable )</td></tr></table></div> <p>This is a global variable which holds the alternative output format for a drawing. By default its value is <code class="code">"none"</code> which indicates that just PostScript will be used as the output format.</p> <p>If its value becomes one of those in <code class="func">DrawingsListOfExtraFormats</code> (<a href="chap3.html#X844AA65E815BCFDF"><b>3.5-1</b></a>), then besides the PostScript file, it will also be created a file in the alternative format.</p> <p>To change this variable's value, please use <code class="func">SetDrawingsExtraFormat</code> (<a href="chap3.html#X87B43746819C55F3"><b>3.5-3</b></a>).</p> <p><a id="X87B43746819C55F3" name="X87B43746819C55F3"></a></p> <h5>3.5-3 SetDrawingsExtraFormat</h5> <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">> SetDrawingsExtraFormat</code>( <var class="Arg">f</var> )</td><td class="tdright">( function )</td></tr></table></div> <p>This function is used to set the value of <code class="func">DrawingsExtraFormat</code> (<a href="chap3.html#X7CE046CE786F76D5"><b>3.5-2</b></a>) to the format <var class="Arg">f</var> which is one of <code class="func">DrawingsListOfExtraFormats</code> (<a href="chap3.html#X844AA65E815BCFDF"><b>3.5-1</b></a>).</p> <table class="example"> <tr><td><pre> gap> DrawingsExtraFormat; "none" gap> SetDrawingsExtraFormat("jpg"); gap> DrawingsExtraFormat; "jpg" gap> DrawRightCayleyGraph(poi3); Displaying file: /tmp/tmp.tpJqvI/cayleygraph.dot.ps The extra output format file: /tmp/tmp.tpJqvI/cayleygraph.dot.jpg has also been created. </pre></td></tr></table> <p><a id="X795DD98D86A1A441" name="X795DD98D86A1A441"></a></p> <h4>3.6 <span class="Heading">Drawings extra graph attributes</span></h4> <p>The functions described in this subsection are intended to give the user a finer control over the final drawing. They allow to define the graph attributes described in <span class="URL"><a href="http://graphviz.org/doc/info/attrs.html">http://graphviz.org/doc/info/attrs.html</a></span>. (Note that only graph attributes are allowed to be defined, not edge nor node attributes are supported yet.)</p> <p><a id="X7A3895EB7C0573DD" name="X7A3895EB7C0573DD"></a></p> <h5>3.6-1 DrawingsExtraGraphAttributes</h5> <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">> DrawingsExtraGraphAttributes</code></td><td class="tdright">( global variable )</td></tr></table></div> <p>This is a global variable which holds a list of strings, each of which defines a <em>dot</em> graph attribute. This variable is <em>not</em> intended to be modified by the user directly, but can be used to check which extra attributes are currently defined. To set the attributes, please use <code class="func">SetDrawingsExtraGraphAttributes</code> (<a href="chap3.html#X7B652A9179C45291"><b>3.6-2</b></a>). If <code class="code">DrawingsExtraGraphAttributes</code> holds the value <code class="code">"none"</code> then the default <em>dot</em> settings will be used. Use <code class="func">ClearDrawingsExtraGraphAttributes</code> (<a href="chap3.html#X7B915CC480D0ABF0"><b>3.6-3</b></a>) to set it to <code class="code">"none"</code>.</p> <p><a id="X7B652A9179C45291" name="X7B652A9179C45291"></a></p> <h5>3.6-2 SetDrawingsExtraGraphAttributes</h5> <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">> SetDrawingsExtraGraphAttributes</code>( <var class="Arg">L</var> )</td><td class="tdright">( function )</td></tr></table></div> <p>This is the function to define the drawing's graph attributes (see <span class="URL"><a href="http://graphviz.org/doc/info/attrs.html">http://graphviz.org/doc/info/attrs.html</a></span> for a list and explanation of them). the argument <var class="Arg">L</var> is a list of strings, each of which defines a <em>dot</em> graph attribute. For example, if we wanted to define the graph size to be 7x9 (in inches), we would call <code class="code">SetDrawingsExtraGraphAttributes(["size=7,9"]);</code>.</p> <p>If we also wanted to define the graph to be displayed in landscape mode we would call <code class="code">SetDrawingsExtraGraphAttributes(["size=7,9", "rotate=90"]);</code>. If, in addition we wanted to define the background color to be, for example, pink, we would call <code class="code">SetDrawingsExtraGraphAttributes(["size=7,9", "rotate=90", "bgcolor=pink"]);</code>.</p> <p>After defining the attributes, any command that creates a drawing will use the last defined attributes. To set them back to the defaults, please use <code class="func">ClearDrawingsExtraGraphAttributes</code> (<a href="chap3.html#X7B915CC480D0ABF0"><b>3.6-3</b></a>).</p> <table class="example"> <tr><td><pre> gap> DrawingsExtraGraphAttributes; "none" gap> SetDrawingsExtraGraphAttributes(["size=7,9"]); gap> DrawingsExtraGraphAttributes; [ "size=7,9" ] gap> SetDrawingsExtraGraphAttributes(["size=7,9", "rotate=90"]); gap> DrawingsExtraGraphAttributes; [ "size=7,9", "rotate=90" ] gap> SetDrawingsExtraGraphAttributes(["size=7,9", "rotate=90", "bgcolor=pink"]); gap> DrawingsExtraGraphAttributes; [ "size=7,9", "rotate=90", "bgcolor=pink" ] gap> ClearDrawingsExtraGraphAttributes(); gap> DrawingsExtraGraphAttributes; "none" </pre></td></tr></table> <p><a id="X7B915CC480D0ABF0" name="X7B915CC480D0ABF0"></a></p> <h5>3.6-3 ClearDrawingsExtraGraphAttributes</h5> <div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">> ClearDrawingsExtraGraphAttributes</code>( <var class="Arg"></var> )</td><td class="tdright">( function )</td></tr></table></div> <p>This function sets the graph drawing attributes back to <em>dot</em>'s defaults.</p> <div class="chlinkprevnextbot"> <a href="chap0.html">Top of Book</a> <a href="chap2.html">Previous Chapter</a> <a href="chap4.html">Next Chapter</a> </div> <div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0.html">Top</a> <a href="chap1.html">1</a> <a href="chap2.html">2</a> <a href="chap3.html">3</a> <a href="chap4.html">4</a> <a href="chapBib.html">Bib</a> <a href="chapInd.html">Ind</a> </div> <hr /> <p class="foot">generated by <a href="http://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p> </body> </html>