  
  [1X16 [33X[0;0YDot functions[133X[101X
  
  
  [1X16.1 [33X[0;0YDot functions[133X[101X
  
  [33X[0;0YWe  provide  several  functions to translate graphs related to numerical and
  affine semigroups to the dot language. This can either be used with graphviz
  or  any  javascript  library  that  interprets  dot  language.  We  give the
  alternative to use [10XDotSplash[110X that uses viz.js.[133X
  
  [1X16.1-1 DotBinaryRelation[101X
  
  [33X[1;0Y[29X[2XDotBinaryRelation[102X( [3Xbr[103X[, [3Xopt[103X] ) [32X function[133X
  
  [33X[0;0Y[10Xbr[110X  is  a binary relation. Returns a GraphViz dot that represents the binary
  relation [10Xbr[110X. The set of vertices of the resulting graph is the source of [10Xbr[110X.
  Edges join those elements which are related with respect to [10Xbr[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xbr:=BinaryRelationByElements(Domain([1,2]), [DirectProductElement([1,2])]);[127X[104X
    [4X[28X<general mapping: <object> -> <object> >[128X[104X
    [4X[25Xgap>[125X [27XPrint(DotBinaryRelation(br));[127X[104X
    [4X[28Xdigraph  NSGraph{rankdir = TB; edge[dir=back];[128X[104X
    [4X[28X1 [label="1"];[128X[104X
    [4X[28X2 [label="2"];[128X[104X
    [4X[28X2 -> 1;[128X[104X
    [4X[28X}[128X[104X
  [4X[32X[104X
  
  [33X[0;0YThe  argument  [3Xopt[103X  is optional and must be a record. It may include general
  options  regarding  the graph, edges and nodes. It may also include specific
  options  for nodes (a function the depends on the node) or edges (a function
  in  two  variables  to  be  applied to the nodes connected by the edge). The
  complete  list  of  options  is  graph,  edge,  node  (these  are  general),
  nodelabel,  nodestyle,  nodecolor,  nodefillcolor,  nodeshape, nodefontsize,
  nodefontcolor  (these  are  for  nodes),  edgelabel,  edgestyle,  edgecolor,
  edgefontsize, edgefontcolor, arrowsize.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xd6:=Domain(DivisorsInt(12));;[127X[104X
    [4X[25Xgap>[125X [27Xrels6:=Filtered(Tuples(d6,2),a-> a[2] mod a[1]=0);;[127X[104X
    [4X[25Xgap>[125X [27Xr6:=BinaryRelationByElements(d6,List(rels6,Tuple));;[127X[104X
    [4X[25Xgap>[125X [27Xr6:=HasseDiagramBinaryRelation(r6);;[127X[104X
    [4X[25Xgap>[125X [27Xstyle:=function ( x )[127X[104X
    [4X[25X>[125X [27X    if IsPrimeInt(x) then[127X[104X
    [4X[25X>[125X [27X        return "filled";[127X[104X
    [4X[25X>[125X [27X    else[127X[104X
    [4X[25X>[125X [27X        return "solid";[127X[104X
    [4X[25X>[125X [27X    fi;[127X[104X
    [4X[25X>[125X [27X    return;[127X[104X
    [4X[25X>[125X [27Xend;[127X[104X
    [4X[28Xfunction( x ) ... end[128X[104X
    [4X[25Xgap>[125X [27Xcolor:=function ( x )[127X[104X
    [4X[25X>[125X [27X    if x mod 2 = 1 then[127X[104X
    [4X[25X>[125X [27X        return "lightblue";[127X[104X
    [4X[25X>[125X [27X    else[127X[104X
    [4X[25X>[125X [27X        return "orange";[127X[104X
    [4X[25X>[125X [27X    fi;[127X[104X
    [4X[25X>[125X [27X    return;[127X[104X
    [4X[25X>[125X [27Xend;[127X[104X
    [4X[28Xfunction( x ) ... end[128X[104X
    [4X[25Xgap>[125X [27Xlabele:=function(x,y)[127X[104X
    [4X[25X>[125X [27X    return y/x;[127X[104X
    [4X[25X>[125X [27Xend;[127X[104X
    [4X[28Xfunction( x, y ) ... end[128X[104X
    [4X[25Xgap>[125X [27Xstylee:=function(x,y)[127X[104X
    [4X[25X>[125X [27X    if y/x=2 then[127X[104X
    [4X[25X>[125X [27X        return "dashed";[127X[104X
    [4X[25X>[125X [27X    else[127X[104X
    [4X[25X>[125X [27X        return "solid";[127X[104X
    [4X[25X>[125X [27X    fi;[127X[104X
    [4X[25X>[125X [27Xend;[127X[104X
    [4X[28Xfunction( x, y ) ... end[128X[104X
    [4X[25Xgap>[125X [27Xcolore:=function(x,y)[127X[104X
    [4X[25X>[125X [27X    if y/x>2 then[127X[104X
    [4X[25X>[125X [27X        return "red";[127X[104X
    [4X[25X>[125X [27X    else[127X[104X
    [4X[25X>[125X [27X        return "black";[127X[104X
    [4X[25X>[125X [27X    fi;[127X[104X
    [4X[25X>[125X [27Xend;[127X[104X
    [4X[28Xfunction( x, y ) ... end[128X[104X
    [4X[25Xgap>[125X [27XPrint(DotBinaryRelation(r6, [127X[104X
    [4X[28X      rec(graph:="rankdir=LR",[128X[104X
    [4X[28X          nodestyle:=style,[128X[104X
    [4X[28X          nodecolor:=color,[128X[104X
    [4X[28X          edgelabel:=labele,[128X[104X
    [4X[28X          edgestyle:=stylee,[128X[104X
    [4X[28X          edgecolor:=colore,[128X[104X
    [4X[28X          arrowsize:={x,y}->"0.2")));[128X[104X
    [4X[28X[128X[104X
    [4X[28Xdigraph NSGraph{[128X[104X
    [4X[28Xgraph [rankdir=LR]; edge [dir=back];[128X[104X
    [4X[28X1 [label="1" style="solid" color="lightblue" ];[128X[104X
    [4X[28X2 [label="2" style="filled" color="orange" ];[128X[104X
    [4X[28X3 [label="3" style="filled" color="lightblue" ];[128X[104X
    [4X[28X4 [label="4" style="solid" color="orange" ];[128X[104X
    [4X[28X5 [label="6" style="solid" color="orange" ];[128X[104X
    [4X[28X6 [label="12" style="solid" color="orange" ];[128X[104X
    [4X[28X2 -> 1 [label="2" style="dashed" color="black" arrowsize="0.2" ];[128X[104X
    [4X[28X3 -> 1 [label="3" style="solid" color="red" arrowsize="0.2" ];[128X[104X
    [4X[28X4 -> 2 [label="2" style="dashed" color="black" arrowsize="0.2" ];[128X[104X
    [4X[28X5 -> 2 [label="3" style="solid" color="red" arrowsize="0.2" ];[128X[104X
    [4X[28X5 -> 3 [label="2" style="dashed" color="black" arrowsize="0.2" ];[128X[104X
    [4X[28X6 -> 4 [label="3" style="solid" color="red" arrowsize="0.2" ];[128X[104X
    [4X[28X6 -> 5 [label="2" style="dashed" color="black" arrowsize="0.2" ];[128X[104X
    [4X[28X}[128X[104X
  [4X[32X[104X
  
  [1X16.1-2 DotTreeOfGluingsOfNumericalSemigroup[101X
  
  [33X[1;0Y[29X[2XDotTreeOfGluingsOfNumericalSemigroup[102X( [3XS[103X ) [32X function[133X
  
  [33X[0;0Y[10XS[110X is a numerical semigroup. It outputs a tree (in dot) representing the many
  ways  [10XS[110X  can  be  decomposed  as  a gluing of numerical semigroups (and goes
  recursively in the factors).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xs:=NumericalSemigroup(4,6,9);;[127X[104X
    [4X[25Xgap>[125X [27XPrint(DotOverSemigroupsNumericalSemigroup(s));[127X[104X
    [4X[28Xdigraph  NSGraph{rankdir = TB; [128X[104X
    [4X[28X0 [label="< 4, 6, 9 >"]; [128X[104X
    [4X[28X0 [label="< 4, 6, 9 >", style=filled]; [128X[104X
    [4X[28X1 [label="< 4 > + < 6, 9 >" , shape=box]; [128X[104X
    [4X[28X2 [label="< 1 >", style=filled]; [128X[104X
    [4X[28X3 [label="< 2, 3 >", style=filled]; [128X[104X
    [4X[28X4 [label="< 2 > + < 3 >" , shape=box]; [128X[104X
    [4X[28X5 [label="< 1 >", style=filled]; [128X[104X
    [4X[28X6 [label="< 1 >", style=filled]; [128X[104X
    [4X[28X7 [label="< 4, 6 > + < 9 >" , shape=box]; [128X[104X
    [4X[28X8 [label="< 2, 3 >", style=filled]; [128X[104X
    [4X[28X10 [label="< 2 > + < 3 >" , shape=box]; [128X[104X
    [4X[28X11 [label="< 1 >", style=filled]; [128X[104X
    [4X[28X12 [label="< 1 >", style=filled]; [128X[104X
    [4X[28X9 [label="< 1 >", style=filled]; [128X[104X
    [4X[28X0 -> 1; [128X[104X
    [4X[28X1 -> 2; [128X[104X
    [4X[28X1 -> 3; [128X[104X
    [4X[28X3 -> 4; [128X[104X
    [4X[28X4 -> 5; [128X[104X
    [4X[28X4 -> 6; [128X[104X
    [4X[28X0 -> 7; [128X[104X
    [4X[28X7 -> 8; [128X[104X
    [4X[28X7 -> 9; [128X[104X
    [4X[28X8 -> 10; [128X[104X
    [4X[28X10 -> 11; [128X[104X
    [4X[28X10 -> 12; [128X[104X
    [4X[28X}[128X[104X
  [4X[32X[104X
  
  [1X16.1-3 DotOverSemigroupsNumericalSemigroup[101X
  
  [33X[1;0Y[29X[2XDotOverSemigroupsNumericalSemigroup[102X( [3XS[103X ) [32X function[133X
  
  [33X[0;0Y[10XS[110X  is  a  numerical  semigroup.  It  outputs  the  Hasse diagram (in dot) of
  oversemigroups  of  [10XS[110X.  Nodes  corresponding  to  irreducible semigroups are
  filled  in gray (pseudo-symmetric in dark gray). Edges are labelled with the
  special gap added.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xs:=NumericalSemigroup(4,6,9);;[127X[104X
    [4X[25Xgap>[125X [27XPrint(DotOverSemigroupsNumericalSemigroup(s));[127X[104X
    [4X[28Xdigraph  NSGraph{rankdir = TB; edge[dir=back]; node[shape=box,style=rounded][128X[104X
    [4X[28X1 [label="< 1 >", style="rounded,filled"];[128X[104X
    [4X[28X2 [label="< 2, 3 >", style="rounded,filled"];[128X[104X
    [4X[28X3 [label="< 2, 5 >", style="rounded,filled"];[128X[104X
    [4X[28X4 [label="< 2, 7 >", style="rounded,filled"];[128X[104X
    [4X[28X5 [label="< 2, 9 >", style="rounded,filled"];[128X[104X
    [4X[28X6 [label="< 3, 4, 5 >", style="rounded,filled", fillcolor="darkgray"];[128X[104X
    [4X[28X7 [label="< 3, 4 >", style="rounded,filled"];[128X[104X
    [4X[28X8 [label="< 4, 5, 6, 7 >"];[128X[104X
    [4X[28X9 [label="< 4, 5, 6 >", style="rounded,filled"];[128X[104X
    [4X[28X10 [label="< 4, 6, 7, 9 >"];[128X[104X
    [4X[28X11 [label="< 4, 6, 9, 11 >"];[128X[104X
    [4X[28X12 [label="< 4, 6, 9 >", style="rounded,filled"];[128X[104X
    [4X[28X1 -> 2 [label="1" fontsize=10];[128X[104X
    [4X[28X2 -> 3 [label="3" fontsize=10];[128X[104X
    [4X[28X2 -> 6 [label="2" fontsize=10];[128X[104X
    [4X[28X3 -> 4 [label="5" fontsize=10];[128X[104X
    [4X[28X3 -> 8 [label="2" fontsize=10];[128X[104X
    [4X[28X4 -> 5 [label="7" fontsize=10];[128X[104X
    [4X[28X4 -> 10 [label="2" fontsize=10];[128X[104X
    [4X[28X5 -> 11 [label="2" fontsize=10];[128X[104X
    [4X[28X6 -> 7 [label="5" fontsize=10];[128X[104X
    [4X[28X6 -> 8 [label="3" fontsize=10];[128X[104X
    [4X[28X7 -> 10 [label="3" fontsize=10];[128X[104X
    [4X[28X8 -> 9 [label="7" fontsize=10];[128X[104X
    [4X[28X8 -> 10 [label="5" fontsize=10];[128X[104X
    [4X[28X9 -> 11 [label="5" fontsize=10];[128X[104X
    [4X[28X10 -> 11 [label="7" fontsize=10];[128X[104X
    [4X[28X11 -> 12 [label="11" fontsize=10];[128X[104X
    [4X[28X}[128X[104X
  [4X[32X[104X
  
  [1X16.1-4 DotRosalesGraph[101X
  
  [33X[1;0Y[29X[2XDotRosalesGraph[102X( [3Xn[103X, [3XS[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XDotRosalesGraph[102X( [3Xn[103X, [3XS[103X ) [32X operation[133X
  
  [33X[0;0Y[10XS[110X  is  either  numerical or an affine semigroup and [10Xn[110X is an element in [10XS[110X. It
  outputs      the     graph     associated     to     [10Xn[110X     in     [10XS[110X     (see
  [2XGraphAssociatedToElementInNumericalSemigroup[102X ([14X4.1-2[114X)).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xs:=NumericalSemigroup(4,6,9);;[127X[104X
    [4X[25Xgap>[125X [27XPrint(DotRosalesGraph(15,s));[127X[104X
    [4X[28Xgraph  NSGraph{[128X[104X
    [4X[28X1 [label="6"];[128X[104X
    [4X[28X2 [label="9"];[128X[104X
    [4X[28X2 -- 1;[128X[104X
    [4X[28X}[128X[104X
  [4X[32X[104X
  
  [1X16.1-5 DotFactorizationGraph[101X
  
  [33X[1;0Y[29X[2XDotFactorizationGraph[102X( [3Xf[103X ) [32X operation[133X
  
  [33X[0;0Y[10Xf[110X  is  a set of factorizations. Returns the graph (in dot) of factorizations
  associated  to  [10Xf[110X:  a  complete  graph whose vertices are the elements of [10Xf[110X.
  Edges  are  labelled  with  distances  between  the nodes they join. Kruskal
  algorithm  is  used  to  draw in red a spanning tree with minimal distances.
  Thus the catenary degree is reached in the edges of the tree.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=FactorizationsIntegerWRTList(20,[3,5,7]);[127X[104X
    [4X[28X[ [ 5, 1, 0 ], [ 0, 4, 0 ], [ 1, 2, 1 ], [ 2, 0, 2 ] ][128X[104X
    [4X[25Xgap>[125X [27XPrint(DotFactorizationGraph(f));[127X[104X
    [4X[28Xgraph  NSGraph{[128X[104X
    [4X[28X1 [label=" (5, 1, 0)"];[128X[104X
    [4X[28X2 [label=" (0, 4, 0)"];[128X[104X
    [4X[28X3 [label=" (1, 2, 1)"];[128X[104X
    [4X[28X4 [label=" (2, 0, 2)"];[128X[104X
    [4X[28X2 -- 3[label="2", color="red"];[128X[104X
    [4X[28X3 -- 4[label="2", color="red"];[128X[104X
    [4X[28X1 -- 3[label="4", color="red"];[128X[104X
    [4X[28X1 -- 4[label="4" ];[128X[104X
    [4X[28X2 -- 4[label="4" ];[128X[104X
    [4X[28X1 -- 2[label="5" ];[128X[104X
    [4X[28X}[128X[104X
  [4X[32X[104X
  
  [1X16.1-6 DotEliahouGraph[101X
  
  [33X[1;0Y[29X[2XDotEliahouGraph[102X( [3Xf[103X ) [32X operation[133X
  
  [33X[0;0Y[10Xf[110X  is  a  set  of  factorizations.  Returns  the  Eliahou  graph (in dot) of
  factorizations  associated  to [10Xf[110X: a graph whose vertices are the elements of
  [10Xf[110X,  and  there  is an edge between two vertices if they have common support.
  Edges are labelled with distances between nodes they join.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf:=FactorizationsIntegerWRTList(20,[3,5,7]);[127X[104X
    [4X[28X[ [ 5, 1, 0 ], [ 0, 4, 0 ], [ 1, 2, 1 ], [ 2, 0, 2 ] ][128X[104X
    [4X[25Xgap>[125X [27XPrint(DotEliahouGraph(f));[127X[104X
    [4X[28Xgraph  NSGraph{[128X[104X
    [4X[28X1 [label=" (5, 1, 0)"];[128X[104X
    [4X[28X2 [label=" (0, 4, 0)"];[128X[104X
    [4X[28X3 [label=" (1, 2, 1)"];[128X[104X
    [4X[28X4 [label=" (2, 0, 2)"];[128X[104X
    [4X[28X2 -- 3[label="2" ];[128X[104X
    [4X[28X3 -- 4[label="2" ];[128X[104X
    [4X[28X1 -- 3[label="4" ];[128X[104X
    [4X[28X1 -- 4[label="4" ];[128X[104X
    [4X[28X1 -- 2[label="5" ];[128X[104X
    [4X[28X}[128X[104X
  [4X[32X[104X
  
  [1X16.1-7 SetDotNSEngine[101X
  
  [33X[1;0Y[29X[2XSetDotNSEngine[102X( [3Xengine[103X ) [32X function[133X
  
  [33X[0;0YThis  function sets the value of [10XDotNSEngine[110X to [10Xengine[110X, which must be any of
  the following "circo","dot","fdp","neato","osage","twopi". This tells viz.js
  which graphviz engine to use.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XSetDotNSEngine("circo");[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [33X[0;0YHere is an example with the default dot engine And one with circo engine[133X
  
  [1X16.1-8 DotSplash[101X
  
  [33X[1;0Y[29X[2XDotSplash[102X( [3Xdots...[103X ) [32X function[133X
  
  [33X[0;0YLaunches  a  browser and visualizes the dots diagrams provided as arguments.
  It  outputs  the html page displayed as a string, and prints the location of
  the temporary file that contains it.[133X
  
