Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
| Download
GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
Project: cocalc-sagemath-dev-slelievre
Views: 4183461[1X3 [33X[0;0YDrawings of semigroups[133X[101X23[33X[0;0YThere are some pictures that may give a lot of information about a4semigroup. This is the case of the egg-box picture of the D-classes, the5right Cayley graph of a finite monoid and the Schützenberger graphs of a6finite inverse monoid.[133X789[1X3.1 [33X[0;0YDrawing the D-class of an element of a semigroup[133X[101X1011[1X3.1-1 DrawDClassOfElement[101X1213[29X[2XDrawDClassOfElement[102X( [3Xarg[103X ) [32X function1415[33X[0;0YThis function uses [2XDotForDrawingDClassOfElement[102X ([14X3.1-2[114X) to compute the dot16code to produce the image that is then displayed. It takes as arguments a17semigroup followed by a transformation which is the element whose D-class18will be drawn. Optionally we can then specify n lists of elements and the19elements of each list will be drawn in different colours. Finally, if the20last argument is the integer [10X1[110X then the elements will appear as21transformations, otherwise they will appear as words. The idempotents will22be marked with a * before them.[133X2324[33X[0;0YThis last optional argument may also be the integer [10X2[110X and in this case the25elements will appear as integers, where [10Xi[110X represents the element26[10XElements(S)[i][110X.[133X2728[4X[32X Example [32X[104X29[4X[25Xgap>[125X [27XDrawDClassOfElement(poi3, Transformation([1,4,3,4]));[127X[104X30[4X[25Xgap>[125X [27XDrawDClassOfElement(poi3, Transformation([1,4,3,4]),1);[127X[104X31[4X[25Xgap>[125X [27XDrawDClassOfElement(poi3, Transformation([1,4,3,4]),[127X[104X32[4X[28X [Transformation( [ 2, 3, 4, 4 ] )],1);[128X[104X33[4X[25Xgap>[125X [27XDrawDClassOfElement(poi3, Transformation([1,4,3,4]),[127X[104X34[4X[28X [Transformation( [ 2, 3, 4, 4 ] ), Transformation( [ 2, 4, 3, 4 ] )],[128X[104X35[4X[28X [Transformation( [ 2, 4, 3, 4 ] )],1);[128X[104X36[4X[25Xgap>[125X [27XDrawDClassOfElement(poi3, Transformation([1,4,3,4]), [127X[104X37[4X[28X [Transformation( [ 2, 4, 3, 4 ] )],"Dclass",1);[128X[104X38[4X[28X [128X[104X39[4X[32X[104X4041[33X[0;0YThis is the image produced by the first command in the previous example:42This is the image produced by the fourth command in the previous example:43This is the image produced by the last command in the previous example:[133X4445[1X3.1-2 DotForDrawingDClassOfElement[101X4647[29X[2XDotForDrawingDClassOfElement[102X( [3Xarg[103X ) [32X function4849[33X[0;0YThis function computes the dot code that can be used to produce a drawing50for the D-class of an element of a semigroup. This can be done by using the51function [2XDrawDClassOfElement[102X ([14X3.1-1[114X) (if the system is properly configured)52or by the user in some independent way. The arguments and options are the53same than those of [2XDrawDClassOfElement[102X ([14X3.1-1[114X).[133X5455[4X[32X Example [32X[104X56[4X[28X gap> DotForDrawingDClassOfElement(poi3,Transformation([1,4,3,4]));[128X[104X57[4X[28X"digraph DClassOfElement {\ngraph [center=yes,ordering=out];\nnode [shape=pla\[128X[104X58[4X[28Xintext];\nedge [color=cornflowerblue,arrowhead=none];\n1 [label=<\n<TABLE BORD\[128X[104X59[4X[28XER=\"0\" CELLBORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\" PORT=\"1\">\n<TR\[128X[104X60[4X[28X><TD BORDER=\"0\"><TABLE CELLSPACING=\"0\"><TR><TD BGCOLOR=\"white\" BORDER=\"\[128X[104X61[4X[28X0\">*abc</TD></TR>\n</TABLE></TD><TD BORDER=\"0\"><TABLE CELLSPACING=\"0\"><TR\[128X[104X62[4X[28X><TD BGCOLOR=\"white\" BORDER=\"0\">a</TD></TR>\n</TABLE></TD><TD BORDER=\"0\"\[128X[104X63[4X[28X><TABLE CELLSPACING=\"0\"><TR><TD BGCOLOR=\"white\" BORDER=\"0\">ab</TD></TR>\[128X[104X64[4X[28X\n</TABLE></TD></TR>\n<TR><TD BORDER=\"0\"><TABLE CELLSPACING=\"0\"><TR><TD BG\[128X[104X65[4X[28XCOLOR=\"white\" BORDER=\"0\">bc</TD></TR>\n</TABLE></TD><TD BORDER=\"0\"><TABL\[128X[104X66[4X[28XE CELLSPACING=\"0\"><TR><TD BGCOLOR=\"white\" BORDER=\"0\">*bca</TD></TR>\n</T\[128X[104X67[4X[28XABLE></TD><TD BORDER=\"0\"><TABLE CELLSPACING=\"0\"><TR><TD BGCOLOR=\"white\" \[128X[104X68[4X[28XBORDER=\"0\">b</TD></TR>\n</TABLE></TD></TR>\n<TR><TD BORDER=\"0\"><TABLE CELL\[128X[104X69[4X[28XSPACING=\"0\"><TR><TD BGCOLOR=\"white\" BORDER=\"0\">c</TD></TR>\n</TABLE></TD\[128X[104X70[4X[28X><TD BORDER=\"0\"><TABLE CELLSPACING=\"0\"><TR><TD BGCOLOR=\"white\" BORDER=\"\[128X[104X71[4X[28X0\">ca</TD></TR>\n</TABLE></TD><TD BORDER=\"0\"><TABLE CELLSPACING=\"0\"><TR><\[128X[104X72[4X[28XTD BGCOLOR=\"white\" BORDER=\"0\">*cab</TD></TR>\n</TABLE></TD></TR>\n</TABLE>\[128X[104X73[4X[28X>];\n}\n"[128X[104X74[4X[28X [128X[104X75[4X[32X[104X7677[33X[0;0YBy using Print (or PrinTo, if one wants to print to a file) the string is78displayed as follows:[133X7980[4X[32X Example [32X[104X81[4X[25Xgap>[125X [27XPrint(last);[127X[104X82[4X[28Xdigraph DClassOfElement {[128X[104X83[4X[28Xgraph [center=yes,ordering=out];[128X[104X84[4X[28Xnode [shape=plaintext];[128X[104X85[4X[28Xedge [color=cornflowerblue,arrowhead=none];[128X[104X86[4X[28X1 [label=<[128X[104X87[4X[28X<TABLE BORDER="0" CELLBORDER="0" CELLPADDING="0" CELLSPACING="0" PORT="1">[128X[104X88[4X[28X<TR><TD BORDER="0"><TABLE CELLSPACING="0"><TR><TD BGCOLOR="white" BORDER="0">*\[128X[104X89[4X[28Xabc</TD></TR>[128X[104X90[4X[28X</TABLE></TD><TD BORDER="0"><TABLE CELLSPACING="0"><TR><TD BGCOLOR="white" BOR\[128X[104X91[4X[28XDER="0">a</TD></TR>[128X[104X92[4X[28X</TABLE></TD><TD BORDER="0"><TABLE CELLSPACING="0"><TR><TD BGCOLOR="white" BOR\[128X[104X93[4X[28XDER="0">ab</TD></TR>[128X[104X94[4X[28X</TABLE></TD></TR>[128X[104X95[4X[28X<TR><TD BORDER="0"><TABLE CELLSPACING="0"><TR><TD BGCOLOR="white" BORDER="0">b\[128X[104X96[4X[28Xc</TD></TR>[128X[104X97[4X[28X</TABLE></TD><TD BORDER="0"><TABLE CELLSPACING="0"><TR><TD BGCOLOR="white" BOR\[128X[104X98[4X[28XDER="0">*bca</TD></TR>[128X[104X99[4X[28X</TABLE></TD><TD BORDER="0"><TABLE CELLSPACING="0"><TR><TD BGCOLOR="white" BOR\[128X[104X100[4X[28XDER="0">b</TD></TR>[128X[104X101[4X[28X</TABLE></TD></TR>[128X[104X102[4X[28X<TR><TD BORDER="0"><TABLE CELLSPACING="0"><TR><TD BGCOLOR="white" BORDER="0">c\[128X[104X103[4X[28X</TD></TR>[128X[104X104[4X[28X</TABLE></TD><TD BORDER="0"><TABLE CELLSPACING="0"><TR><TD BGCOLOR="white" BOR\[128X[104X105[4X[28XDER="0">ca</TD></TR>[128X[104X106[4X[28X</TABLE></TD><TD BORDER="0"><TABLE CELLSPACING="0"><TR><TD BGCOLOR="white" BOR\[128X[104X107[4X[28XDER="0">*cab</TD></TR>[128X[104X108[4X[28X</TABLE></TD></TR>[128X[104X109[4X[28X</TABLE>>];[128X[104X110[4X[28X}[128X[104X111[4X[32X[104X112113114[1X3.2 [33X[0;0YDrawing the D-classes of a semigroup[133X[101X115116[1X3.2-1 DrawDClasses[101X117118[29X[2XDrawDClasses[102X( [3Xarg[103X ) [32X function119120[33X[0;0YThis function is similar to the previous one, except that this one draws all121the D-classes of the semigroup given as the first argument. It then takes122optionally n lists of elements and the elements of each list will be drawn123in different colours. It also accepts, as an optional argument, the integer124[10X1[110X, to specify whether the elements will appear as words or as125transformations as in the previous function. The idempotents will be marked126with a * before them.[133X127128[33X[0;0YThe dot code is computed by [2XDotForDrawingDClasses[102X ([14X3.2-2[114X).[133X129130[33X[0;0YThis last optional argument may also be the integer [10X2[110X and in this case the131elements will appear as integers, where [10Xi[110X represents the element132[10XElements(S)[i][110X.[133X133134[4X[32X Example [32X[104X135[4X[25Xgap>[125X [27XDrawDClasses(poi3);[127X[104X136[4X[25Xgap>[125X [27XDrawDClasses(poi3, [Transformation( [ 2, 3, 4, 4 ] ),[127X[104X137[4X[28X Transformation( [ 2, 4, 3, 4 ] )],[128X[104X138[4X[28X [Transformation( [ 2, 4, 3, 4 ] )],1);[128X[104X139[4X[28X [128X[104X140[4X[32X[104X141142[33X[0;0YThis is the image produced by the first command in the previous example:143This is the image produced by the second command in the previous example:[133X144145[1X3.2-2 DotForDrawingDClasses[101X146147[29X[2XDotForDrawingDClasses[102X( [3Xarg[103X ) [32X function148149[33X[0;0YThis function computes the dot code that can be used to produce a drawing150for the D-class of an element of a semigroup. This can be done by using the151function [2XDrawDClasses[102X ([14X3.2-1[114X) (if the system is properly configured) or by152the user in some independent way. The arguments and options are the same153than those of [2XDrawDClasses[102X ([14X3.2-1[114X).[133X154155[4X[32X Example [32X[104X156[4X[25Xgap>[125X [27XPrint(DotForDrawingDClasses(poi3));[127X[104X157[4X[28Xdigraph DClasses {[128X[104X158[4X[28Xgraph [center=yes,ordering=out];[128X[104X159[4X[28Xnode [shape=plaintext];[128X[104X160[4X[28Xedge [color=cornflowerblue,arrowhead=none];[128X[104X161[4X[28X## ... many more lines ...[128X[104X162[4X[28X</TABLE></TD></TR>[128X[104X163[4X[28X</TABLE>>];[128X[104X164[4X[28X4:4 -> 3:3;[128X[104X165[4X[28X3:3 -> 2:2;[128X[104X166[4X[28X2:2 -> 1:1;[128X[104X167[4X[28X}[128X[104X168[4X[28X [128X[104X169[4X[32X[104X170171172[1X3.3 [33X[0;0YCayley graphs[133X[101X173174[1X3.3-1 DrawRightCayleyGraph[101X175176[29X[2XDrawRightCayleyGraph[102X( [3XS[103X ) [32X function177178[33X[0;0YDraws the right Cayley graph of a finite monoid or semigroup [3XS[103X.[133X179180[1X3.3-2 DrawCayleyGraph[101X181182[29X[2XDrawCayleyGraph[102X( [3XS[103X ) [32X function183184[33X[0;0YThis function is a synonym of [2XDrawRightCayleyGraph[102X ([14X3.3-1[114X).[133X185186[33X[0;0YFor example, the command [10XDrawCayleyGraph(b21);[110X would produce the following187image (where state [10Xi[110X represents the element [10XElements(S)[i][110X, the neutral188element is coloured in "light blue" and all other idempotents are coloured189in "light coral"):[133X190191[1X3.3-3 DotForDrawingRightCayleyGraph[101X192193[29X[2XDotForDrawingRightCayleyGraph[102X( [3XS[103X ) [32X function194195[33X[0;0YThis function computes the dot code that is used by the previous function196and can also be used by the reader in some independent way.[133X197198199[1X3.4 [33X[0;0YSchützenberger graphs[133X[101X200201[1X3.4-1 DrawSchutzenbergerGraphs[101X202203[29X[2XDrawSchutzenbergerGraphs[102X( [3XS[103X ) [32X function204205[33X[0;0YDraws the Schützenberger graphs of the inverse semigroup [3XS[103X.[133X206207[33X[0;0YFor example, [10XDrawSchutzenbergerGraphs(poi3);[110X would produce the following:[133X208209210[1X3.5 [33X[0;0YDrawings output formats[133X[101X211212[33X[0;0YBy default, when a drawing is requested, it is outputted in pdf format.213Since [10Xgraphviz[110X allows other output formats (see214[7Xhttp://www.graphviz.org/doc/info/output.html[107X), it is possible to also215request a drawing in a format other than pdf.[133X216217[1X3.5-1 DrawingsListOfExtraFormats[101X218219[29X[2XDrawingsListOfExtraFormats[102X[32X global variable220221[33X[0;0YThis is a global variable which holds the valid output formats for a222drawing. It currently has the value: [10X["dia", "fig", "gd", "gd2", "gif",223"hpgl", "jpg", "mif", "mp", "pcl", "pic", "plain", "plain-ext", "png", "ps",224"ps2", "svg", "svgz", "vrml", "vtx", "wbmp", "none"][110X (see225[7Xhttp://www.graphviz.org/doc/info/output.html[107X for their description).[133X226227[1X3.5-2 DrawingsExtraFormat[101X228229[29X[2XDrawingsExtraFormat[102X[32X global variable230231[33X[0;0YThis is a global variable which holds the alternative output format for a232drawing. By default its value is [10X"none"[110X which indicates that just pdf will233be used as the output format.[133X234235[33X[0;0YIf its value becomes one of those in [2XDrawingsListOfExtraFormats[102X ([14X3.5-1[114X),236then besides the pdf file, it will also be created a file in the alternative237format.[133X238239[33X[0;0YTo change this variable's value, please use [2XSetDrawingsExtraFormat[102X ([14X3.5-3[114X).[133X240241[1X3.5-3 SetDrawingsExtraFormat[101X242243[29X[2XSetDrawingsExtraFormat[102X( [3Xf[103X ) [32X function244245[33X[0;0YThis function is used to set the value of [2XDrawingsExtraFormat[102X ([14X3.5-2[114X) to the246format [3Xf[103X which is one of [2XDrawingsListOfExtraFormats[102X ([14X3.5-1[114X).[133X247248[4X[32X Example [32X[104X249[4X[25Xgap>[125X [27XDrawingsExtraFormat;[127X[104X250[4X[28X"none"[128X[104X251[4X[25Xgap>[125X [27XSetDrawingsExtraFormat("jpg");[127X[104X252[4X[25Xgap>[125X [27XDrawingsExtraFormat;[127X[104X253[4X[28X"jpg"[128X[104X254[4X[28X[128X[104X255[4X[25Xgap>[125X [27XDrawRightCayleyGraph(poi3);[127X[104X256[4X[28XDisplaying file: /tmp/tmp.tpJqvI/cayleygraph.dot.ps[128X[104X257[4X[28XThe extra output format file: /tmp/tmp.tpJqvI/cayleygraph.dot.jpg[128X[104X258[4X[28Xhas also been created.[128X[104X259[4X[28X[128X[104X260[4X[32X[104X261262263[1X3.6 [33X[0;0YDrawings extra graph attributes[133X[101X264265[33X[0;0YThe functions described in this subsection are intended to give the user a266finer control over the final drawing. They allow to define the graph267attributes described in [7Xhttp://graphviz.org/doc/info/attrs.html[107X. (Note that268only graph attributes are allowed to be defined, not edge nor node269attributes are supported yet.)[133X270271[1X3.6-1 DrawingsExtraGraphAttributes[101X272273[29X[2XDrawingsExtraGraphAttributes[102X[32X global variable274275[33X[0;0YThis is a global variable which holds a list of strings, each of which276defines a [13Xdot[113X graph attribute. This variable is [13Xnot[113X intended to be modified277by the user directly, but can be used to check which extra attributes are278currently defined. To set the attributes, please use279[2XSetDrawingsExtraGraphAttributes[102X ([14X3.6-2[114X). If [10XDrawingsExtraGraphAttributes[110X280holds the value [10X"none"[110X then the default [13Xdot[113X settings will be used. Use281[2XClearDrawingsExtraGraphAttributes[102X ([14X3.6-3[114X) to set it to [10X"none"[110X.[133X282283[1X3.6-2 SetDrawingsExtraGraphAttributes[101X284285[29X[2XSetDrawingsExtraGraphAttributes[102X( [3XL[103X ) [32X function286287[33X[0;0YThis is the function to define the drawing's graph attributes (see288[7Xhttp://graphviz.org/doc/info/attrs.html[107X for a list and explanation of them).289the argument [3XL[103X is a list of strings, each of which defines a [13Xdot[113X graph290attribute. For example, if we wanted to define the graph size to be 7x9 (in291inches), we would call [10XSetDrawingsExtraGraphAttributes(["size=7,9"]);[110X.[133X292293[33X[0;0YIf we also wanted to define the graph to be displayed in landscape mode we294would call [10XSetDrawingsExtraGraphAttributes(["size=7,9", "rotate=90"]);[110X. If,295in addition we wanted to define the background colour to be, for example,296pink, we would call [10XSetDrawingsExtraGraphAttributes(["size=7,9",297"rotate=90", "bgcolor=pink"]);[110X.[133X298299[33X[0;0YAfter defining the attributes, any command that creates a drawing will use300the last defined attributes. To set them back to the defaults, please use301[2XClearDrawingsExtraGraphAttributes[102X ([14X3.6-3[114X).[133X302303[4X[32X Example [32X[104X304[4X[25Xgap>[125X [27XDrawingsExtraGraphAttributes;[127X[104X305[4X[28X"none"[128X[104X306[4X[28X[128X[104X307[4X[28X[128X[104X308[4X[25Xgap>[125X [27XSetDrawingsExtraGraphAttributes(["size=7,9"]);[127X[104X309[4X[28X[128X[104X310[4X[25Xgap>[125X [27XDrawingsExtraGraphAttributes;[127X[104X311[4X[28X[ "size=7,9" ][128X[104X312[4X[28X[128X[104X313[4X[28X[128X[104X314[4X[25Xgap>[125X [27XSetDrawingsExtraGraphAttributes(["size=7,9", "rotate=90"]);[127X[104X315[4X[28X[128X[104X316[4X[25Xgap>[125X [27XDrawingsExtraGraphAttributes;[127X[104X317[4X[28X[ "size=7,9", "rotate=90" ][128X[104X318[4X[28X[128X[104X319[4X[28X[128X[104X320[4X[25Xgap>[125X [27XSetDrawingsExtraGraphAttributes(["size=7,9", "rotate=90", "bgcolor=pink"]);[127X[104X321[4X[28X[128X[104X322[4X[25Xgap>[125X [27XDrawingsExtraGraphAttributes;[127X[104X323[4X[28X[ "size=7,9", "rotate=90", "bgcolor=pink" ][128X[104X324[4X[28X[128X[104X325[4X[28X[128X[104X326[4X[25Xgap>[125X [27XClearDrawingsExtraGraphAttributes();[127X[104X327[4X[28X[128X[104X328[4X[25Xgap>[125X [27XDrawingsExtraGraphAttributes;[127X[104X329[4X[28X"none"[128X[104X330[4X[32X[104X331332[1X3.6-3 ClearDrawingsExtraGraphAttributes[101X333334[29X[2XClearDrawingsExtraGraphAttributes[102X( ) [32X function335336[33X[0;0YThis function sets the graph drawing attributes back to [13Xdot[113X's defaults.[133X337338339340