Drawings of semigroups 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 Schützenberger graphs of a finite inverse monoid.
Drawing the D-class of an element of a semigroup This function uses to compute the dot code to produce the image that is then displayed. It 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, if the last argument is the integer 1 then the elements will appear as transformations, otherwise they will appear as words. The idempotents will be marked with a * before them.

This last optional argument may also be the integer 2 and in this case the elements will appear as integers, where i represents the element Elements(S)[i].
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);
This is the image produced by the first command in the previous example: \begin{center} \includegraphics[width=0.35\textwidth]{images/dclass1.png} \end{center} <br><center><img src="images/dclass1.png"></center><br> This is the image produced by the fourth command in the previous example: \begin{center} \includegraphics[width=0.5\textwidth]{images/dclass2.png} \end{center} <br><center><img src="images/dclass2.png"></center><br> This is the image produced by the last command in the previous example: \begin{center} \includegraphics[width=0.5\textwidth]{images/dclass3.png} \end{center} <br><center><img src="images/dclass3.png"></center><br> This function computes the dot code that can be used to produce a drawing for the D-class of an element of a semigroup. This can be done by using the function (if the system is properly configured) or by the user in some independent way. The arguments and options are the same than those of .
gap> DotForDrawingDClassOfElement(poi3,Transformation([1,4,3,4])); "digraph DClassOfElement {\ngraph [center=yes,ordering=out];\nnode [shape=pla\ intext];\nedge [color=cornflowerblue,arrowhead=none];\n1 [label=<\n<TABLE BORD\ ER=\"0\" CELLBORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\" PORT=\"1\">\n<TR\ ><TD BORDER=\"0\"><TABLE CELLSPACING=\"0\"><TR><TD BGCOLOR=\"white\" BORDER=\"\ 0\">*abc</TD></TR>\n</TABLE></TD><TD BORDER=\"0\"><TABLE CELLSPACING=\"0\"><TR\ ><TD BGCOLOR=\"white\" BORDER=\"0\">a</TD></TR>\n</TABLE></TD><TD BORDER=\"0\"\ ><TABLE CELLSPACING=\"0\"><TR><TD BGCOLOR=\"white\" BORDER=\"0\">ab</TD></TR>\ \n</TABLE></TD></TR>\n<TR><TD BORDER=\"0\"><TABLE CELLSPACING=\"0\"><TR><TD BG\ COLOR=\"white\" BORDER=\"0\">bc</TD></TR>\n</TABLE></TD><TD BORDER=\"0\"><TABL\ E CELLSPACING=\"0\"><TR><TD BGCOLOR=\"white\" BORDER=\"0\">*bca</TD></TR>\n</T\ ABLE></TD><TD BORDER=\"0\"><TABLE CELLSPACING=\"0\"><TR><TD BGCOLOR=\"white\" \ BORDER=\"0\">b</TD></TR>\n</TABLE></TD></TR>\n<TR><TD BORDER=\"0\"><TABLE CELL\ SPACING=\"0\"><TR><TD BGCOLOR=\"white\" BORDER=\"0\">c</TD></TR>\n</TABLE></TD\ ><TD BORDER=\"0\"><TABLE CELLSPACING=\"0\"><TR><TD BGCOLOR=\"white\" BORDER=\"\ 0\">ca</TD></TR>\n</TABLE></TD><TD BORDER=\"0\"><TABLE CELLSPACING=\"0\"><TR><\ TD BGCOLOR=\"white\" BORDER=\"0\">*cab</TD></TR>\n</TABLE></TD></TR>\n</TABLE>\ >];\n}\n"
By using Print (or PrinTo, if one wants to print to a file) the string is displayed as follows:
gap> Print(last); digraph DClassOfElement { graph [center=yes,ordering=out]; node [shape=plaintext]; edge [color=cornflowerblue,arrowhead=none]; 1 [label=< <TABLE BORDER="0" CELLBORDER="0" CELLPADDING="0" CELLSPACING="0" PORT="1"> <TR><TD BORDER="0"><TABLE CELLSPACING="0"><TR><TD BGCOLOR="white" BORDER="0">*\ abc</TD></TR> </TABLE></TD><TD BORDER="0"><TABLE CELLSPACING="0"><TR><TD BGCOLOR="white" BOR\ DER="0">a</TD></TR> </TABLE></TD><TD BORDER="0"><TABLE CELLSPACING="0"><TR><TD BGCOLOR="white" BOR\ DER="0">ab</TD></TR> </TABLE></TD></TR> <TR><TD BORDER="0"><TABLE CELLSPACING="0"><TR><TD BGCOLOR="white" BORDER="0">b\ c</TD></TR> </TABLE></TD><TD BORDER="0"><TABLE CELLSPACING="0"><TR><TD BGCOLOR="white" BOR\ DER="0">*bca</TD></TR> </TABLE></TD><TD BORDER="0"><TABLE CELLSPACING="0"><TR><TD BGCOLOR="white" BOR\ DER="0">b</TD></TR> </TABLE></TD></TR> <TR><TD BORDER="0"><TABLE CELLSPACING="0"><TR><TD BGCOLOR="white" BORDER="0">c\ </TD></TR> </TABLE></TD><TD BORDER="0"><TABLE CELLSPACING="0"><TR><TD BGCOLOR="white" BOR\ DER="0">ca</TD></TR> </TABLE></TD><TD BORDER="0"><TABLE CELLSPACING="0"><TR><TD BGCOLOR="white" BOR\ DER="0">*cab</TD></TR> </TABLE></TD></TR> </TABLE>>]; }
Drawing the D-classes of a semigroup 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, as an optional argument, the integer 1, 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.

The dot code is computed by .

This last optional argument may also be the integer 2 and in this case the elements will appear as integers, where i represents the element Elements(S)[i].
gap> DrawDClasses(poi3); gap> DrawDClasses(poi3, [Transformation( [ 2, 3, 4, 4 ] ), Transformation( [ 2, 4, 3, 4 ] )], [Transformation( [ 2, 4, 3, 4 ] )],1);
This is the image produced by the first command in the previous example: \begin{center} \includegraphics[width=0.4\textwidth]{images/dclasses1.png} \end{center} <br><center><img src="images/dclasses1.png"></center><br> This is the image produced by the second command in the previous example: \begin{center} \includegraphics[width=0.4\textwidth]{images/dclasses2.png} \end{center} <br><center><img src="images/dclasses2.png"></center><br> This function computes the dot code that can be used to produce a drawing for the D-class of an element of a semigroup. This can be done by using the function (if the system is properly configured) or by the user in some independent way. The arguments and options are the same than those of .
gap> Print(DotForDrawingDClasses(poi3)); digraph DClasses { graph [center=yes,ordering=out]; node [shape=plaintext]; edge [color=cornflowerblue,arrowhead=none]; ## ... many more lines ... </TABLE></TD></TR> </TABLE>>]; 4:4 -> 3:3; 3:3 -> 2:2; 2:2 -> 1:1; }
Cayley graphs Draws the right Cayley graph of a finite monoid or semigroup S. This function is a synonym of . For example, the command DrawCayleyGraph(b21); would produce the following image (where state i represents the element Elements(S)[i], the neutral element is coloured in "light blue" and all other idempotents are coloured in "light coral"): \begin{center} \includegraphics[width=0.4\textwidth]{images/cgb21.png} \end{center} <br><center><img src="images/cgb21.png"></center><br> This function computes the dot code that is used by the previous function and can also be used by the reader in some independent way.
Schützenberger graphs Draws the Schützenberger graphs of the inverse semigroup S. For example, `DrawSchutzenbergerGraphs(poi3);` would produce the following:

\begin{center} \includegraphics[width=0.45\textwidth]{images/schutzenberger.png} \end{center} <br><center><img src="images/schutzenberger.png"></center><br>
Drawings output formats By default, when a drawing is requested, it is outputted in pdf format. Since graphviz allows other output formats (see http://www.graphviz.org/doc/info/output.html), it is possible to also request a drawing in a format other than pdf. This is a global variable which holds the valid output formats for a drawing. It currently has the value: ["dia", "fig", "gd", "gd2", "gif", "hpgl", "jpg", "mif", "mp", "pcl", "pic", "plain", "plain-ext", "png", "ps", "ps2", "svg", "svgz", "vrml", "vtx", "wbmp", "none"] (see http://www.graphviz.org/doc/info/output.html for their description). This is a global variable which holds the alternative output format for a drawing. By default its value is "none" which indicates that just pdf will be used as the output format.

If its value becomes one of those in , then besides the pdf file, it will also be created a file in the alternative format.

To change this variable's value, please use . This function is used to set the value of to the format f which is one of .
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.
Drawings extra graph attributes 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 http://graphviz.org/doc/info/attrs.html. (Note that only graph attributes are allowed to be defined, not edge nor node attributes are supported yet.) This is a global variable which holds a list of strings, each of which defines a dot graph attribute. This variable is not 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 . If DrawingsExtraGraphAttributes holds the value "none" then the default dot settings will be used. Use to set it to "none". This is the function to define the drawing's graph attributes (see http://graphviz.org/doc/info/attrs.html for a list and explanation of them). the argument L is a list of strings, each of which defines a dot graph attribute. For example, if we wanted to define the graph size to be 7x9 (in inches), we would call SetDrawingsExtraGraphAttributes(["size=7,9"]);.

If we also wanted to define the graph to be displayed in landscape mode we would call SetDrawingsExtraGraphAttributes(["size=7,9", "rotate=90"]);. If, in addition we wanted to define the background colour to be, for example, pink, we would call SetDrawingsExtraGraphAttributes(["size=7,9", "rotate=90", "bgcolor=pink"]);.

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 .
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"
This function sets the graph drawing attributes back to dot's defaults.