  
  [1X3 [33X[0;0YCreating digraphs[133X[101X
  
  [33X[0;0YIn this chapter we describe how to create digraphs.[133X
  
  
  [1X3.1 [33X[0;0YCreating digraphs[133X[101X
  
  [1X3.1-1 IsDigraph[101X
  
  [33X[1;0Y[29X[2XIsDigraph[102X [32X Category[133X
  
  [33X[0;0YEvery  digraph  in  [5XDigraphs[105X  belongs  to the category [10XIsDigraph[110X. Some basic
  attributes   and   operations  for  digraphs  are  [2XDigraphVertices[102X  ([14X5.1-1[114X),
  [2XDigraphEdges[102X ([14X5.1-3[114X), and [2XOutNeighbours[102X ([14X5.2-6[114X).[133X
  
  [1X3.1-2 IsMutableDigraph[101X
  
  [33X[1;0Y[29X[2XIsMutableDigraph[102X [32X Category[133X
  
  [33X[0;0Y[10XIsMutableDigraph[110X   is   a   synonym  for  [2XIsDigraph[102X  ([14X3.1-1[114X)  and  [2XIsMutable[102X
  ([14XReference: IsMutable[114X). A mutable digraph may be changed in-place by methods
  in   the   [5XDigraphs[105X   package,   and   is   not   attribute-storing   –  see
  [2XIsAttributeStoringRep[102X ([14XReference: IsAttributeStoringRep[114X).[133X
  
  [33X[0;0YA  mutable  digraph  may  be  converted  into an immutable attribute-storing
  digraph by calling [2XMakeImmutable[102X ([14XReference: MakeImmutable[114X) on the digraph.[133X
  
  [1X3.1-3 IsImmutableDigraph[101X
  
  [33X[1;0Y[29X[2XIsImmutableDigraph[102X [32X Category[133X
  
  [33X[0;0Y[10XIsImmutableDigraph[110X  is a subcategory of [2XIsDigraph[102X ([14X3.1-1[114X). Digraphs that lie
  in  [10XIsImmutableDigraph[110X  are  immutable and attribute-storing. In particular,
  they lie in [2XIsAttributeStoringRep[102X ([14XReference: IsAttributeStoringRep[114X).[133X
  
  [33X[0;0YA  mutable digraph may be converted to an immutable digraph that lies in the
  category    [10XIsImmutableDigraph[110X    by   calling   [2XMakeImmutable[102X   ([14XReference:
  MakeImmutable[114X) on the digraph.[133X
  
  [33X[0;0YThe  operation [2XDigraphMutableCopy[102X ([14X3.3-1[114X) can be used to construct a mutable
  copy  of  an  immutable  digraph.  It  is however not possible to convert an
  immutable digraph into a mutable digraph in-place.[133X
  
  [1X3.1-4 IsCayleyDigraph[101X
  
  [33X[1;0Y[29X[2XIsCayleyDigraph[102X [32X Category[133X
  
  [33X[0;0Y[10XIsCayleyDigraph[110X  is  a  subcategory  of  [10XIsDigraph[110X. Digraphs that are Cayley
  digraphs  of a group and that are constructed by the operation [2XCayleyDigraph[102X
  ([14X3.1-12[114X) are constructed in this category, and are always immutable.[133X
  
  [1X3.1-5 IsDigraphWithAdjacencyFunction[101X
  
  [33X[1;0Y[29X[2XIsDigraphWithAdjacencyFunction[102X [32X Category[133X
  
  [33X[0;0Y[10XIsDigraphWithAdjacencyFunction[110X  is a subcategory of [10XIsDigraph[110X. Digraphs that
  are [13Xcreated[113X using an adjacency function are constructed in this category.[133X
  
  [1X3.1-6 DigraphByOutNeighboursType[101X
  
  [33X[1;0Y[29X[2XDigraphByOutNeighboursType[102X [32X global variable[133X
  [33X[1;0Y[29X[2XDigraphFamily[102X [32X family[133X
  
  [33X[0;0YThe  type  of  all digraphs is [10XDigraphByOutNeighboursType[110X. The family of all
  digraphs is [10XDigraphFamily[110X.[133X
  
  [1X3.1-7 Digraph[101X
  
  [33X[1;0Y[29X[2XDigraph[102X( [[3Xfilt[103X, ][3Xobj[103X[, [3Xsource[103X, [3Xrange[103X] ) [32X operation[133X
  [33X[1;0Y[29X[2XDigraph[102X( [[3Xfilt[103X, ][3Xlist[103X, [3Xfunc[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XDigraph[102X( [[3Xfilt[103X, ][3XG[103X, [3Xlist[103X, [3Xact[103X, [3Xadj[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [8Xfor a list (i.e. an adjacency list)[108X
        [33X[0;6Yif  [3Xobj[103X is a list of lists of positive integers in the range from [10X1[110X to
        [10XLength([3Xobj[103X[10X)[110X,  then this function returns the digraph with vertices [22XE ^
        0 =[122X[10X[1 .. Length([3Xobj[103X[10X)][110X, and edges corresponding to the entries of [3Xobj[103X.[133X
  
        [33X[0;6YMore  precisely,  there is an edge from vertex [10Xi[110X to [10Xj[110X if and only if [10Xj[110X
        is  in  [10X[3Xobj[103X[10X[i][110X;  the source of this edge is [10Xi[110X and the range is [10Xj[110X. If [10Xj[110X
        occurs in [10X[3Xobj[103X[10X[i][110X with multiplicity [10Xk[110X, then there are [10Xk[110X edges from [10Xi[110X to
        [10Xj[110X.[133X
  
  [8Xfor three lists[108X
        [33X[0;6Yif  [3Xobj[103X  is  a  duplicate-free list, and [3Xsource[103X and [3Xrange[103X are lists of
        equal  length  consisting  of  positive  integers  in  the  list [10X[1 ..
        Length([3Xobj[103X[10X)][110X, then this function returns a digraph with vertices [22XE ^ 0
        =[122X[10X[1  ..  Length([3Xobj[103X[10X)][110X,  and  [10XLength([3Xsource[103X[10X)[110X edges. For each [10Xi[110X in [10X[1 ..
        Length([3Xsource[103X[10X)][110X  there exists an edge with source vertex [10Xsource[i][110X and
        range  vertex  [10Xrange[i][110X.  See  [2XDigraphSource[102X  ([14X5.2-5[114X) and [2XDigraphRange[102X
        ([14X5.2-5[114X).[133X
  
        [33X[0;6YThe vertices of the digraph will be labelled by the elements of [3Xobj[103X.[133X
  
  [8Xfor an integer, and two lists[108X
        [33X[0;6Yif  [3Xobj[103X  is an integer, and [3Xsource[103X and [3Xrange[103X are lists of equal length
        consisting  of  positive  integers  in  the list [10X[1 .. [3Xobj[103X[10X][110X, then this
        function  returns  a  digraph  with  vertices  [22XE  ^ 0 =[122X[10X[1 .. [3Xobj[103X[10X][110X, and
        [10XLength([3Xsource[103X[10X)[110X edges. For each [10Xi[110X in [10X[1 .. Length([3Xsource[103X[10X)][110X there exists
        an  edge  with  source vertex [10Xsource[i][110X and range vertex [10Xrange[i][110X. See
        [2XDigraphSource[102X ([14X5.2-5[114X) and [2XDigraphRange[102X ([14X5.2-5[114X).[133X
  
  [8Xfor a list and a function[108X
        [33X[0;6Yif  [3Xlist[103X  is a list and [3Xfunc[103X is a function taking 2 arguments that are
        elements  of [3Xlist[103X, and [3Xfunc[103X returns [9Xtrue[109X or [9Xfalse[109X, then this operation
        creates  a  digraph with vertices [10X[1 .. Length([3Xlist[103X[10X)][110X and an edge from
        vertex  [10Xi[110X  to  vertex  [10Xj[110X if and only if [10X[3Xfunc[103X[10X([3Xlist[103X[10X[i], [3Xlist[103X[10X[j])[110X returns
        [9Xtrue[109X.[133X
  
  [8Xfor a group, a list, and two functions[108X
        [33X[0;6YThe arguments will be [3XG, list, act, adj[103X.[133X
  
        [33X[0;6YLet [3XG[103X be a group acting on the objects in [3Xlist[103X via the action [3Xact[103X, and
        let  [3Xadj[103X  be  a function taking two objects from [3Xlist[103X as arguments and
        returning  [10Xtrue[110X or [10Xfalse[110X. The function [3Xadj[103X will describe the adjacency
        between  objects  from [3Xlist[103X, which is invariant under the action of [3XG[103X.
        This  variant  of  the constructor returns a digraph with vertices the
        objects of [3Xlist[103X and directed edges [10X[x, y][110X when [10Xf(x, y)[110X is [10Xtrue[110X.[133X
  
        [33X[0;6YThe  action  of  the  group  [3XG[103X on the objects in [3Xlist[103X is stored in the
        attribute  [2XDigraphGroup[102X  ([14X7.2-10[114X),  and is used to speed up operations
        like [2XDigraphDiameter[102X ([14X5.3-1[114X).[133X
  
  [8Xfor a Grape package graph[108X
        [33X[0;6Yif  [3Xobj[103X is a [5XGrape[105X package graph (i.e. a record for which the function
        [10XIsGraph[110X returns [9Xtrue[109X), then this function returns a digraph isomorphic
        to [3Xobj[103X.[133X
  
  [8Xfor a binary relation[108X
        [33X[0;6Yif  [3Xobj[103X  is a binary relation on the points [10X[1 .. n][110X for some positive
        integer  [22Xn[122X,  then  this  function  returns the digraph defined by [3Xobj[103X.
        Specifically,  this  function  returns a digraph which has [22Xn[122X vertices,
        and  which  has an edge with source [10Xi[110X and range [10Xj[110X if and only if [10X[i,j][110X
        is a pair in the binary relation [3Xobj[103X.[133X
  
  [8Xfor a string naming a digraph[108X
        [33X[0;6Yif  [3Xobj[103X  is a non-empty string, then this function returns the digraph
        that  has  name  [3Xobj[103X.  [5XDigraphs[105X comes with a database containing a few
        hundred  common  digraph  names  that can be loaded in this way. Valid
        names  include  [10X"folkman"[110X,  [10X"diamond"[110X  and [10X"brinkmann"[110X. If the name is
        commonly  followed  by  the  word  [10X"graph"[110X,  then it is called without
        writing  [10X"graph"[110X at the end. You can explore the available graph names
        using   [2XListNamedDigraphs[102X   ([14X3.1-13[114X).   Digraph  names  are  case  and
        whitespace insensitive.[133X
  
        [33X[0;6YNote  that  any  undirected  graphs  in  the  database  are  stored as
        symmetric  digraphs,  so the resulting digraph will have twice as many
        edges as its undirected counterpart.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xgr := Digraph([[127X[104X
    [4X[25X>[125X [27X[2, 5, 8, 10], [2, 3, 4, 2, 5, 6, 8, 9, 10], [1],[127X[104X
    [4X[25X>[125X [27X[3, 5, 7, 8, 10], [2, 5, 7], [3, 6, 7, 9, 10], [1, 4],[127X[104X
    [4X[25X>[125X [27X[1, 5, 9], [1, 2, 7, 8], [3, 5]]);[127X[104X
    [4X[28X<immutable multidigraph with 10 vertices, 38 edges>[128X[104X
    [4X[25Xgap>[125X [27Xgr := Digraph(["a", "b", "c"], ["a"], ["b"]);[127X[104X
    [4X[28X<immutable digraph with 3 vertices, 1 edge>[128X[104X
    [4X[25Xgap>[125X [27Xgr := Digraph(5, [1, 2, 2, 4, 1, 1], [2, 3, 5, 5, 1, 1]);[127X[104X
    [4X[28X<immutable multidigraph with 5 vertices, 6 edges>[128X[104X
    [4X[25Xgap>[125X [27XPetersen := Graph(SymmetricGroup(5), [[1, 2]], OnSets,[127X[104X
    [4X[25X>[125X [27Xfunction(x, y) return Intersection(x, y) = []; end);;[127X[104X
    [4X[25Xgap>[125X [27XDigraph(Petersen);[127X[104X
    [4X[28X<immutable digraph with 10 vertices, 30 edges>[128X[104X
    [4X[25Xgap>[125X [27Xgr := Digraph([1 .. 10], ReturnTrue);[127X[104X
    [4X[28X<immutable digraph with 10 vertices, 100 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraph("Diamond");[127X[104X
    [4X[28X<immutable digraph with 4 vertices, 10 edges>[128X[104X
  [4X[32X[104X
  
  [33X[0;0YThe  next  example  illustrates the uses of the fourth and fifth variants of
  this  constructor. The resulting digraph is a strongly regular graph, and it
  is  actually  the  point  graph  of the van Lint-Schrijver partial geometry,
  [vLS81].  The  algebraic  description  is  taken  from  the seminal paper of
  Calderbank and Kantor [CK86].[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf := GF(3 ^ 4);[127X[104X
    [4X[28XGF(3^4)[128X[104X
    [4X[25Xgap>[125X [27Xgamma := First(f, x -> Order(x) = 5);[127X[104X
    [4X[28XZ(3^4)^64[128X[104X
    [4X[25Xgap>[125X [27XL := Union([Zero(f)], List(Group(gamma)));[127X[104X
    [4X[28X[ 0*Z(3), Z(3)^0, Z(3^4)^16, Z(3^4)^32, Z(3^4)^48, Z(3^4)^64 ][128X[104X
    [4X[25Xgap>[125X [27Xomega := Union(List(L, x -> List(Difference(L, [x]), y -> x - y)));[127X[104X
    [4X[28X[ Z(3)^0, Z(3), Z(3^4)^5, Z(3^4)^7, Z(3^4)^8, Z(3^4)^13, Z(3^4)^15, [128X[104X
    [4X[28X  Z(3^4)^16, Z(3^4)^21, Z(3^4)^23, Z(3^4)^24, Z(3^4)^29, Z(3^4)^31, [128X[104X
    [4X[28X  Z(3^4)^32, Z(3^4)^37, Z(3^4)^39, Z(3^4)^45, Z(3^4)^47, Z(3^4)^48, [128X[104X
    [4X[28X  Z(3^4)^53, Z(3^4)^55, Z(3^4)^56, Z(3^4)^61, Z(3^4)^63, Z(3^4)^64, [128X[104X
    [4X[28X  Z(3^4)^69, Z(3^4)^71, Z(3^4)^72, Z(3^4)^77, Z(3^4)^79 ][128X[104X
    [4X[25Xgap>[125X [27Xadj := function(x, y)[127X[104X
    [4X[25X>[125X [27X  return x - y in omega;[127X[104X
    [4X[25X>[125X [27Xend;[127X[104X
    [4X[28Xfunction( x, y ) ... end[128X[104X
    [4X[25Xgap>[125X [27Xdigraph := Digraph(AsList(f), adj);[127X[104X
    [4X[28X<immutable digraph with 81 vertices, 2430 edges>[128X[104X
    [4X[25Xgap>[125X [27Xgroup := Group(Z(3));;[127X[104X
    [4X[25Xgap>[125X [27Xact := \*;[127X[104X
    [4X[28X<Operation "*">[128X[104X
    [4X[25Xgap>[125X [27Xdigraph := Digraph(group, List(f), act, adj);[127X[104X
    [4X[28X<immutable digraph with 81 vertices, 2430 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.1-8 DigraphByAdjacencyMatrix[101X
  
  [33X[1;0Y[29X[2XDigraphByAdjacencyMatrix[102X( [[3Xfilt[103X, ][3Xlist[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [33X[0;0YIf [3Xlist[103X is the adjacency matrix of a digraph in the sense of [2XAdjacencyMatrix[102X
  ([14X5.2-1[114X), then this operation returns the digraph which is defined by [3Xlist[103X.[133X
  
  [33X[0;0YAlternatively,  if  [3Xlist[103X  is  a  square  boolean matrix, then this operation
  returns  the  digraph with [10XLength([110X[3Xlist[103X[10X)[110X vertices which has the edge [10X[i,j][110X if
  and only if [3Xlist[103X[10X[i][j][110X is [9Xtrue[109X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XDigraphByAdjacencyMatrix([[127X[104X
    [4X[25X>[125X [27X[0, 1, 0, 2, 0],[127X[104X
    [4X[25X>[125X [27X[1, 1, 1, 0, 1],[127X[104X
    [4X[25X>[125X [27X[0, 3, 2, 1, 1],[127X[104X
    [4X[25X>[125X [27X[0, 0, 1, 0, 1],[127X[104X
    [4X[25X>[125X [27X[2, 0, 0, 0, 0]]);[127X[104X
    [4X[28X<immutable multidigraph with 5 vertices, 18 edges>[128X[104X
    [4X[25Xgap>[125X [27XD := DigraphByAdjacencyMatrix([[127X[104X
    [4X[25X>[125X [27X[true, false, true],[127X[104X
    [4X[25X>[125X [27X[false, false, true],[127X[104X
    [4X[25X>[125X [27X[false, true, false]]);[127X[104X
    [4X[28X<immutable digraph with 3 vertices, 4 edges>[128X[104X
    [4X[25Xgap>[125X [27XOutNeighbours(D);[127X[104X
    [4X[28X[ [ 1, 3 ], [ 3 ], [ 2 ] ][128X[104X
    [4X[25Xgap>[125X [27XD := DigraphByAdjacencyMatrix(IsMutableDigraph, [127X[104X
    [4X[25X>[125X [27X[[true, false, true],[127X[104X
    [4X[25X>[125X [27X [false, false, true],[127X[104X
    [4X[25X>[125X [27X [false, true, false]]);[127X[104X
    [4X[28X<mutable digraph with 3 vertices, 4 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.1-9 DigraphByEdges[101X
  
  [33X[1;0Y[29X[2XDigraphByEdges[102X( [[3Xfilt[103X, ][3Xlist[103X[, [3Xn[103X] ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [33X[0;0YIf  [3Xlist[103X  is  list of pairs of positive integers, then this function returns
  the  digraph  with the minimum number of vertices [10Xm[110X such that its list equal
  [3Xlist[103X.[133X
  
  [33X[0;0YIf  the optional second argument [3Xn[103X is a positive integer with [10X[3Xn[103X[10X >= m[110X (with [10Xm[110X
  defined  as  above),  then this function returns the digraph with [3Xn[103X vertices
  and list [3Xlist[103X.[133X
  
  [33X[0;0YSee [2XDigraphEdges[102X ([14X5.1-3[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XDigraphByEdges([127X[104X
    [4X[25X>[125X [27X[[1, 3], [2, 1], [2, 3], [2, 5], [3, 6],[127X[104X
    [4X[25X>[125X [27X [4, 6], [5, 2], [5, 4], [5, 6], [6, 6]]);[127X[104X
    [4X[28X<immutable digraph with 6 vertices, 10 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphByEdges([127X[104X
    [4X[25X>[125X [27X[[1, 3], [2, 1], [2, 3], [2, 5], [3, 6],[127X[104X
    [4X[25X>[125X [27X [4, 6], [5, 2], [5, 4], [5, 6], [6, 6]], 12);[127X[104X
    [4X[28X<immutable digraph with 12 vertices, 10 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphByEdges(IsMutableDigraph, [127X[104X
    [4X[25X>[125X [27X[[1, 3], [2, 1], [2, 3], [2, 5], [3, 6],[127X[104X
    [4X[25X>[125X [27X [4, 6], [5, 2], [5, 4], [5, 6], [6, 6]], 12);[127X[104X
    [4X[28X<mutable digraph with 12 vertices, 10 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.1-10 EdgeOrbitsDigraph[101X
  
  [33X[1;0Y[29X[2XEdgeOrbitsDigraph[102X( [3XG[103X, [3Xedges[103X[, [3Xn[103X] ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YAn immutable digraph.[133X
  
  [33X[0;0YIf  [3XG[103X  is a permutation group, [3Xedges[103X is an edge or list of edges, and [3Xn[103X is a
  non-negative integer such that [3XG[103X fixes [10X[1 .. [3Xn[103X[10X][110X setwise, then this operation
  returns  an immutable digraph with [3Xn[103X vertices and the union of the orbits of
  the edges in [3X edges [103X under the action of the permutation group [3XG[103X. An edge in
  this context is simply a pair of positive integers.[133X
  
  [33X[0;0YIf  the  optional  third  argument  [3Xn[103X is not present, then the largest moved
  point of the permutation group [3XG[103X is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xdigraph := EdgeOrbitsDigraph(Group((1, 3), (1, 2)(3, 4)),[127X[104X
    [4X[25X>[125X [27X                                [[1, 2], [4, 5]], 5);[127X[104X
    [4X[28X<immutable digraph with 5 vertices, 12 edges>[128X[104X
    [4X[25Xgap>[125X [27XOutNeighbours(digraph);[127X[104X
    [4X[28X[ [ 2, 4, 5 ], [ 1, 3, 5 ], [ 2, 4, 5 ], [ 1, 3, 5 ], [  ] ][128X[104X
    [4X[25Xgap>[125X [27XRepresentativeOutNeighbours(digraph);[127X[104X
    [4X[28X[ [ 2, 4, 5 ], [  ] ][128X[104X
  [4X[32X[104X
  
  [1X3.1-11 DigraphByInNeighbours[101X
  
  [33X[1;0Y[29X[2XDigraphByInNeighbours[102X( [[3Xfilt[103X, ][3Xlist[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XDigraphByInNeighbors[102X( [[3Xfilt[103X, ][3Xlist[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [33X[0;0YIf  [3Xlist[103X  is  a  list  of  lists  of  positive integers list the range [10X[1 ..
  Length([3Xlist[103X[10X)][110X,  then  this function returns the digraph with vertices [22XE^0=[122X[10X[1
  ..  Length([3Xlist[103X[10X)][110X,  and  edges  corresponding  to  the entries of [3Xlist[103X. More
  precisely,  there is an edge with source vertex [10Xi[110X and range vertex [10Xj[110X if [10Xi[110X is
  in the list [10X[3Xlist[103X[10X[j][110X.[133X
  
  [33X[0;0YIf  [10Xi[110X  occurs  in  the  list  [10X[3Xlist[103X[10X[j][110X  with multiplicity [10Xk[110X, then there are [10Xk[110X
  multiple edges from [10Xi[110X to [10Xj[110X.[133X
  
  [33X[0;0YSee [2XInNeighbours[102X ([14X5.2-7[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := DigraphByInNeighbours([[127X[104X
    [4X[25X>[125X [27X[2, 5, 8, 10], [2, 3, 4, 5, 6, 8, 9, 10],[127X[104X
    [4X[25X>[125X [27X[1], [3, 5, 7, 8, 10], [2, 5, 7], [3, 6, 7, 9, 10], [1, 4],[127X[104X
    [4X[25X>[125X [27X[1, 5, 9], [1, 2, 7, 8], [3, 5]]);[127X[104X
    [4X[28X<immutable digraph with 10 vertices, 37 edges>[128X[104X
    [4X[25Xgap>[125X [27XD := DigraphByInNeighbours([[2, 3, 2], [1], [1, 2, 3]]);[127X[104X
    [4X[28X<immutable multidigraph with 3 vertices, 7 edges>[128X[104X
    [4X[25Xgap>[125X [27XD := DigraphByInNeighbours(IsMutableDigraph, [127X[104X
    [4X[25X>[125X [27X                              [[2, 3, 2], [1], [1, 2, 3]]);[127X[104X
    [4X[28X<mutable multidigraph with 3 vertices, 7 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.1-12 CayleyDigraph[101X
  
  [33X[1;0Y[29X[2XCayleyDigraph[102X( [3XG[103X[, [3Xgens[103X] ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YAn immutable digraph.[133X
  
  [33X[0;0YLet  [3XG[103X  be any group and let [3Xgens[103X be a list of elements of [3XG[103X. This operation
  returns  an immutable digraph that corresponds to the Cayley graph of [3XG[103X with
  respect to [3Xgens[103X.[133X
  
  [33X[0;0YThe  vertices  of  the digraph correspond to the elements of [3XG[103X, in the order
  given  by  [10XAsList([3XG[103X[10X)[110X.  There exists an edge from vertex [10Xu[110X to vertex [10Xv[110X if and
  only  if  there  exists  a  generator [10Xg[110X in [3Xgens[103X such that [10XAsList([3XG[103X[10X)[u] * g =
  AsList([3XG[103X[10X)[v][110X.[133X
  
  [33X[0;0YThe  labels  of the vertices [10Xu[110X, [10Xv[110X, and the edge [10X[u, v][110X are the corresponding
  elements  [10XAsList([3XG[103X[10X)[u][110X,  [10XAsList([3XG[103X[10X)[v][110X,  and  generator  [10Xg[110X, respectively; see
  [2XDigraphVertexLabel[102X ([14X5.1-9[114X) and [2XDigraphEdgeLabel[102X ([14X5.1-11[114X).[133X
  
  [33X[0;0YIf  the optional second argument [3Xgens[103X is not present, then the generators of
  [3XG[103X are used by default.[133X
  
  [33X[0;0YThe   digraph   created   by   this   operation   belongs  to  the  category
  [2XIsCayleyDigraph[102X ([14X3.1-4[114X), the group [3XG[103X can be recovered from the digraph using
  [2XGroupOfCayleyDigraph[102X  ([14X5.4-1[114X), and the generators [3Xgens[103X can be obtained using
  [2XGeneratorsOfCayleyDigraph[102X ([14X5.4-2[114X).[133X
  
  [33X[0;0YNote that this function can only return an immutable digraph.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XG := DihedralGroup(8);[127X[104X
    [4X[28X<pc group of size 8 with 3 generators>[128X[104X
    [4X[25Xgap>[125X [27XCayleyDigraph(G);[127X[104X
    [4X[28X<immutable digraph with 8 vertices, 24 edges>[128X[104X
    [4X[25Xgap>[125X [27XG := DihedralGroup(IsPermGroup, 8);[127X[104X
    [4X[28XGroup([ (1,2,3,4), (2,4) ])[128X[104X
    [4X[25Xgap>[125X [27XCayleyDigraph(G);[127X[104X
    [4X[28X<immutable digraph with 8 vertices, 16 edges>[128X[104X
    [4X[25Xgap>[125X [27Xdigraph := CayleyDigraph(G, [()]);[127X[104X
    [4X[28X<immutable digraph with 8 vertices, 8 edges>[128X[104X
    [4X[25Xgap>[125X [27XGroupOfCayleyDigraph(digraph) = G;[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XGeneratorsOfCayleyDigraph(digraph);[127X[104X
    [4X[28X[ () ][128X[104X
  [4X[32X[104X
  
  [1X3.1-13 ListNamedDigraphs[101X
  
  [33X[1;0Y[29X[2XListNamedDigraphs[102X( [3Xs[103X[, [3Xlevel[103X] ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA list of strings representing digraph names.[133X
  
  [33X[0;0YThis  function  searches through the list of names that are currently in the
  [5XDigraphs[105X  database  of  named  digraphs.  The  first  argument [3Xs[103X should be a
  partially completed string; this function returns all completions [10Xstr[110X of the
  string [3Xs[103X such that [10XDigraph(str)[110X will successfully return a digraph.[133X
  
  [33X[0;0YThe  optional  second argument [3Xlevel[103X controls the flexibility of the search.
  If  [10X[3Xlevel[103X[10X  =  1[110X, then only strings beginning exactly with [3Xs[103X are returned. If
  [10X[3Xlevel[103X[10X = 2[110X, then all names containing [3Xs[103X as a substring are returned. If [10X[3Xlevel[103X[10X
  =  3[110X, then once again a substring search is carried out, but characters that
  are not alphanumeric are ignored in the search.[133X
  
  [33X[0;0YIf [3Xlevel[103X is not specified, it is set by default to equal 2.[133X
  
  [33X[0;0YThe  search  is always case and whitespace insensitive, and this is also the
  case when applying [2XDigraph[102X ([14X3.1-7[114X) to a string.[133X
  
  
  [1X3.2 [33X[0;0YChanging representations[133X[101X
  
  [1X3.2-1 AsBinaryRelation[101X
  
  [33X[1;0Y[29X[2XAsBinaryRelation[102X( [3Xdigraph[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA binary relation.[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  is  a  digraph  with  a  positive  number of vertices [22Xn[122X, and no
  multiple  edges, then this operation returns a binary relation on the points
  [10X[1..n][110X.  The pair [10X[i,j][110X is in the binary relation if and only if [10X[i,j][110X is an
  edge in [3Xdigraph[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := Digraph([[3, 2], [1, 2], [2], [3, 4]]);[127X[104X
    [4X[28X<immutable digraph with 4 vertices, 7 edges>[128X[104X
    [4X[25Xgap>[125X [27XAsBinaryRelation(D);[127X[104X
    [4X[28XBinary Relation on 4 points[128X[104X
  [4X[32X[104X
  
  [1X3.2-2 AsDigraph[101X
  
  [33X[1;0Y[29X[2XAsDigraph[102X( [[3Xfilt[103X, ][3Xf[103X[, [3Xn[103X] ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph, or [9Xfail[109X.[133X
  
  [33X[0;0YIf  [3Xf[103X  is  a  transformation or permutation, and [3Xn[103X is a non-negative integer
  such  that the restriction of [3Xf[103X to [10X[1..[3Xn[103X[10X][110X defines a function of [10X[1..[3Xn[103X[10X][110X, then
  [10XAsDigraph[110X  returns  the functional digraph with [3Xn[103X vertices defined by [3Xf[103X. See
  [2XIsFunctionalDigraph[102X ([14X6.1-9[114X).[133X
  
  [33X[0;0YSpecifically, the digraph returned by [10XAsDigraph[110X has [3Xn[103X edges: for each vertex
  [10Xv[110X in [10X[1..[3Xn[103X[10X][110X, there is a unique edge with source [10Xv[110X; this edge has range [10Xv^[3Xf[103X[10X[110X.[133X
  
  [33X[0;0YIf  the  optional  second argument [3Xn[103X is not supplied, then the degree of the
  transformation  [3Xf[103X,  or  the  largest  moved  point  of the permutation [3Xf[103X, as
  applicable,  is  used by default. If the restriction of [3Xf[103X to [10X[1..[3Xn[103X[10X][110X does not
  define a function of [10X[1..[3Xn[103X[10X][110X, then [10XAsDigraph([3Xf[103X[10X, [3Xn[103X[10X)[110X returns [9Xfail[109X.[133X
  
  [33X[0;0YSee also [2XAsTransformation[102X ([14X3.2-5[114X).[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xf := Transformation([4, 3, 3, 1, 7, 9, 10, 4, 2, 3]);[127X[104X
    [4X[28XTransformation( [ 4, 3, 3, 1, 7, 9, 10, 4, 2, 3 ] )[128X[104X
    [4X[25Xgap>[125X [27XAsDigraph(f);[127X[104X
    [4X[28X<immutable functional digraph with 10 vertices>[128X[104X
    [4X[25Xgap>[125X [27XAsDigraph(f, 4);[127X[104X
    [4X[28X<immutable functional digraph with 4 vertices>[128X[104X
    [4X[25Xgap>[125X [27XAsDigraph(f, 5);[127X[104X
    [4X[28Xfail[128X[104X
    [4X[25Xgap>[125X [27XAsDigraph((1, 2, 3, 4)) = CycleDigraph(4);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XD := AsDigraph(IsMutableDigraph, (1, 3)(2, 4), 5);[127X[104X
    [4X[28X<mutable digraph with 5 vertices, 5 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphEdges(D);[127X[104X
    [4X[28X[ [ 1, 3 ], [ 2, 4 ], [ 3, 1 ], [ 4, 2 ], [ 5, 5 ] ][128X[104X
    [4X[25Xgap>[125X [27Xb := BinaryRelationOnPoints([127X[104X
    [4X[25X>[125X [27X[[3], [1, 3, 5], [1], [1, 2, 4], [2, 3, 5]]);[127X[104X
    [4X[28XBinary Relation on 5 points[128X[104X
    [4X[25Xgap>[125X [27XD := AsDigraph(b);[127X[104X
    [4X[28X<immutable digraph with 5 vertices, 11 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.2-3 Graph[101X
  
  [33X[1;0Y[29X[2XGraph[102X( [3Xdigraph[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA [5XGrape[105X package graph.[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  is  a mutable or immutable digraph without multiple edges, then
  this operation returns a [5XGrape[105X package graph that is isomorphic to [3Xdigraph[103X.[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  is  a  multidigraph, then since [5XGrape[105X does not support multiple
  edges, the multiple edges will be reduced to a single edge in the result. In
  order  words,  for  a  multidigraph  this  operation will return the same as
  [10XGraph(DigraphRemoveAllMultipleEdges([110X[3Xdigraph[103X[10X))[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XPetersen := Graph(SymmetricGroup(5), [[1, 2]], OnSets,[127X[104X
    [4X[25X>[125X [27Xfunction(x, y) return Intersection(x, y) = []; end);;[127X[104X
    [4X[25Xgap>[125X [27XDisplay(Petersen);[127X[104X
    [4X[28Xrec([128X[104X
    [4X[28X  adjacencies := [ [ 3, 5, 8 ] ],[128X[104X
    [4X[28X  group := [128X[104X
    [4X[28X   Group( [ ( 1, 2, 3, 5, 7)( 4, 6, 8, 9,10), ( 2, 4)( 6, 9)( 7,10) [128X[104X
    [4X[28X     ] ),[128X[104X
    [4X[28X  isGraph := true,[128X[104X
    [4X[28X  names := [ [ 1, 2 ], [ 2, 3 ], [ 3, 4 ], [ 1, 3 ], [ 4, 5 ], [128X[104X
    [4X[28X      [ 2, 4 ], [ 1, 5 ], [ 3, 5 ], [ 1, 4 ], [ 2, 5 ] ],[128X[104X
    [4X[28X  order := 10,[128X[104X
    [4X[28X  representatives := [ 1 ],[128X[104X
    [4X[28X  schreierVector := [ -1, 1, 1, 2, 1, 1, 1, 1, 2, 2 ] )[128X[104X
    [4X[25Xgap>[125X [27XDigraph(Petersen);[127X[104X
    [4X[28X<immutable digraph with 10 vertices, 30 edges>[128X[104X
    [4X[25Xgap>[125X [27XGraph(last) = Petersen;[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.2-4 AsGraph[101X
  
  [33X[1;0Y[29X[2XAsGraph[102X( [3Xdigraph[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10YA [5XGrape[105X package graph.[133X
  
  [33X[0;0YIf [3Xdigraph[103X is a digraph, then this method returns the same as [2XGraph[102X ([14X3.2-3[114X),
  except  that  if  [3Xdigraph[103X  is immutable, then the result will be stored as a
  mutable  attribute of [3Xdigraph[103X. In this latter case, when [10XAsGraph([110X[3Xdigraph[103X[10X)[110X is
  called subsequently, the same [5XGAP[105X object will be returned as before.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := Digraph([[1, 2], [3], []]);[127X[104X
    [4X[28X<immutable digraph with 3 vertices, 3 edges>[128X[104X
    [4X[25Xgap>[125X [27XG := AsGraph(D);[127X[104X
    [4X[28Xrec( adjacencies := [ [ 1, 2 ], [ 3 ], [  ] ], group := Group(()), [128X[104X
    [4X[28X  isGraph := true, names := [ 1 .. 3 ], order := 3, [128X[104X
    [4X[28X  representatives := [ 1, 2, 3 ], schreierVector := [ -1, -2, -3 ] )[128X[104X
  [4X[32X[104X
  
  [1X3.2-5 AsTransformation[101X
  
  [33X[1;0Y[29X[2XAsTransformation[102X( [3Xdigraph[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10YA transformation, or [9Xfail[109X[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  is  a  functional  digraph,  then  [10XAsTransformation[110X returns the
  transformation which is defined by [3Xdigraph[103X. See [2XIsFunctionalDigraph[102X ([14X6.1-9[114X).
  Otherwise, [10XAsTransformation([110X[3Xdigraph[103X[10X)[110X returns [9Xfail[109X.[133X
  
  [33X[0;0YIf    [3Xdigraph[103X    is   a   functional   digraph   with   [22Xn[122X   vertices,   then
  [10XAsTransformation([110X[3Xdigraph[103X[10X)[110X will return the transformation [10Xf[110X of degree at most
  [22Xn[122X  where  for  each [22X1 ≤ i ≤ n[122X, [10Xi ^ f[110X is equal to the unique out-neighbour of
  vertex [10Xi[110X in [3Xdigraph[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := Digraph([[1], [3], [2]]);[127X[104X
    [4X[28X<immutable digraph with 3 vertices, 3 edges>[128X[104X
    [4X[25Xgap>[125X [27XAsTransformation(D);[127X[104X
    [4X[28XTransformation( [ 1, 3, 2 ] )[128X[104X
    [4X[25Xgap>[125X [27XD := CycleDigraph(IsMutableDigraph, 3);[127X[104X
    [4X[28X<mutable digraph with 3 vertices, 3 edges>[128X[104X
    [4X[25Xgap>[125X [27XAsTransformation(D);[127X[104X
    [4X[28XTransformation( [ 2, 3, 1 ] )[128X[104X
    [4X[25Xgap>[125X [27XAsPermutation(last);[127X[104X
    [4X[28X(1,2,3)[128X[104X
    [4X[25Xgap>[125X [27XD := Digraph([[2, 3], [], []]);[127X[104X
    [4X[28X<immutable digraph with 3 vertices, 2 edges>[128X[104X
    [4X[25Xgap>[125X [27XAsTransformation(D);[127X[104X
    [4X[28Xfail[128X[104X
  [4X[32X[104X
  
  
  [1X3.3 [33X[0;0YNew digraphs from old[133X[101X
  
  [1X3.3-1 DigraphImmutableCopy[101X
  
  [33X[1;0Y[29X[2XDigraphImmutableCopy[102X( [3Xdigraph[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XDigraphMutableCopy[102X( [3Xdigraph[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XDigraphCopySameMutability[102X( [3Xdigraph[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XDigraphCopy[102X( [3Xdigraph[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YEach  of  these operations returns a new copy of [3Xdigraph[103X, of the appropriate
  mutability, retaining none of the attributes or properties of [3Xdigraph[103X.[133X
  
  [33X[0;0Y[10XDigraphCopy[110X is a synonym for [10XDigraphCopySameMutability[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := CycleDigraph(10);[127X[104X
    [4X[28X<immutable cycle digraph with 10 vertices>[128X[104X
    [4X[25Xgap>[125X [27XDigraphCopy(D) = D;[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsIdenticalObj(DigraphCopy(D), D);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XDigraphMutableCopy(D);[127X[104X
    [4X[28X<mutable digraph with 10 vertices, 10 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.3-2 DigraphImmutableCopyIfImmutable[101X
  
  [33X[1;0Y[29X[2XDigraphImmutableCopyIfImmutable[102X( [3Xdigraph[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XDigraphImmutableCopyIfMutable[102X( [3Xdigraph[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XDigraphMutableCopyIfMutable[102X( [3Xdigraph[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XDigraphMutableCopyIfImmutable[102X( [3Xdigraph[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YEach  of these operations returns either the original argument [3Xdigraph[103X, or a
  new  copy  of  [3Xdigraph[103X  of  the  appropriate  mutability,  according  to the
  mutability of [3Xdigraph[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XC := CycleDigraph(10);[127X[104X
    [4X[28X<immutable cycle digraph with 10 vertices>[128X[104X
    [4X[25Xgap>[125X [27XD := DigraphImmutableCopyIfImmutable(C);[127X[104X
    [4X[28X<immutable digraph with 10 vertices, 10 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsIdenticalObj(C, D);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XC = D;[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XD := DigraphImmutableCopyIfMutable(C);[127X[104X
    [4X[28X<immutable cycle digraph with 10 vertices>[128X[104X
    [4X[25Xgap>[125X [27XIsIdenticalObj(C, D);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XC = D;[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XD := DigraphMutableCopyIfMutable(C);[127X[104X
    [4X[28X<immutable cycle digraph with 10 vertices>[128X[104X
    [4X[25Xgap>[125X [27XIsMutableDigraph(D);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XD := DigraphMutableCopyIfImmutable(C);[127X[104X
    [4X[28X<mutable digraph with 10 vertices, 10 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsMutableDigraph(D);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XC := CycleDigraph(IsMutableDigraph, 10);[127X[104X
    [4X[28X<mutable digraph with 10 vertices, 10 edges>[128X[104X
    [4X[25Xgap>[125X [27XD := DigraphImmutableCopyIfImmutable(C);[127X[104X
    [4X[28X<mutable digraph with 10 vertices, 10 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsIdenticalObj(C, D);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XC = D;[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XD := DigraphImmutableCopyIfMutable(C);[127X[104X
    [4X[28X<immutable digraph with 10 vertices, 10 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsIdenticalObj(C, D);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XC = D;[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XD := DigraphMutableCopyIfMutable(C);[127X[104X
    [4X[28X<mutable digraph with 10 vertices, 10 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsMutableDigraph(D);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XD := DigraphMutableCopyIfImmutable(C);[127X[104X
    [4X[28X<mutable digraph with 10 vertices, 10 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsIdenticalObj(C, D);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsMutableDigraph(D);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.3-3 InducedSubdigraph[101X
  
  [33X[1;0Y[29X[2XInducedSubdigraph[102X( [3Xdigraph[103X, [3Xverts[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  is a digraph, and [3Xverts[103X is a subset of the vertices of [3Xdigraph[103X,
  then  this operation returns a digraph constructed from [3Xdigraph[103X by retaining
  precisely  those  vertices  in [3Xverts[103X, and those edges whose source and range
  vertices are both contained in [3Xverts[103X.[133X
  
  [33X[0;0YThe  vertices  of  the  induced  subdigraph  are  [10X[1..Length(verts)][110X but the
  original vertex labels can be accessed via [2XDigraphVertexLabels[102X ([14X5.1-10[114X).[133X
  
  [33X[0;0YIf  [3Xdigraph[103X belongs to [2XIsMutableDigraph[102X ([14X3.1-2[114X), then [3Xdigraph[103X is modified in
  place.  If  [3Xdigraph[103X  belongs  to [2XIsImmutableDigraph[102X ([14X3.1-3[114X), a new immutable
  digraph containing the appropriate vertices and edges is returned.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := Digraph([[1, 1, 2, 3, 4, 4], [1, 3, 4], [3, 1], [1, 1]]);[127X[104X
    [4X[28X<immutable multidigraph with 4 vertices, 13 edges>[128X[104X
    [4X[25Xgap>[125X [27XInducedSubdigraph(D, [1, 3, 4]);[127X[104X
    [4X[28X<immutable multidigraph with 3 vertices, 9 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphVertices(last);[127X[104X
    [4X[28X[ 1 .. 3 ][128X[104X
    [4X[25Xgap>[125X [27XD := DigraphMutableCopy(D);[127X[104X
    [4X[28X<mutable multidigraph with 4 vertices, 13 edges>[128X[104X
    [4X[25Xgap>[125X [27Xnew := InducedSubdigraph(D, [1, 3, 4]);[127X[104X
    [4X[28X<mutable multidigraph with 3 vertices, 9 edges>[128X[104X
    [4X[25Xgap>[125X [27XD = new;[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.3-4 ReducedDigraph[101X
  
  [33X[1;0Y[29X[2XReducedDigraph[102X( [3Xdigraph[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XReducedDigraphAttr[102X( [3Xdigraph[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YThis  function  returns  a  digraph  isomorphic to the subdigraph of [3Xdigraph[103X
  induced  by the set of non-isolated vertices, i.e. the set of those vertices
  of  [3Xdigraph[103X  which  are  the  source  or  range of some edge in [3Xdigraph[103X. See
  [2XInducedSubdigraph[102X ([14X3.3-3[114X).[133X
  
  [33X[0;0YThe  ordering  of the remaining vertices of [3Xdigraph[103X is preserved, as are the
  labels of the remaining vertices and edges; see [2XDigraphVertexLabels[102X ([14X5.1-10[114X)
  and  [2XDigraphEdgeLabels[102X ([14X5.1-12[114X). This can allow one to match a vertex in the
  reduced digraph to the corresponding vertex in [3Xdigraph[103X.[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  is  immutable,  then  a  new  immutable  digraph  is  returned.
  Otherwise,  the isolated vertices of the mutable digraph [3Xdigraph[103X are removed
  in-place.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := Digraph([[1, 2], [], [], [1, 4], []]);[127X[104X
    [4X[28X<immutable digraph with 5 vertices, 4 edges>[128X[104X
    [4X[25Xgap>[125X [27XR := ReducedDigraph(D);[127X[104X
    [4X[28X<immutable digraph with 3 vertices, 4 edges>[128X[104X
    [4X[25Xgap>[125X [27XOutNeighbours(R);[127X[104X
    [4X[28X[ [ 1, 2 ], [  ], [ 1, 3 ] ][128X[104X
    [4X[25Xgap>[125X [27XDigraphEdges(D);[127X[104X
    [4X[28X[ [ 1, 1 ], [ 1, 2 ], [ 4, 1 ], [ 4, 4 ] ][128X[104X
    [4X[25Xgap>[125X [27XDigraphEdges(R);[127X[104X
    [4X[28X[ [ 1, 1 ], [ 1, 2 ], [ 3, 1 ], [ 3, 3 ] ][128X[104X
    [4X[25Xgap>[125X [27XDigraphVertexLabel(R, 3);[127X[104X
    [4X[28X4[128X[104X
    [4X[25Xgap>[125X [27XDigraphVertexLabel(R, 2);[127X[104X
    [4X[28X2[128X[104X
    [4X[25Xgap>[125X [27XD := Digraph(IsMutableDigraph, [[], [3], [2]]);[127X[104X
    [4X[28X<mutable digraph with 3 vertices, 2 edges>[128X[104X
    [4X[25Xgap>[125X [27XReducedDigraph(D);[127X[104X
    [4X[28X<mutable digraph with 2 vertices, 2 edges>[128X[104X
    [4X[25Xgap>[125X [27XD;[127X[104X
    [4X[28X<mutable digraph with 2 vertices, 2 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.3-5 MaximalSymmetricSubdigraph[101X
  
  [33X[1;0Y[29X[2XMaximalSymmetricSubdigraph[102X( [3Xdigraph[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XMaximalSymmetricSubdigraphAttr[102X( [3Xdigraph[103X ) [32X attribute[133X
  [33X[1;0Y[29X[2XMaximalSymmetricSubdigraphWithoutLoops[102X( [3Xdigraph[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XMaximalSymmetricSubdigraphWithoutLoopsAttr[102X( [3Xdigraph[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf [3Xdigraph[103X is a digraph, then [10XMaximalSymmetricSubdigraph[110X returns a symmetric
  digraph without multiple edges which has the same vertex set as [3Xdigraph[103X, and
  whose  edge  list  is  formed  from  [3Xdigraph[103X by ignoring the multiplicity of
  edges,  and  by  ignoring edges [10X[u,v][110X for which there does not exist an edge
  [10X[v,u][110X.[133X
  
  [33X[0;0YThe  digraph returned by [10XMaximalSymmetricSubdigraphWithoutLoops[110X is the same,
  except that loops are removed.[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  is  immutable,  then  a  new  immutable  digraph  is  returned.
  Otherwise,  the  mutable  digraph  [3Xdigraph[103X  is  changed in-place into such a
  digraph described above.[133X
  
  [33X[0;0YSee    [2XIsSymmetricDigraph[102X    ([14X6.1-12[114X),    [2XIsMultiDigraph[102X    ([14X6.1-10[114X),    and
  [2XDigraphHasLoops[102X ([14X6.1-1[114X) for more information.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := Digraph([[2, 2], [1, 3], [4], [3, 1]]);[127X[104X
    [4X[28X<immutable multidigraph with 4 vertices, 7 edges>[128X[104X
    [4X[25Xgap>[125X [27Xnot IsSymmetricDigraph(D) and IsMultiDigraph(D);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XOutNeighbours(D);[127X[104X
    [4X[28X[ [ 2, 2 ], [ 1, 3 ], [ 4 ], [ 3, 1 ] ][128X[104X
    [4X[25Xgap>[125X [27XS := MaximalSymmetricSubdigraph(D);[127X[104X
    [4X[28X<immutable symmetric digraph with 4 vertices, 4 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsSymmetricDigraph(S) and not IsMultiDigraph(S);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XOutNeighbours(S);[127X[104X
    [4X[28X[ [ 2 ], [ 1 ], [ 4 ], [ 3 ] ][128X[104X
    [4X[25Xgap>[125X [27XD := CycleDigraph(IsMutableDigraph, 3);[127X[104X
    [4X[28X<mutable digraph with 3 vertices, 3 edges>[128X[104X
    [4X[25Xgap>[125X [27XMaximalSymmetricSubdigraph(D);[127X[104X
    [4X[28X<mutable empty digraph with 3 vertices>[128X[104X
    [4X[25Xgap>[125X [27XD;[127X[104X
    [4X[28X<mutable empty digraph with 3 vertices>[128X[104X
  [4X[32X[104X
  
  [1X3.3-6 MaximalAntiSymmetricSubdigraph[101X
  
  [33X[1;0Y[29X[2XMaximalAntiSymmetricSubdigraph[102X( [3Xdigraph[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XMaximalAntiSymmetricSubdigraphAttr[102X( [3Xdigraph[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  is  a  digraph,  then [10XMaximalAntiSymmetricSubdigraph[110X returns an
  anti-symmetric  subdigraph  of  [3Xdigraph[103X  formed by retaining the vertices of
  [3Xdigraph[103X,  discarding  any  duplicate edges, and discarding any edge [10X[i,j][110X of
  [3Xdigraph[103X  where  [10Xi  >  j[110X and the reverse edge [10X[j,i][110X is an edge of [3Xdigraph[103X. In
  other  words,  for every symmetric pair of edges [10X[i,j][110X and [10X[j,i][110X in [3Xdigraph[103X,
  where [10Xi[110X and [10Xj[110X are distinct, it discards the edge [22X[max(i,j),min(i,j)][122X.[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  is  immutable,  then  a  new  immutable  digraph  is  returned.
  Otherwise, the mutable digraph [3Xdigraph[103X is changed in-place.[133X
  
  [33X[0;0YSee [2XIsAntisymmetricDigraph[102X ([14X6.1-2[114X) for more information.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := Digraph([[2, 2], [1, 3], [4], [3, 1]]);[127X[104X
    [4X[28X<immutable multidigraph with 4 vertices, 7 edges>[128X[104X
    [4X[25Xgap>[125X [27Xnot IsAntiSymmetricDigraph(D) and IsMultiDigraph(D);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XOutNeighbours(D);[127X[104X
    [4X[28X[ [ 2, 2 ], [ 1, 3 ], [ 4 ], [ 3, 1 ] ][128X[104X
    [4X[25Xgap>[125X [27XD := MaximalAntiSymmetricSubdigraph(D);[127X[104X
    [4X[28X<immutable antisymmetric digraph with 4 vertices, 4 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsAntiSymmetricDigraph(D) and not IsMultiDigraph(D);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XOutNeighbours(D);[127X[104X
    [4X[28X[ [ 2 ], [ 3 ], [ 4 ], [ 1 ] ][128X[104X
    [4X[25Xgap>[125X [27XD := Digraph(IsMutableDigraph, [[2], [1]]);[127X[104X
    [4X[28X<mutable digraph with 2 vertices, 2 edges>[128X[104X
    [4X[25Xgap>[125X [27XMaximalAntiSymmetricSubdigraph(D);[127X[104X
    [4X[28X<mutable digraph with 2 vertices, 1 edge>[128X[104X
    [4X[25Xgap>[125X [27XD;[127X[104X
    [4X[28X<mutable digraph with 2 vertices, 1 edge>[128X[104X
  [4X[32X[104X
  
  [1X3.3-7 UndirectedSpanningForest[101X
  
  [33X[1;0Y[29X[2XUndirectedSpanningForest[102X( [3Xdigraph[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XUndirectedSpanningForestAttr[102X( [3Xdigraph[103X ) [32X attribute[133X
  [33X[1;0Y[29X[2XUndirectedSpanningTree[102X( [3Xdigraph[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XUndirectedSpanningTreeAttr[102X( [3Xdigraph[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10YA digraph, or [9Xfail[109X.[133X
  
  [33X[0;0YIf    [3Xdigraph[103X    is   a   digraph   with   at   least   one   vertex,   then
  [10XUndirectedSpanningForest[110X  returns  an undirected spanning forest of [3Xdigraph[103X,
  otherwise   this  attribute  returns  [9Xfail[109X.  See  [2XIsUndirectedSpanningForest[102X
  ([14X4.1-2[114X) for the definition of an undirected spanning forest.[133X
  
  [33X[0;0YIf   [3Xdigraph[103X   is   a   digraph   with   at   least  one  vertex  and  whose
  [2XMaximalSymmetricSubdigraph[102X  ([14X3.3-5[114X)  is  connected  (see  [2XIsConnectedDigraph[102X
  ([14X6.3-3[114X)), then [10XUndirectedSpanningTree[110X returns an undirected spanning tree of
  [3Xdigraph[103X, otherwise this attribute returns [9Xfail[109X. See [2XIsUndirectedSpanningTree[102X
  ([14X4.1-2[114X) for the definition of an undirected spanning tree.[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  is immutable, then an immutable digraph is returned. Otherwise,
  the  mutable digraph [3Xdigraph[103X is changed in-place into an undirected spanning
  tree of [3Xdigraph[103X.[133X
  
  [33X[0;0YNote  that for an immutable digraph that has known undirected spanning tree,
  the  attribute  [10XUndirectedSpanningTree[110X  returns  the  same  digraph  as  the
  attribute [10XUndirectedSpanningForest[110X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := Digraph([[1, 2, 1, 3], [1], [4], [3, 4, 3]]);[127X[104X
    [4X[28X<immutable multidigraph with 4 vertices, 9 edges>[128X[104X
    [4X[25Xgap>[125X [27XUndirectedSpanningTree(D);[127X[104X
    [4X[28Xfail[128X[104X
    [4X[25Xgap>[125X [27Xforest := UndirectedSpanningForest(D);[127X[104X
    [4X[28X<immutable undirected forest digraph with 4 vertices, 4 edges>[128X[104X
    [4X[25Xgap>[125X [27XOutNeighbours(forest);[127X[104X
    [4X[28X[ [ 2 ], [ 1 ], [ 4 ], [ 3 ] ][128X[104X
    [4X[25Xgap>[125X [27XIsUndirectedSpanningForest(D, forest);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XDigraphConnectedComponents(forest).comps;[127X[104X
    [4X[28X[ [ 1, 2 ], [ 3, 4 ] ][128X[104X
    [4X[25Xgap>[125X [27XDigraphConnectedComponents(MaximalSymmetricSubdigraph(D)).comps;[127X[104X
    [4X[28X[ [ 1, 2 ], [ 3, 4 ] ][128X[104X
    [4X[25Xgap>[125X [27XUndirectedSpanningForest(MaximalSymmetricSubdigraph(D))[127X[104X
    [4X[25X>[125X [27X= forest;[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XD := CompleteDigraph(4);[127X[104X
    [4X[28X<immutable complete digraph with 4 vertices>[128X[104X
    [4X[25Xgap>[125X [27Xtree := UndirectedSpanningTree(D);[127X[104X
    [4X[28X<immutable undirected tree digraph with 4 vertices>[128X[104X
    [4X[25Xgap>[125X [27XIsUndirectedSpanningTree(D, tree);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27Xtree = UndirectedSpanningForest(D);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XUndirectedSpanningForest(EmptyDigraph(0));[127X[104X
    [4X[28Xfail[128X[104X
    [4X[25Xgap>[125X [27XD := PetersenGraph(IsMutableDigraph);[127X[104X
    [4X[28X<mutable digraph with 10 vertices, 30 edges>[128X[104X
    [4X[25Xgap>[125X [27XUndirectedSpanningTree(D);[127X[104X
    [4X[28X<mutable digraph with 10 vertices, 18 edges>[128X[104X
    [4X[25Xgap>[125X [27XD;[127X[104X
    [4X[28X<mutable digraph with 10 vertices, 18 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.3-8 DigraphShortestPathSpanningTree[101X
  
  [33X[1;0Y[29X[2XDigraphShortestPathSpanningTree[102X( [3Xdigraph[103X, [3Xv[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph, or [9Xfail[109X.[133X
  
  [33X[0;0YIf  [3Xv[103X  is a vertex in [3Xdigraph[103X and every other vertex of [3Xdigraph[103X is reachable
  from  [3Xv[103X,  then  this  operation  returns  the shortest path spanning tree of
  [3Xdigraph[103X  rooted at [3Xv[103X. If there exist vertices in [3Xdigraph[103X (other than [3Xv[103X) that
  are not reachable from [3Xv[103X, then [10XDigraphShortestPathSpanningTree[110X returns [9Xfail[109X.
  See [2XIsReachable[102X ([14X5.3-19[114X).[133X
  
  [33X[0;0YThe  [13Xshortest  path  spanning tree of [3Xdigraph[103X rooted at [3Xv[103X[113X is a subdigraph of
  [3Xdigraph[103X  that is a directed tree, with unique source vertex [3Xv[103X, and where for
  each  other vertex [3Xu[103X in [3Xdigraph[103X, the unique directed path from [3Xv[103X to [3Xu[103X in the
  tree  is  the  lexicographically-least shortest directed path from [3Xv[103X to [3Xu[103X in
  [3Xdigraph[103X.[133X
  
  [33X[0;0YSee  [2XIsDirectedTree[102X ([14X6.3-8[114X), [2XDigraphSources[102X ([14X5.1-7[114X), and [2XDigraphShortestPath[102X
  ([14X5.3-23[114X).[133X
  
  [33X[0;0YIf  [3Xdigraph[103X belongs to [2XIsMutableDigraph[102X ([14X3.1-2[114X), then [3Xdigraph[103X is modified in
  place.  If  [3Xdigraph[103X belongs to [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the spanning
  tree is a new immutable digraph.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := Digraph([[1, 2], [3], [2, 4], [1], [2, 4]]);[127X[104X
    [4X[28X<immutable digraph with 5 vertices, 8 edges>[128X[104X
    [4X[25Xgap>[125X [27XForAll([2 .. 5], v -> IsReachable(D, 1, v));[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XDigraphShortestPathSpanningTree(D, 1);[127X[104X
    [4X[28Xfail[128X[104X
    [4X[25Xgap>[125X [27Xtree := DigraphShortestPathSpanningTree(D, 5);[127X[104X
    [4X[28X<immutable directed tree digraph with 5 vertices>[128X[104X
    [4X[25Xgap>[125X [27XOutNeighbours(tree);[127X[104X
    [4X[28X[ [  ], [ 3 ], [  ], [ 1 ], [ 2, 4 ] ][128X[104X
    [4X[25Xgap>[125X [27XForAll(DigraphVertices(D), v ->[127X[104X
    [4X[25X>[125X [27XDigraphShortestPath(D, 5, v) = DigraphPath(tree, 5, v));[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.3-9 QuotientDigraph[101X
  
  [33X[1;0Y[29X[2XQuotientDigraph[102X( [3Xdigraph[103X, [3Xp[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  is  a digraph, and [3Xp[103X is a partition of the vertices of [3Xdigraph[103X,
  then  this  operation  returns  a  digraph  constructed  by amalgamating all
  vertices of [3Xdigraph[103X which lie in the same part of [3Xp[103X.[133X
  
  [33X[0;0YA  partition  of  the  vertices  of  [3Xdigraph[103X is a list of non-empty disjoint
  lists,  such  that  the union of all the sub-lists is equal to vertex set of
  [3Xdigraph[103X. In particular, each vertex must appear in precisely one sub-list.[133X
  
  [33X[0;0YThe vertices of [3Xdigraph[103X in part [10Xi[110X of [3Xp[103X will become vertex [10Xi[110X in the quotient,
  and  there  exists  some  edge in [3Xdigraph[103X with source in part [10Xi[110X and range in
  part  [10Xj[110X  if  and  only  if  there is an edge from [10Xi[110X to [10Xj[110X in the quotient. In
  particular, this means that the quotient of a digraph has no multiple edges.
  which was a change introduced in version 1.0.0 of the [5XDigraphs[105X package.[133X
  
  [33X[0;0YIf  [3Xdigraph[103X belongs to [2XIsMutableDigraph[102X ([14X3.1-2[114X), then [3Xdigraph[103X is modified in
  place.  If  [3Xdigraph[103X  belongs  to [2XIsImmutableDigraph[102X ([14X3.1-3[114X), a new immutable
  digraph with the above properties is returned.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := Digraph([[2, 1], [4], [1], [1, 3, 4]]);[127X[104X
    [4X[28X<immutable digraph with 4 vertices, 7 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphVertices(D);[127X[104X
    [4X[28X[ 1 .. 4 ][128X[104X
    [4X[25Xgap>[125X [27XDigraphEdges(D);[127X[104X
    [4X[28X[ [ 1, 2 ], [ 1, 1 ], [ 2, 4 ], [ 3, 1 ], [ 4, 1 ], [ 4, 3 ], [128X[104X
    [4X[28X  [ 4, 4 ] ][128X[104X
    [4X[25Xgap>[125X [27Xp := [[1], [2, 4], [3]];[127X[104X
    [4X[28X[ [ 1 ], [ 2, 4 ], [ 3 ] ][128X[104X
    [4X[25Xgap>[125X [27Xquo := QuotientDigraph(D, p);[127X[104X
    [4X[28X<immutable digraph with 3 vertices, 6 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphVertices(quo);[127X[104X
    [4X[28X[ 1 .. 3 ][128X[104X
    [4X[25Xgap>[125X [27XDigraphEdges(quo);[127X[104X
    [4X[28X[ [ 1, 1 ], [ 1, 2 ], [ 2, 1 ], [ 2, 2 ], [ 2, 3 ], [ 3, 1 ] ][128X[104X
    [4X[25Xgap>[125X [27XQuotientDigraph(EmptyDigraph(0), []);[127X[104X
    [4X[28X<immutable empty digraph with 0 vertices>[128X[104X
  [4X[32X[104X
  
  [1X3.3-10 DigraphReverse[101X
  
  [33X[1;0Y[29X[2XDigraphReverse[102X( [3Xdigraph[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XDigraphReverseAttr[102X( [3Xdigraph[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YThe  reverse of a digraph is the digraph formed by reversing the orientation
  of  each  of its edges, i.e. for every edge [10X[i, j][110X of a digraph, the reverse
  contains the corresponding edge [10X[j, i][110X.[133X
  
  [33X[0;0Y[10XDigraphReverse[110X  returns  the  reverse  of the digraph [3Xdigraph[103X. If [3Xdigraph[103X is
  immutable,  then a new immutable digraph is returned. Otherwise, the mutable
  digraph [3Xdigraph[103X is changed in-place into its reverse.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := Digraph([[3], [1, 3, 5], [1], [1, 2, 4], [2, 3, 5]]);[127X[104X
    [4X[28X<immutable digraph with 5 vertices, 11 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphReverse(D);[127X[104X
    [4X[28X<immutable digraph with 5 vertices, 11 edges>[128X[104X
    [4X[25Xgap>[125X [27XOutNeighbours(last);[127X[104X
    [4X[28X[ [ 2, 3, 4 ], [ 4, 5 ], [ 1, 2, 5 ], [ 4 ], [ 2, 5 ] ][128X[104X
    [4X[25Xgap>[125X [27XD := Digraph([[2, 4], [1], [4], [3, 4]]);[127X[104X
    [4X[28X<immutable digraph with 4 vertices, 6 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphEdges(D);[127X[104X
    [4X[28X[ [ 1, 2 ], [ 1, 4 ], [ 2, 1 ], [ 3, 4 ], [ 4, 3 ], [ 4, 4 ] ][128X[104X
    [4X[25Xgap>[125X [27XDigraphEdges(DigraphReverse(D));[127X[104X
    [4X[28X[ [ 1, 2 ], [ 2, 1 ], [ 3, 4 ], [ 4, 1 ], [ 4, 3 ], [ 4, 4 ] ][128X[104X
    [4X[25Xgap>[125X [27XD := CycleDigraph(IsMutableDigraph, 3);[127X[104X
    [4X[28X<mutable digraph with 3 vertices, 3 edges>[128X[104X
    [4X[25Xgap>[125X [27XOutNeighbours(D);[127X[104X
    [4X[28X[ [ 2 ], [ 3 ], [ 1 ] ][128X[104X
    [4X[25Xgap>[125X [27XDigraphReverse(D);[127X[104X
    [4X[28X<mutable digraph with 3 vertices, 3 edges>[128X[104X
    [4X[25Xgap>[125X [27XOutNeighbours(D);[127X[104X
    [4X[28X[ [ 3 ], [ 1 ], [ 2 ] ][128X[104X
  [4X[32X[104X
  
  [1X3.3-11 DigraphDual[101X
  
  [33X[1;0Y[29X[2XDigraphDual[102X( [3Xdigraph[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XDigraphDualAttr[102X( [3Xdigraph[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YThe  [13Xdual[113X  of [3Xdigraph[103X has the same vertices as [3Xdigraph[103X, and there is an edge
  in  the  dual  from [10Xi[110X to [10Xj[110X whenever there is no edge from [10Xi[110X to [10Xj[110X in [3Xdigraph[103X.
  The [13Xdual[113X is sometimes called the [13Xcomplement[113X.[133X
  
  [33X[0;0Y[10XDigraphDual[110X  returns  the  dual  of  the  digraph  [3Xdigraph[103X. If [3Xdigraph[103X is an
  immutable  digraph, then a new immutable digraph is returned. Otherwise, the
  mutable digraph [3Xdigraph[103X is changed in-place into its dual.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := Digraph([[2, 3], [], [4, 6], [5], [],[127X[104X
    [4X[25X>[125X [27X[7, 8, 9], [], [], []]);[127X[104X
    [4X[28X<immutable digraph with 9 vertices, 8 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphDual(D);[127X[104X
    [4X[28X<immutable digraph with 9 vertices, 73 edges>[128X[104X
    [4X[25Xgap>[125X [27XD := CycleDigraph(IsMutableDigraph, 3);[127X[104X
    [4X[28X<mutable digraph with 3 vertices, 3 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphDual(D);[127X[104X
    [4X[28X<mutable digraph with 3 vertices, 6 edges>[128X[104X
    [4X[25Xgap>[125X [27XD;[127X[104X
    [4X[28X<mutable digraph with 3 vertices, 6 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.3-12 DigraphSymmetricClosure[101X
  
  [33X[1;0Y[29X[2XDigraphSymmetricClosure[102X( [3Xdigraph[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XDigraphSymmetricClosureAttr[102X( [3Xdigraph[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  is  a  digraph, then this attribute gives the minimal symmetric
  digraph which has the same vertices and contains all the edges of [3Xdigraph[103X.[133X
  
  [33X[0;0YA  digraph  is  [13Xsymmetric[113X if its adjacency matrix [2XAdjacencyMatrix[102X ([14X5.2-1[114X) is
  symmetric.  For  a digraph with multiple edges this means that there are the
  same number of edges from a vertex [10Xu[110X to a vertex [10Xv[110X as there are from [10Xv[110X to [10Xu[110X;
  see [2XIsSymmetricDigraph[102X ([14X6.1-12[114X).[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  is  immutable,  then  a  new  immutable  digraph  is  returned.
  Otherwise,  the  mutable  digraph  [3Xdigraph[103X  is  changed  in-place  into  its
  symmetric closure.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := Digraph([[1, 2, 3], [2, 4], [1], [3, 4]]);[127X[104X
    [4X[28X<immutable digraph with 4 vertices, 8 edges>[128X[104X
    [4X[25Xgap>[125X [27XD := DigraphSymmetricClosure(D);[127X[104X
    [4X[28X<immutable symmetric digraph with 4 vertices, 11 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsSymmetricDigraph(D);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XList(OutNeighbours(D), AsSet);[127X[104X
    [4X[28X[ [ 1, 2, 3 ], [ 1, 2, 4 ], [ 1, 4 ], [ 2, 3, 4 ] ][128X[104X
    [4X[25Xgap>[125X [27XD := Digraph([[2, 2], [1]]);[127X[104X
    [4X[28X<immutable multidigraph with 2 vertices, 3 edges>[128X[104X
    [4X[25Xgap>[125X [27XD := DigraphSymmetricClosure(D);[127X[104X
    [4X[28X<immutable symmetric multidigraph with 2 vertices, 4 edges>[128X[104X
    [4X[25Xgap>[125X [27XOutNeighbours(D);[127X[104X
    [4X[28X[ [ 2, 2 ], [ 1, 1 ] ][128X[104X
    [4X[25Xgap>[125X [27XD := CycleDigraph(IsMutableDigraph, 3);[127X[104X
    [4X[28X<mutable digraph with 3 vertices, 3 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphSymmetricClosure(D);[127X[104X
    [4X[28X<mutable digraph with 3 vertices, 6 edges>[128X[104X
    [4X[25Xgap>[125X [27XD;[127X[104X
    [4X[28X<mutable digraph with 3 vertices, 6 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.3-13 DigraphTransitiveClosure[101X
  
  [33X[1;0Y[29X[2XDigraphTransitiveClosure[102X( [3Xdigraph[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XDigraphTransitiveClosureAttr[102X( [3Xdigraph[103X ) [32X attribute[133X
  [33X[1;0Y[29X[2XDigraphReflexiveTransitiveClosure[102X( [3Xdigraph[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XDigraphReflexiveTransitiveClosureAttr[102X( [3Xdigraph[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf [3Xdigraph[103X is a digraph with no multiple edges, then these attributes return
  the (reflexive) transitive closure of [3Xdigraph[103X.[133X
  
  [33X[0;0YA  digraph  is  [13Xreflexive[113X  if  it  has  a  loop  at  every vertex, and it is
  [13Xtransitive[113X  if  whenever [10X[i,j][110X and [10X[j,k][110X are edges of [3Xdigraph[103X, [10X[i,k][110X is also
  an  edge.  The  [13X(reflexive)  transitive  closure[113X of a digraph [3Xdigraph[103X is the
  least (reflexive and) transitive digraph containing [3Xdigraph[103X.[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  is  immutable,  then  a  new  immutable  digraph  is  returned.
  Otherwise,  the  mutable  digraph  [3Xdigraph[103X  is  changed  in-place  into  its
  (reflexive) transitive closure.[133X
  
  [33X[0;0YLet  [22Xn[122X  be  the  number  of  vertices of [3Xdigraph[103X, and let [22Xm[122X be the number of
  edges.  For an arbitrary digraph, these attributes will use a version of the
  Floyd-Warshall   algorithm,   with   complexity   [22XO(n^3)[122X.   However,  for  a
  topologically  sortable  digraph [see [2XDigraphTopologicalSort[102X ([14X5.1-8[114X)], these
  attributes  will  use  methods with complexity [22XO(m + n + m ⋅ n)[122X when this is
  faster.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := DigraphFromDiSparse6String(".H`eOWR`Ul^");[127X[104X
    [4X[28X<immutable digraph with 9 vertices, 8 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsReflexiveDigraph(D) or IsTransitiveDigraph(D);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XOutNeighbours(D);[127X[104X
    [4X[28X[ [ 4, 6 ], [ 1, 3 ], [  ], [ 5 ], [  ], [ 7, 8, 9 ], [  ], [  ], [128X[104X
    [4X[28X  [  ] ][128X[104X
    [4X[25Xgap>[125X [27XT := DigraphTransitiveClosure(D);[127X[104X
    [4X[28X<immutable transitive digraph with 9 vertices, 18 edges>[128X[104X
    [4X[25Xgap>[125X [27XOutNeighbours(T);[127X[104X
    [4X[28X[ [ 4, 6, 5, 7, 8, 9 ], [ 1, 3, 4, 5, 6, 7, 8, 9 ], [  ], [ 5 ], [128X[104X
    [4X[28X  [  ], [ 7, 8, 9 ], [  ], [  ], [  ] ][128X[104X
    [4X[25Xgap>[125X [27XRT := DigraphReflexiveTransitiveClosure(D);[127X[104X
    [4X[28X<immutable preorder digraph with 9 vertices, 27 edges>[128X[104X
    [4X[25Xgap>[125X [27XOutNeighbours(RT);[127X[104X
    [4X[28X[ [ 4, 6, 5, 7, 8, 9, 1 ], [ 1, 3, 4, 5, 6, 7, 8, 9, 2 ], [ 3 ], [128X[104X
    [4X[28X  [ 5, 4 ], [ 5 ], [ 7, 8, 9, 6 ], [ 7 ], [ 8 ], [ 9 ] ][128X[104X
    [4X[25Xgap>[125X [27XD := CycleDigraph(IsMutableDigraph, 3);[127X[104X
    [4X[28X<mutable digraph with 3 vertices, 3 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphReflexiveTransitiveClosure(D);[127X[104X
    [4X[28X<mutable digraph with 3 vertices, 9 edges>[128X[104X
    [4X[25Xgap>[125X [27XD;[127X[104X
    [4X[28X<mutable digraph with 3 vertices, 9 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.3-14 DigraphTransitiveReduction[101X
  
  [33X[1;0Y[29X[2XDigraphTransitiveReduction[102X( [3Xdigraph[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XDigraphTransitiveReductionAttr[102X( [3Xdigraph[103X ) [32X attribute[133X
  [33X[1;0Y[29X[2XDigraphReflexiveTransitiveReduction[102X( [3Xdigraph[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XDigraphReflexiveTransitiveReductionAttr[102X( [3Xdigraph[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  is a topologically sortable digraph [see [2XDigraphTopologicalSort[102X
  ([14X5.1-8[114X)]   with   no  multiple  edges,  then  these  operations  return  the
  (reflexive) transitive reduction of [3Xdigraph[103X.[133X
  
  [33X[0;0YThe  (reflexive)  transitive reduction of such a digraph is the unique least
  subgraph  such  that  the  (reflexive) transitive closure of the subgraph is
  equal    to   the   (reflexive)   transitive   closure   of   [3Xdigraph[103X   [see
  [2XDigraphReflexiveTransitiveClosure[102X ([14X3.3-13[114X)]. In order words, it is the least
  subgraph of [3Xdigraph[103X which retains the same reachability as [3Xdigraph[103X.[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  is  immutable,  then  a  new  immutable  digraph  is  returned.
  Otherwise,  the  mutable  digraph  [3Xdigraph[103X  is  changed  in-place  into  its
  (reflexive) transitive reduction.[133X
  
  [33X[0;0YLet  [22Xn[122X  be  the number of vertices of an arbitrary digraph, and let [22Xm[122X be the
  number of edges. Then these operations use methods with complexity [22XO(m + n +
  m ⋅ n)[122X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := Digraph([[1, 2, 3], [3], [3]]);;[127X[104X
    [4X[25Xgap>[125X [27XDigraphHasLoops(D);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XD1 := DigraphReflexiveTransitiveReduction(D);[127X[104X
    [4X[28X<immutable digraph with 3 vertices, 2 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphHasLoops(D1);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XOutNeighbours(D1);[127X[104X
    [4X[28X[ [ 2 ], [ 3 ], [  ] ][128X[104X
    [4X[25Xgap>[125X [27XD2 := DigraphTransitiveReduction(D);[127X[104X
    [4X[28X<immutable digraph with 3 vertices, 4 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphHasLoops(D2);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XOutNeighbours(D2);[127X[104X
    [4X[28X[ [ 2, 1 ], [ 3 ], [ 3 ] ][128X[104X
    [4X[25Xgap>[125X [27XDigraphReflexiveTransitiveClosure(D)[127X[104X
    [4X[25X>[125X [27X = DigraphReflexiveTransitiveClosure(D1);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XDigraphTransitiveClosure(D)[127X[104X
    [4X[25X>[125X [27X = DigraphTransitiveClosure(D2);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XD := Digraph(IsMutableDigraph, [[1], [1], [1, 2, 3]]);[127X[104X
    [4X[28X<mutable digraph with 3 vertices, 5 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphReflexiveTransitiveReduction(D);[127X[104X
    [4X[28X<mutable digraph with 3 vertices, 2 edges>[128X[104X
    [4X[25Xgap>[125X [27XD;[127X[104X
    [4X[28X<mutable digraph with 3 vertices, 2 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.3-15 DigraphAddVertex[101X
  
  [33X[1;0Y[29X[2XDigraphAddVertex[102X( [3Xdigraph[103X[, [3Xlabel[103X] ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YThe  operation returns a digraph constructed from [3Xdigraph[103X by adding a single
  new vertex, and no new edges.[133X
  
  [33X[0;0YIf  the  optional second argument [3Xlabel[103X is a [5XGAP[105X object, then the new vertex
  will be labelled [3Xlabel[103X.[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  belongs  to  [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the vertex is added
  directly  to  [3Xdigraph[103X.  If [3Xdigraph[103X belongs to [2XIsImmutableDigraph[102X ([14X3.1-3[114X), an
  immutable copy of [3Xdigraph[103X with the additional vertex is returned.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := CompleteDigraph(3);[127X[104X
    [4X[28X<immutable complete digraph with 3 vertices>[128X[104X
    [4X[25Xgap>[125X [27Xnew := DigraphAddVertex(D);[127X[104X
    [4X[28X<immutable digraph with 4 vertices, 6 edges>[128X[104X
    [4X[25Xgap>[125X [27XD = new;[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XDigraphVertices(new);[127X[104X
    [4X[28X[ 1 .. 4 ][128X[104X
    [4X[25Xgap>[125X [27Xnew := DigraphAddVertex(D, Group([(1, 2)]));[127X[104X
    [4X[28X<immutable digraph with 4 vertices, 6 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphVertexLabels(new);[127X[104X
    [4X[28X[ 1, 2, 3, Group([ (1,2) ]) ][128X[104X
    [4X[25Xgap>[125X [27XD := CompleteBipartiteDigraph(IsMutableDigraph, 2, 3);[127X[104X
    [4X[28X<mutable digraph with 5 vertices, 12 edges>[128X[104X
    [4X[25Xgap>[125X [27Xnew := DigraphAddVertex(D);[127X[104X
    [4X[28X<mutable digraph with 6 vertices, 12 edges>[128X[104X
    [4X[25Xgap>[125X [27XD = new;[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.3-16 DigraphAddVertices[101X
  
  [33X[1;0Y[29X[2XDigraphAddVertices[102X( [3Xdigraph[103X, [3Xm[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XDigraphAddVertices[102X( [3Xdigraph[103X, [3Xlabels[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YFor  a  non-negative integer [3Xm[103X, this operation returns a digraph constructed
  from [3Xdigraph[103X by adding [3Xm[103X new vertices.[133X
  
  [33X[0;0YOtherwise,  if  [3Xlabels[103X  is  a  list  consisting  of [10Xk[110X [5XGAP[105X objects, then this
  operation  returns  a  digraph  constructed  from  [3Xdigraph[103X  by  adding [10Xk[110X new
  vertices, which are labelled according to this list.[133X
  
  [33X[0;0YIf  [3Xdigraph[103X belongs to [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the vertices are added
  directly  to  [3Xdigraph[103X,  which  is  changed  in-place.  If [3Xdigraph[103X belongs to
  [2XIsImmutableDigraph[102X  ([14X3.1-3[114X),  then [3Xdigraph[103X itself is returned if no vertices
  are  added  (i.e.  [10X[3Xm[103X[10X=0[110X  or  [3Xlabels[103X  is empty), otherwise the result is a new
  immutable digraph.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := CompleteDigraph(3);[127X[104X
    [4X[28X<immutable complete digraph with 3 vertices>[128X[104X
    [4X[25Xgap>[125X [27Xnew := DigraphAddVertices(D, 3);[127X[104X
    [4X[28X<immutable digraph with 6 vertices, 6 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphVertices(new);[127X[104X
    [4X[28X[ 1 .. 6 ][128X[104X
    [4X[25Xgap>[125X [27Xnew := DigraphAddVertices(D, [Group([(1, 2)]), "d"]);[127X[104X
    [4X[28X<immutable digraph with 5 vertices, 6 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphVertexLabels(new);[127X[104X
    [4X[28X[ 1, 2, 3, Group([ (1,2) ]), "d" ][128X[104X
    [4X[25Xgap>[125X [27XDigraphAddVertices(D, 0) = D;[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XD := CompleteBipartiteDigraph(IsMutableDigraph, 2, 3);[127X[104X
    [4X[28X<mutable digraph with 5 vertices, 12 edges>[128X[104X
    [4X[25Xgap>[125X [27Xnew := DigraphAddVertices(D, 4);[127X[104X
    [4X[28X<mutable digraph with 9 vertices, 12 edges>[128X[104X
    [4X[25Xgap>[125X [27XD = new;[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.3-17 DigraphAddEdge[101X
  
  [33X[1;0Y[29X[2XDigraphAddEdge[102X( [3Xdigraph[103X, [3Xedge[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XDigraphAddEdge[102X( [3Xdigraph[103X, [3Xsrc[103X, [3Xran[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xedge[103X  is  a  pair of vertices of [3Xdigraph[103X, or [3Xsrc[103X and [3Xran[103X are vertices of
  [3Xdigraph[103X,  then  this operation returns a digraph constructed from [3Xdigraph[103X by
  adding a new edge with source [3Xedge[103X[10X[1][110X [[3Xsrc[103X] and range [3Xedge[103X[10X[2][110X [[3Xran[103X].[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  belongs  to  [2XIsMutableDigraph[102X  ([14X3.1-2[114X),  then the edge is added
  directly  to [3Xdigraph[103X. If [3Xdigraph[103X belongs to [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then
  an immutable copy of [3Xdigraph[103X with the additional edge is returned.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD1 := Digraph([[2], [3], []]);[127X[104X
    [4X[28X<immutable digraph with 3 vertices, 2 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphEdges(D1);[127X[104X
    [4X[28X[ [ 1, 2 ], [ 2, 3 ] ][128X[104X
    [4X[25Xgap>[125X [27XD2 := DigraphAddEdge(D1, [3, 1]);[127X[104X
    [4X[28X<immutable digraph with 3 vertices, 3 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphEdges(D2);[127X[104X
    [4X[28X[ [ 1, 2 ], [ 2, 3 ], [ 3, 1 ] ][128X[104X
    [4X[25Xgap>[125X [27XD3 := DigraphAddEdge(D2, [2, 3]);[127X[104X
    [4X[28X<immutable multidigraph with 3 vertices, 4 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphEdges(D3);[127X[104X
    [4X[28X[ [ 1, 2 ], [ 2, 3 ], [ 2, 3 ], [ 3, 1 ] ][128X[104X
    [4X[25Xgap>[125X [27XD := CycleDigraph(IsMutableDigraph, 4);[127X[104X
    [4X[28X<mutable digraph with 4 vertices, 4 edges>[128X[104X
    [4X[25Xgap>[125X [27Xnew := DigraphAddEdge(D, [1, 3]);[127X[104X
    [4X[28X<mutable digraph with 4 vertices, 5 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphEdges(new);[127X[104X
    [4X[28X[ [ 1, 2 ], [ 1, 3 ], [ 2, 3 ], [ 3, 4 ], [ 4, 1 ] ][128X[104X
    [4X[25Xgap>[125X [27XD = new;[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.3-18 DigraphAddEdgeOrbit[101X
  
  [33X[1;0Y[29X[2XDigraphAddEdgeOrbit[102X( [3Xdigraph[103X, [3Xedge[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA new digraph.[133X
  
  [33X[0;0YThis  operation  returns  a  new digraph with the same vertices and edges as
  [3Xdigraph[103X  and  with additional edges consisting of the orbit of the edge [3Xedge[103X
  under the action of the [2XDigraphGroup[102X ([14X7.2-10[114X) of [3Xdigraph[103X. If [3Xedge[103X is already
  an edge in [3Xdigraph[103X, then [3Xdigraph[103X is returned unchanged. The argument [3Xdigraph[103X
  must be an immutable digraph.[133X
  
  [33X[0;0YAn edge is simply a pair of vertices of [3Xdigraph[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xgr1 := CayleyDigraph(DihedralGroup(8));[127X[104X
    [4X[28X<immutable digraph with 8 vertices, 24 edges>[128X[104X
    [4X[25Xgap>[125X [27Xgr2 := DigraphAddEdgeOrbit(gr1, [1, 8]);[127X[104X
    [4X[28X<immutable digraph with 8 vertices, 32 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphEdges(gr1);[127X[104X
    [4X[28X[ [ 1, 2 ], [ 1, 3 ], [ 1, 4 ], [ 2, 1 ], [ 2, 5 ], [ 2, 6 ], [128X[104X
    [4X[28X  [ 3, 8 ], [ 3, 4 ], [ 3, 7 ], [ 4, 6 ], [ 4, 7 ], [ 4, 1 ], [128X[104X
    [4X[28X  [ 5, 7 ], [ 5, 6 ], [ 5, 8 ], [ 6, 4 ], [ 6, 8 ], [ 6, 2 ], [128X[104X
    [4X[28X  [ 7, 5 ], [ 7, 1 ], [ 7, 3 ], [ 8, 3 ], [ 8, 2 ], [ 8, 5 ] ][128X[104X
    [4X[25Xgap>[125X [27XDigraphEdges(gr2);[127X[104X
    [4X[28X[ [ 1, 2 ], [ 1, 3 ], [ 1, 4 ], [ 1, 8 ], [ 2, 1 ], [ 2, 5 ], [128X[104X
    [4X[28X  [ 2, 6 ], [ 2, 7 ], [ 3, 8 ], [ 3, 4 ], [ 3, 7 ], [ 3, 6 ], [128X[104X
    [4X[28X  [ 4, 6 ], [ 4, 7 ], [ 4, 1 ], [ 4, 5 ], [ 5, 7 ], [ 5, 6 ], [128X[104X
    [4X[28X  [ 5, 8 ], [ 5, 4 ], [ 6, 4 ], [ 6, 8 ], [ 6, 2 ], [ 6, 3 ], [128X[104X
    [4X[28X  [ 7, 5 ], [ 7, 1 ], [ 7, 3 ], [ 7, 2 ], [ 8, 3 ], [ 8, 2 ], [128X[104X
    [4X[28X  [ 8, 5 ], [ 8, 1 ] ][128X[104X
    [4X[25Xgap>[125X [27Xgr3 := DigraphRemoveEdgeOrbit(gr2, [1, 8]);[127X[104X
    [4X[28X<immutable digraph with 8 vertices, 24 edges>[128X[104X
    [4X[25Xgap>[125X [27Xgr3 = gr1;[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.3-19 DigraphAddEdges[101X
  
  [33X[1;0Y[29X[2XDigraphAddEdges[102X( [3Xdigraph[103X, [3Xedges[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xedges[103X  is  a (possibly empty) list of pairs of vertices of [3Xdigraph[103X, then
  this  operation  returns  a  digraph  constructed from [3Xdigraph[103X by adding the
  edges  specified  by  [3Xedges[103X.  More precisely, for every [10Xedge[110X in [3Xedges[103X, a new
  edge will be added with source [10Xedge[1][110X and range [10Xedges[2][110X.[133X
  
  [33X[0;0YIf an edge is included in [3Xedges[103X with multiplicity [10Xk[110X, then it will be added [10Xk[110X
  times.  If  [3Xdigraph[103X  belongs to [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the edges are
  added directly to [3Xdigraph[103X. If [3Xdigraph[103X belongs to [2XIsImmutableDigraph[102X ([14X3.1-3[114X),
  then the result is returned as an immutable digraph.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xfunc := function(n)[127X[104X
    [4X[25X>[125X [27X local source, range, i;[127X[104X
    [4X[25X>[125X [27X source := [];[127X[104X
    [4X[25X>[125X [27X range  := [];[127X[104X
    [4X[25X>[125X [27X for i in [1 .. n - 2] do[127X[104X
    [4X[25X>[125X [27X   Add(source, i);[127X[104X
    [4X[25X>[125X [27X   Add(range, i + 1);[127X[104X
    [4X[25X>[125X [27X od;[127X[104X
    [4X[25X>[125X [27X return Digraph(n, source, range);[127X[104X
    [4X[25X>[125X [27Xend;;[127X[104X
    [4X[25Xgap>[125X [27XD := func(1024);[127X[104X
    [4X[28X<immutable digraph with 1024 vertices, 1022 edges>[128X[104X
    [4X[25Xgap>[125X [27Xnew := DigraphAddEdges(D,[127X[104X
    [4X[25X>[125X [27X[[1023, 1024], [1, 1024], [1023, 1024], [1024, 1]]);[127X[104X
    [4X[28X<immutable multidigraph with 1024 vertices, 1026 edges>[128X[104X
    [4X[25Xgap>[125X [27XD = new;[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XD2 := DigraphMutableCopy(func(1024));[127X[104X
    [4X[28X<mutable digraph with 1024 vertices, 1022 edges>[128X[104X
    [4X[25Xgap>[125X [27Xnew := DigraphAddEdges(D2,[127X[104X
    [4X[25X>[125X [27X[[1023, 1024], [1, 1024], [1023, 1024], [1024, 1]]);[127X[104X
    [4X[28X<mutable multidigraph with 1024 vertices, 1026 edges>[128X[104X
    [4X[25Xgap>[125X [27XD2 = new;[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.3-20 DigraphRemoveVertex[101X
  
  [33X[1;0Y[29X[2XDigraphRemoveVertex[102X( [3Xdigraph[103X, [3Xv[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xv[103X  is  a  vertex  of  [3Xdigraph[103X,  then  this  operation  returns a digraph
  constructed  from  [3Xdigraph[103X  by  removing vertex [3Xv[103X, along with any edge whose
  source or range vertex is [3Xv[103X.[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  has  [10Xn[110X  vertices, then the vertices of the returned digraph are
  [10X[1..n-1][110X,  but  the  original labels can be accessed via [2XDigraphVertexLabels[102X
  ([14X5.1-10[114X).[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  belongs to [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the vertex is removed
  directly  from [3Xdigraph[103X. If [3Xdigraph[103X belongs to [2XIsImmutableDigraph[102X ([14X3.1-3[114X), an
  immutable copy of [3Xdigraph[103X without the vertex is returned.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := Digraph(["a", "b", "c"],[127X[104X
    [4X[25X>[125X [27X                 ["a", "a", "b", "c", "c"],[127X[104X
    [4X[25X>[125X [27X                 ["b", "c", "a", "a", "c"]);[127X[104X
    [4X[28X<immutable digraph with 3 vertices, 5 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphVertexLabels(D);[127X[104X
    [4X[28X[ "a", "b", "c" ][128X[104X
    [4X[25Xgap>[125X [27XDigraphEdges(D);[127X[104X
    [4X[28X[ [ 1, 2 ], [ 1, 3 ], [ 2, 1 ], [ 3, 1 ], [ 3, 3 ] ][128X[104X
    [4X[25Xgap>[125X [27Xnew := DigraphRemoveVertex(D, 2);[127X[104X
    [4X[28X<immutable digraph with 2 vertices, 3 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphVertexLabels(new);[127X[104X
    [4X[28X[ "a", "c" ][128X[104X
    [4X[25Xgap>[125X [27XD := CycleDigraph(IsMutableDigraph, 5);[127X[104X
    [4X[28X<mutable digraph with 5 vertices, 5 edges>[128X[104X
    [4X[25Xgap>[125X [27Xnew := DigraphRemoveVertex(D, 1);[127X[104X
    [4X[28X<mutable digraph with 4 vertices, 3 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphVertexLabels(D);[127X[104X
    [4X[28X[ 2, 3, 4, 5 ][128X[104X
    [4X[25Xgap>[125X [27XD = new;[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.3-21 DigraphRemoveVertices[101X
  
  [33X[1;0Y[29X[2XDigraphRemoveVertices[102X( [3Xdigraph[103X, [3Xverts[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xverts[103X  is a (possibly empty) duplicate-free list of vertices of [3Xdigraph[103X,
  then  this  operation returns a digraph constructed from [3Xdigraph[103X by removing
  every  vertex  in [3Xverts[103X, along with any edge whose source or range vertex is
  in [3Xverts[103X.[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  has  [10Xn[110X vertices, then the vertices of the new digraph are [10X[1 ..
  n-Length([3Xverts[103X[10X)][110X,   but   the   original   labels   can   be   accessed  via
  [2XDigraphVertexLabels[102X ([14X5.1-10[114X).[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  belongs  to  [2XIsMutableDigraph[102X  ([14X3.1-2[114X),  then  the vertices are
  removed  directly  from  [3Xdigraph[103X.  If  [3Xdigraph[103X belongs to [2XIsImmutableDigraph[102X
  ([14X3.1-3[114X), an immutable copy of [3Xdigraph[103X without the vertices is returned.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := Digraph([[3], [1, 3, 5], [1], [1, 2, 4], [2, 3, 5]]);[127X[104X
    [4X[28X<immutable digraph with 5 vertices, 11 edges>[128X[104X
    [4X[25Xgap>[125X [27XSetDigraphVertexLabels(D, ["a", "b", "c", "d", "e"]);[127X[104X
    [4X[25Xgap>[125X [27Xnew := DigraphRemoveVertices(D, [2, 4]);[127X[104X
    [4X[28X<immutable digraph with 3 vertices, 4 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphVertexLabels(new);[127X[104X
    [4X[28X[ "a", "c", "e" ][128X[104X
    [4X[25Xgap>[125X [27XD := CycleDigraph(IsMutableDigraph, 5);[127X[104X
    [4X[28X<mutable digraph with 5 vertices, 5 edges>[128X[104X
    [4X[25Xgap>[125X [27Xnew := DigraphRemoveVertices(D, [1, 3]);[127X[104X
    [4X[28X<mutable digraph with 3 vertices, 1 edge>[128X[104X
    [4X[25Xgap>[125X [27XDigraphVertexLabels(D);[127X[104X
    [4X[28X[ 2, 4, 5 ][128X[104X
    [4X[25Xgap>[125X [27XD = new;[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.3-22 DigraphRemoveEdge[101X
  
  [33X[1;0Y[29X[2XDigraphRemoveEdge[102X( [3Xdigraph[103X, [3Xedge[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XDigraphRemoveEdge[102X( [3Xdigraph[103X, [3Xsrc[103X, [3Xran[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  is  a  digraph  with  no  multiple  edges and [3Xedge[103X is a pair of
  vertices  of  [3Xdigraph[103X,  or  [3Xsrc[103X  and  [3Xran[103X are vertices of [3Xdigraph[103X, then this
  operation  returns  a  digraph constructed from [3Xdigraph[103X by removing the edge
  specified by [3Xedge[103X or [3X[src, ran][103X.[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  belongs  to  [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the edge is removed
  directly  from [3Xdigraph[103X. If [3Xdigraph[103X belongs to [2XIsImmutableDigraph[102X ([14X3.1-3[114X), an
  immutable copy of [3Xdigraph[103X without the edge is returned.[133X
  
  [33X[0;0YNote  that if [3Xdigraph[103X belongs to [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then a new copy
  of  [3Xdigraph[103X  will  be returned even if [3Xedge[103X or [3X[src, ran][103X does not define an
  edge of [3Xdigraph[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := CycleDigraph(250000);[127X[104X
    [4X[28X<immutable cycle digraph with 250000 vertices>[128X[104X
    [4X[25Xgap>[125X [27XD := DigraphRemoveEdge(D, [250000, 1]);[127X[104X
    [4X[28X<immutable digraph with 250000 vertices, 249999 edges>[128X[104X
    [4X[25Xgap>[125X [27Xnew := DigraphRemoveEdge(D, [25000, 2]);;[127X[104X
    [4X[25Xgap>[125X [27Xnew = D;[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsIdenticalObj(new, D);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XD := DigraphMutableCopy(D);;[127X[104X
    [4X[25Xgap>[125X [27Xnew := DigraphRemoveEdge(D, 2500, 2);;[127X[104X
    [4X[25Xgap>[125X [27XIsIdenticalObj(new, D);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.3-23 DigraphRemoveEdgeOrbit[101X
  
  [33X[1;0Y[29X[2XDigraphRemoveEdgeOrbit[102X( [3Xdigraph[103X, [3Xedge[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA new digraph.[133X
  
  [33X[0;0YThis  operation  returns a new digraph with the same vertices as [3Xdigraph[103X and
  with  the  orbit  of  the  edge  [3Xedge[103X  (under the action of the [2XDigraphGroup[102X
  ([14X7.2-10[114X)  of  [3Xdigraph[103X)  removed.  If  [3Xedge[103X  is  not an edge in [3Xdigraph[103X, then
  [3Xdigraph[103X  is  returned  unchanged.  The argument [3Xdigraph[103X must be an immutable
  digraph.[133X
  
  [33X[0;0YAn edge is simply a pair of vertices of [3Xdigraph[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xgr1 := CayleyDigraph(DihedralGroup(8));[127X[104X
    [4X[28X<immutable digraph with 8 vertices, 24 edges>[128X[104X
    [4X[25Xgap>[125X [27Xgr2 := DigraphAddEdgeOrbit(gr1, [1, 8]);[127X[104X
    [4X[28X<immutable digraph with 8 vertices, 32 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphEdges(gr1);[127X[104X
    [4X[28X[ [ 1, 2 ], [ 1, 3 ], [ 1, 4 ], [ 2, 1 ], [ 2, 5 ], [ 2, 6 ], [128X[104X
    [4X[28X  [ 3, 8 ], [ 3, 4 ], [ 3, 7 ], [ 4, 6 ], [ 4, 7 ], [ 4, 1 ], [128X[104X
    [4X[28X  [ 5, 7 ], [ 5, 6 ], [ 5, 8 ], [ 6, 4 ], [ 6, 8 ], [ 6, 2 ], [128X[104X
    [4X[28X  [ 7, 5 ], [ 7, 1 ], [ 7, 3 ], [ 8, 3 ], [ 8, 2 ], [ 8, 5 ] ][128X[104X
    [4X[25Xgap>[125X [27XDigraphEdges(gr2);[127X[104X
    [4X[28X[ [ 1, 2 ], [ 1, 3 ], [ 1, 4 ], [ 1, 8 ], [ 2, 1 ], [ 2, 5 ], [128X[104X
    [4X[28X  [ 2, 6 ], [ 2, 7 ], [ 3, 8 ], [ 3, 4 ], [ 3, 7 ], [ 3, 6 ], [128X[104X
    [4X[28X  [ 4, 6 ], [ 4, 7 ], [ 4, 1 ], [ 4, 5 ], [ 5, 7 ], [ 5, 6 ], [128X[104X
    [4X[28X  [ 5, 8 ], [ 5, 4 ], [ 6, 4 ], [ 6, 8 ], [ 6, 2 ], [ 6, 3 ], [128X[104X
    [4X[28X  [ 7, 5 ], [ 7, 1 ], [ 7, 3 ], [ 7, 2 ], [ 8, 3 ], [ 8, 2 ], [128X[104X
    [4X[28X  [ 8, 5 ], [ 8, 1 ] ][128X[104X
    [4X[25Xgap>[125X [27Xgr3 := DigraphRemoveEdgeOrbit(gr2, [1, 8]);[127X[104X
    [4X[28X<immutable digraph with 8 vertices, 24 edges>[128X[104X
    [4X[25Xgap>[125X [27Xgr3 = gr1;[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.3-24 DigraphRemoveEdges[101X
  
  [33X[1;0Y[29X[2XDigraphRemoveEdges[102X( [3Xdigraph[103X, [3Xedges[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf one of the following holds:[133X
  
  [30X    [33X[0;6Y[3Xdigraph[103X  is  a  digraph with no multiple edges, and [3Xedges[103X is a list of
        pairs of vertices of [3Xdigraph[103X, or[133X
  
  [30X    [33X[0;6Y[3Xdigraph[103X is a digraph and [3Xedges[103X is an empty list[133X
  
  [33X[0;0Ythen  this  operation returns a digraph constructed from [3Xdigraph[103X by removing
  all of the edges specified by [3Xedges[103X (see [2XDigraphRemoveEdge[102X ([14X3.3-22[114X)).[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  belongs  to  [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the edge is removed
  directly from [3Xdigraph[103X. If [3Xdigraph[103X belongs to [2XIsImmutableDigraph[102X ([14X3.1-3[114X), the
  edge  is  removed  from an immutable copy of [3Xdigraph[103X and this new digraph is
  returned.[133X
  
  [33X[0;0YNote  that if [3Xedges[103X is empty, then this operation will always return [3Xdigraph[103X
  rather  than a copy. Also, if any element of [3Xedges[103X is invalid (i.e. does not
  define an edge of [3Xdigraph[103X) then that element will simply be ignored.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := CycleDigraph(250000);[127X[104X
    [4X[28X<immutable cycle digraph with 250000 vertices>[128X[104X
    [4X[25Xgap>[125X [27XD := DigraphRemoveEdges(D, [[250000, 1]]);[127X[104X
    [4X[28X<immutable digraph with 250000 vertices, 249999 edges>[128X[104X
    [4X[25Xgap>[125X [27XD := DigraphMutableCopy(D);[127X[104X
    [4X[28X<mutable digraph with 250000 vertices, 249999 edges>[128X[104X
    [4X[25Xgap>[125X [27Xnew := DigraphRemoveEdges(D, [[1, 2], [2, 3], [3, 100]]);[127X[104X
    [4X[28X<mutable digraph with 250000 vertices, 249997 edges>[128X[104X
    [4X[25Xgap>[125X [27Xnew = D;[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.3-25 DigraphRemoveLoops[101X
  
  [33X[1;0Y[29X[2XDigraphRemoveLoops[102X( [3Xdigraph[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XDigraphRemoveLoopsAttr[102X( [3Xdigraph[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  is a digraph, then this operation returns a digraph constructed
  from [3Xdigraph[103X by removing every loop. A loop is an edge with equal source and
  range.[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  is  immutable,  then  a  new  immutable  digraph  is  returned.
  Otherwise, the loops are removed from the mutable digraph [3Xdigraph[103X in-place.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := Digraph([[1, 2, 4], [1, 4], [3, 4], [1, 4, 5], [1, 5]]);[127X[104X
    [4X[28X<immutable digraph with 5 vertices, 12 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphRemoveLoops(D);[127X[104X
    [4X[28X<immutable digraph with 5 vertices, 8 edges>[128X[104X
    [4X[25Xgap>[125X [27XD := Digraph(IsMutableDigraph, [[1, 2], [1]]);[127X[104X
    [4X[28X<mutable digraph with 2 vertices, 3 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphRemoveLoops(D);[127X[104X
    [4X[28X<mutable digraph with 2 vertices, 2 edges>[128X[104X
    [4X[25Xgap>[125X [27XD;[127X[104X
    [4X[28X<mutable digraph with 2 vertices, 2 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.3-26 DigraphRemoveAllMultipleEdges[101X
  
  [33X[1;0Y[29X[2XDigraphRemoveAllMultipleEdges[102X( [3Xdigraph[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XDigraphRemoveAllMultipleEdgesAttr[102X( [3Xdigraph[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  is a digraph, then this operation returns a digraph constructed
  from  [3Xdigraph[103X  by  removing  all  multiple  edges. The result is the largest
  subdigraph of [3Xdigraph[103X which does not contain multiple edges.[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  is  immutable,  then  a  new  immutable  digraph  is  returned.
  Otherwise,  the  multiple  edges  of the mutable digraph [3Xdigraph[103X are removed
  in-place.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD1 := Digraph([[1, 2, 3, 2], [1, 1, 3], [2, 2, 2]]);[127X[104X
    [4X[28X<immutable multidigraph with 3 vertices, 10 edges>[128X[104X
    [4X[25Xgap>[125X [27XD2 := DigraphRemoveAllMultipleEdges(D1);[127X[104X
    [4X[28X<immutable digraph with 3 vertices, 6 edges>[128X[104X
    [4X[25Xgap>[125X [27XOutNeighbours(D2);[127X[104X
    [4X[28X[ [ 1, 2, 3 ], [ 1, 3 ], [ 2 ] ][128X[104X
    [4X[25Xgap>[125X [27XD := Digraph(IsMutableDigraph, [[2, 2], [1]]);[127X[104X
    [4X[28X<mutable multidigraph with 2 vertices, 3 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphRemoveAllMultipleEdges(D);[127X[104X
    [4X[28X<mutable digraph with 2 vertices, 2 edges>[128X[104X
    [4X[25Xgap>[125X [27XD;[127X[104X
    [4X[28X<mutable digraph with 2 vertices, 2 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.3-27 DigraphReverseEdges[101X
  
  [33X[1;0Y[29X[2XDigraphReverseEdges[102X( [3Xdigraph[103X, [3Xedges[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XDigraphReverseEdge[102X( [3Xdigraph[103X, [3Xedge[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XDigraphReverseEdge[102X( [3Xdigraph[103X, [3Xsrc[103X, [3Xran[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf [3Xdigraph[103X is a digraph without multiple edges, and [3Xedges[103X is a list of pairs
  of vertices of [3Xdigraph[103X (the entries of each pair corresponding to the source
  and  the range of an edge, respectively), then [10XDigraphReverseEdges[110X returns a
  digraph  constructed from [3Xdigraph[103X by reversing the orientation of every edge
  specified   by   [3Xedges[103X.   If   only   one  edge  is  to  be  reversed,  then
  [10XDigraphReverseEdge[110X  can  be  used instead. In this case, the second argument
  should  just  be  a  single  vertex-pair,  or the second and third arguments
  should be the source and range of an edge respectively.[133X
  
  [33X[0;0YNote  that  even  though  [3Xdigraph[103X cannot have multiple edges, the output may
  have multiple edges.[133X
  
  [33X[0;0YIf  [3Xdigraph[103X belongs to [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the edges are reversed
  in  [3Xdigraph[103X.  If [3Xdigraph[103X belongs to [2XIsImmutableDigraph[102X ([14X3.1-3[114X), an immutable
  copy of [3Xdigraph[103X with the specified edges reversed is returned.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := DigraphFromDiSparse6String(".Tg?i@s?t_e?_qEsC");[127X[104X
    [4X[28X<immutable digraph with 21 vertices, 8 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphEdges(D);[127X[104X
    [4X[28X[ [ 1, 2 ], [ 1, 7 ], [ 1, 8 ], [ 5, 21 ], [ 7, 19 ], [ 9, 1 ], [128X[104X
    [4X[28X  [ 11, 2 ], [ 21, 1 ] ][128X[104X
    [4X[25Xgap>[125X [27Xnew := DigraphReverseEdge(D, [7, 19]);[127X[104X
    [4X[28X<immutable digraph with 21 vertices, 8 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphEdges(new);[127X[104X
    [4X[28X[ [ 1, 2 ], [ 1, 7 ], [ 1, 8 ], [ 5, 21 ], [ 9, 1 ], [ 11, 2 ], [128X[104X
    [4X[28X  [ 19, 7 ], [ 21, 1 ] ][128X[104X
    [4X[25Xgap>[125X [27XD2 := DigraphMutableCopy(new);;[127X[104X
    [4X[25Xgap>[125X [27Xnew := DigraphReverseEdges(D2, [[19, 7]]);;[127X[104X
    [4X[25Xgap>[125X [27XD2 = new;[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XD = new;[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.3-28 DigraphDisjointUnion[101X
  
  [33X[1;0Y[29X[2XDigraphDisjointUnion[102X( [3XD1[103X, [3XD2[103X, [3X...[103X ) [32X function[133X
  [33X[1;0Y[29X[2XDigraphDisjointUnion[102X( [3Xlist[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIn  the  first form, if [3XD1[103X, [3XD2[103X, etc. are digraphs, then [10XDigraphDisjointUnion[110X
  returns  their  disjoint  union.  In the second form, if [3Xlist[103X is a non-empty
  list  of  digraphs,  then [10XDigraphDisjointUnion[110X returns the disjoint union of
  the digraphs contained in the list.[133X
  
  [33X[0;0YFor  a  disjoint  union of digraphs, the vertex set is the disjoint union of
  the vertex sets, and the edge list is the disjoint union of the edge lists.[133X
  
  [33X[0;0YMore  specifically,  for  a collection of digraphs [3XD1[103X, [3XD2[103X, [10X...[110X, the disjoint
  union   with   have  [10XDigraphNrVertices([110X[3XD1[103X[10X)[110X  [10X+[110X  [10XDigraphNrVertices([110X[3XD2[103X[10X)[110X  [10X+[110X  [10X...[110X
  vertices. The edges of [3XD1[103X will remain unchanged, whilst the edges of the [10Xi[110Xth
  digraph,  [3XD[103X[10X[i][110X,  will  be changed so that they belong to the vertices of the
  disjoint  union corresponding to [3XD[103X[10X[i][110X. In particular, the edges of [3XD[103X[10X[i][110X will
  have  their  source  and  range  increased  by [10XDigraphNrVertices([110X[3XD1[103X[10X)[110X [10X+[110X [10X...[110X [10X+[110X
  [10XDigraphNrVertices([110X[3XD[103X[10X[i-1])[110X.[133X
  
  [33X[0;0YNote that previously set [2XDigraphVertexLabels[102X ([14X5.1-10[114X) will be lost.[133X
  
  [33X[0;0YIf  the first digraph [3XD1[103X [[3Xlist[1][103X] belongs to [2XIsMutableDigraph[102X ([14X3.1-2[114X), then
  [3XD1[103X  [[3Xlist[1][103X]  is  modified in place to contain the appropriate vertices and
  edges.  If  [3Xdigraph[103X  belongs  to [2XIsImmutableDigraph[102X ([14X3.1-3[114X), a new immutable
  digraph containing the appropriate vertices and edges is returned.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD1 := CycleDigraph(3);[127X[104X
    [4X[28X<immutable cycle digraph with 3 vertices>[128X[104X
    [4X[25Xgap>[125X [27XOutNeighbours(D1);[127X[104X
    [4X[28X[ [ 2 ], [ 3 ], [ 1 ] ][128X[104X
    [4X[25Xgap>[125X [27XD2 := CompleteDigraph(3);[127X[104X
    [4X[28X<immutable complete digraph with 3 vertices>[128X[104X
    [4X[25Xgap>[125X [27XOutNeighbours(D2);[127X[104X
    [4X[28X[ [ 2, 3 ], [ 1, 3 ], [ 1, 2 ] ][128X[104X
    [4X[25Xgap>[125X [27Xunion := DigraphDisjointUnion(D1, D2);[127X[104X
    [4X[28X<immutable digraph with 6 vertices, 9 edges>[128X[104X
    [4X[25Xgap>[125X [27XOutNeighbours(union);[127X[104X
    [4X[28X[ [ 2 ], [ 3 ], [ 1 ], [ 5, 6 ], [ 4, 6 ], [ 4, 5 ] ][128X[104X
  [4X[32X[104X
  
  [1X3.3-29 DigraphEdgeUnion[101X
  
  [33X[1;0Y[29X[2XDigraphEdgeUnion[102X( [3XD1[103X, [3XD2[103X, [3X...[103X ) [32X function[133X
  [33X[1;0Y[29X[2XDigraphEdgeUnion[102X( [3Xlist[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIn  the  first  form,  if  [3XD1[103X,  [3XD2[103X, etc. are digraphs, then [10XDigraphEdgeUnion[110X
  returns their edge union. In the second form, if [3Xlist[103X is a non-empty list of
  digraphs,  then  [10XDigraphEdgeUnion[110X  returns  the  edge  union of the digraphs
  contained in the list.[133X
  
  [33X[0;0YThe vertex set of the edge union of a collection of digraphs is the [13Xunion[113X of
  the vertex sets, whilst the edge list of the edge union is the [13Xconcatenation[113X
  of  the edge lists. The number of vertices of the edge union is equal to the
  [13Xmaximum[113X  number  of  vertices  of  one of the digraphs, whilst the number of
  edges  of  the  edge union will equal the [13Xsum[113X of the number of edges of each
  digraph.[133X
  
  [33X[0;0YNote that previously set [2XDigraphVertexLabels[102X ([14X5.1-10[114X) will be lost.[133X
  
  [33X[0;0YIf  the first digraph [3XD1[103X [[3Xlist[1][103X] belongs to [2XIsMutableDigraph[102X ([14X3.1-2[114X), then
  [3XD1[103X  [[3Xlist[1][103X]  is  modified in place to contain the appropriate vertices and
  edges.  If  [3Xdigraph[103X  belongs  to [2XIsImmutableDigraph[102X ([14X3.1-3[114X), a new immutable
  digraph containing the appropriate vertices and edges is returned.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := CycleDigraph(10);[127X[104X
    [4X[28X<immutable cycle digraph with 10 vertices>[128X[104X
    [4X[25Xgap>[125X [27XDigraphEdgeUnion(D, D);[127X[104X
    [4X[28X<immutable multidigraph with 10 vertices, 20 edges>[128X[104X
    [4X[25Xgap>[125X [27XD1 := Digraph([[2], [1]]);[127X[104X
    [4X[28X<immutable digraph with 2 vertices, 2 edges>[128X[104X
    [4X[25Xgap>[125X [27XD2 := Digraph([[2, 3], [2], [1]]);[127X[104X
    [4X[28X<immutable digraph with 3 vertices, 4 edges>[128X[104X
    [4X[25Xgap>[125X [27Xunion := DigraphEdgeUnion(D1, D2);[127X[104X
    [4X[28X<immutable multidigraph with 3 vertices, 6 edges>[128X[104X
    [4X[25Xgap>[125X [27XOutNeighbours(union);[127X[104X
    [4X[28X[ [ 2, 2, 3 ], [ 1, 2 ], [ 1 ] ][128X[104X
    [4X[25Xgap>[125X [27Xunion = DigraphByEdges([127X[104X
    [4X[25X>[125X [27XConcatenation(DigraphEdges(D1), DigraphEdges(D2)));[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.3-30 DigraphJoin[101X
  
  [33X[1;0Y[29X[2XDigraphJoin[102X( [3XD1[103X, [3XD2[103X, [3X...[103X ) [32X function[133X
  [33X[1;0Y[29X[2XDigraphJoin[102X( [3Xlist[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIn  the  first  form, if [3XD1[103X, [3XD2[103X, etc. are digraphs, then [10XDigraphJoin[110X returns
  their  join.  In  the  second form, if [3Xlist[103X is a non-empty list of digraphs,
  then [10XDigraphJoin[110X returns the join of the digraphs contained in the list.[133X
  
  [33X[0;0YThe  join  of a collection of digraphs [3XD1[103X, [3XD2[103X, [10X...[110X is formed by first taking
  the  [2XDigraphDisjointUnion[102X ([14X3.3-28[114X) of the collection. In the disjoint union,
  if  [22Xi ≠ j[122X then there are no edges between vertices corresponding to digraphs
  [3XD[103X[10X[i][110X  and  [3XD[103X[10X[j][110X in the collection; the join is created by including all such
  edges.[133X
  
  [33X[0;0YFor example, the join of two empty digraphs is a complete bipartite digraph.[133X
  
  [33X[0;0YNote that previously set [2XDigraphVertexLabels[102X ([14X5.1-10[114X) will be lost.[133X
  
  [33X[0;0YIf  the first digraph [3XD1[103X [[3Xlist[1][103X] belongs to [2XIsMutableDigraph[102X ([14X3.1-2[114X), then
  [3XD1[103X  [[3Xlist[1][103X]  is  modified in place to contain the appropriate vertices and
  edges.  If  [3Xdigraph[103X  belongs  to [2XIsImmutableDigraph[102X ([14X3.1-3[114X), a new immutable
  digraph containing the appropriate vertices and edges is returned.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := CompleteDigraph(3);[127X[104X
    [4X[28X<immutable complete digraph with 3 vertices>[128X[104X
    [4X[25Xgap>[125X [27XIsCompleteDigraph(DigraphJoin(D, D));[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XD2 := CycleDigraph(3);[127X[104X
    [4X[28X<immutable cycle digraph with 3 vertices>[128X[104X
    [4X[25Xgap>[125X [27XDigraphJoin(D, D2);[127X[104X
    [4X[28X<immutable digraph with 6 vertices, 27 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.3-31 DigraphCartesianProduct[101X
  
  [33X[1;0Y[29X[2XDigraphCartesianProduct[102X( [3Xgr1[103X, [3Xgr2[103X, [3X...[103X ) [32X function[133X
  [33X[1;0Y[29X[2XDigraphCartesianProduct[102X( [3Xlist[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIn    the   first   form,   if   [3Xgr1[103X,   [3Xgr2[103X,   etc.   are   digraphs,   then
  [10XDigraphCartesianProduct[110X  returns  a  digraph  isomorphic  to their Cartesian
  product.[133X
  
  [33X[0;0YIn  the  second  form,  if  [3Xlist[103X  is  a  non-empty  list  of  digraphs, then
  [10XDigraphCartesianProduct[110X  returns  a  digraph  isomorphic  to  the  Cartesian
  product of the digraphs contained in the list.[133X
  
  [33X[0;0YMathematically, the Cartesian product of two digraphs [10XG[110X, [10XH[110X is a digraph with
  vertex set [10XCartesian(DigraphVertices(G), DigraphVertices(H))[110X such that there
  is  an edge from [10X[u, u'][110X to [10X[v, v'][110X iff [10X u = v [110X and there is an edge from [10Xu'[110X
  to [10Xv'[110X in [10XH[110X or [10X u' = v'[110X and there is an edge from [10Xu[110X to [10Xv[110X in [10XG[110X.[133X
  
  [33X[0;0YDue  to technical reasons, the digraph [10XD[110X returned by [10XDigraphCartesianProduct[110X
  has vertex set [10X[1 .. DigraphNrVertices(G)*DigraphNrVertices(H)][110X instead, and
  the   exact   method   of  encoding  pairs  of  vertices  into  integers  is
  implementation  specific.  The original vertex pair can be somewhat regained
  by   using   [2XDigraphCartesianProductProjections[102X   ([14X3.3-38[114X).   In   addition,
  [2XDigraphVertexLabels[102X  ([14X5.1-10[114X)  are  preserved:  if  vertex  pair  [10X[u,u'][110X was
  encoded as [10Xi[110X then the vertex label of [10Xi[110X will be the pair of vertex labels of
  [10Xu[110X   and   [10Xu'[110X   i.e.   [10XDigraphVertexLabel(D,i)   =  [DigraphVertexLabel(G,u),
  DigraphVertexLabel(H,u')][110X.[133X
  
  [33X[0;0YAs  the  Cartesian  product  is  associative,  the  Cartesian  product  of a
  collection of digraphs [3Xgr1[103X, [3Xgr2[103X, [10X...[110X is computed in the obvious fashion.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xgr := ChainDigraph(4);[127X[104X
    [4X[28X<immutable chain digraph with 4 vertices>[128X[104X
    [4X[25Xgap>[125X [27Xgr2 := CycleDigraph(3);[127X[104X
    [4X[28X<immutable cycle digraph with 3 vertices>[128X[104X
    [4X[25Xgap>[125X [27Xgr3 := DigraphCartesianProduct(gr, gr2);[127X[104X
    [4X[28X<immutable digraph with 12 vertices, 21 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsIsomorphicDigraph(gr3, [127X[104X
    [4X[25X>[125X [27XDigraph([[2, 5], [3, 6], [4, 7], [8], [127X[104X
    [4X[25X>[125X [27X         [6, 9], [7, 10], [8, 11], [12],[127X[104X
    [4X[25X>[125X [27X         [10, 1], [11, 2], [12, 3], [4]]));[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.3-32 DigraphDirectProduct[101X
  
  [33X[1;0Y[29X[2XDigraphDirectProduct[102X( [3Xgr1[103X, [3Xgr2[103X, [3X...[103X ) [32X function[133X
  [33X[1;0Y[29X[2XDigraphDirectProduct[102X( [3Xlist[103X ) [32X function[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIn the first form, if [3Xgr1[103X, [3Xgr2[103X, etc. are digraphs, then [10XDigraphDirectProduct[110X
  returns a digraph isomorphic to their direct product.[133X
  
  [33X[0;0YIn  the  second  form,  if  [3Xlist[103X  is  a  non-empty  list  of  digraphs, then
  [10XDigraphDirectProduct[110X  returns  a digraph isomorphic to the direct product of
  the digraphs contained in the list.[133X
  
  [33X[0;0YMathematically,  the  direct  product of two digraphs [10XG[110X, [10XH[110X is a digraph with
  vertex set [10XCartesian(DigraphVertices(G), DigraphVertices(H))[110X such that there
  is an edge from [10X[u, u'][110X to [10X[v, v'][110X iff there is an edge from [10Xu[110X to [10Xv[110X in [10XG[110X and
  an edge from [10Xu'[110X to [10Xv'[110X in [10XH[110X.[133X
  
  [33X[0;0YDue to technical reasons, the digraph [10XD[110X returned by [10XDigraphDirectProduct[110X has
  vertex set [10X[1 .. DigraphNrVertices(G)*DigraphNrVertices(H)][110X instead, and the
  exact  method  of encoding pairs of vertices into integers is implementation
  specific.  The  original  vertex  pair  can  be  somewhat  regained by using
  [2XDigraphDirectProductProjections[102X  ([14X3.3-39[114X).  In  addition [2XDigraphVertexLabels[102X
  ([14X5.1-10[114X)  are  preserved:  if  vertex  pair [10X[u,u'][110X was encoded as [10Xi[110X then the
  vertex  label  of  [10Xi[110X  will  be  the  pair  of vertex labels of [10Xu[110X and [10Xu'[110X i.e.
  [10XDigraphVertexLabel(D,i)              =             [DigraphVertexLabel(G,u),
  DigraphVertexLabel(H,u')][110X.[133X
  
  [33X[0;0YAs  the direct product is associative, the direct product of a collection of
  digraphs [3Xgr1[103X, [3Xgr2[103X, [10X...[110X is computed in the obvious fashion.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xgr := ChainDigraph(4);[127X[104X
    [4X[28X<immutable chain digraph with 4 vertices>[128X[104X
    [4X[25Xgap>[125X [27Xgr2 := CycleDigraph(3);[127X[104X
    [4X[28X<immutable cycle digraph with 3 vertices>[128X[104X
    [4X[25Xgap>[125X [27Xgr3 := DigraphDirectProduct(gr, gr2);[127X[104X
    [4X[28X<immutable digraph with 12 vertices, 9 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsIsomorphicDigraph(gr3, [127X[104X
    [4X[25X>[125X [27XDigraph([[6], [7], [8], [], [127X[104X
    [4X[25X>[125X [27X         [10], [11], [12], [],[127X[104X
    [4X[25X>[125X [27X         [2], [3], [4], []]));[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.3-33 ConormalProduct[101X
  
  [33X[1;0Y[29X[2XConormalProduct[102X( [3XD1[103X, [3XD2[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3XD1[103X  and  [3XD2[103X  are  digraphs  without multiple edges, then [10XConormalProduct[110X
  calculates  the  [13Xco-normal  product  digraph[113X  ([10XCNPD[110X)  of [3XD1[103X and [3XD2[103X. [10XCNPD[110X has
  vertex set [10XV1 x V2[110X where [10XV1[110X is the vertex set of [3XD1[103X and [10XV2[110X is the vertex set
  of [3XD2[103X (a vertex [10X[a, b][110X has label [10X(a - 1) * |V2| + b[110X in the output). There is
  an  edge  from  [10X[a,  b][110X  to  [10X[c,  d][110X  when at least one of the following two
  conditions are satisfied:[133X
  
  [30X    [33X[0;6YThere is an edge from [10Xa[110X to [10Xc[110X in [3XD1[103X.[133X
  
  [30X    [33X[0;6YThere is an edge from [10Xb[110X to [10Xd[110X in [3XD2[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XConormalProduct(DigraphSymmetricClosure(CycleDigraph(7)),[127X[104X
    [4X[25X>[125X [27XDigraphSymmetricClosure(CycleDigraph(4)));[127X[104X
    [4X[28X<immutable digraph with 28 vertices, 504 edges>[128X[104X
    [4X[25Xgap>[125X [27XConormalProduct(NullDigraph(0), CompleteDigraph(10));[127X[104X
    [4X[28X<immutable empty digraph with 0 vertices>[128X[104X
  [4X[32X[104X
  
  [1X3.3-34 HomomorphicProduct[101X
  
  [33X[1;0Y[29X[2XHomomorphicProduct[102X( [3XD1[103X, [3XD2[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3XD1[103X  and  [3XD2[103X are digraphs without multiple edges, then [10XHomomorphicProduct[110X
  calculates  the  [13Xhomomorphic  product  digraph[113X  ([10XHPD[110X)  of [3XD1[103X and [3XD2[103X. [10XHPD[110X has
  vertex set [10XV1 x V2[110X where [10XV1[110X is the vertex set of [3XD1[103X and [10XV2[110X is the vertex set
  of [3XD2[103X (a vertex [10X[a, b][110X has label [10X(a - 1) * |V2| + b[110X in the output). There is
  an  edge  from  [10X[a,  b][110X  to  [10X[c,  d][110X  when at least one of the following two
  conditions are satisfied:[133X
  
  [30X    [33X[0;6YThe vertices [10Xa[110X and [10Xc[110X of [3XD1[103X are equal.[133X
  
  [30X    [33X[0;6YThere is an edge from [10Xa[110X to [10Xc[110X in [3XD1[103X and no edge from [10Xb[110X to [10Xd[110X in [3XD2[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XHomomorphicProduct(PetersenGraph(),[127X[104X
    [4X[25X>[125X [27XDigraphSymmetricClosure(ChainDigraph(4)));[127X[104X
    [4X[28X<immutable digraph with 40 vertices, 460 edges>[128X[104X
    [4X[25Xgap>[125X [27XD1 := Digraph([[2], [1, 3, 4], [2, 5], [2, 5], [3, 4]]);[127X[104X
    [4X[28X<immutable digraph with 5 vertices, 10 edges>[128X[104X
    [4X[25Xgap>[125X [27XD2 := Digraph([[2], [1, 3], [2, 4], [3]]);[127X[104X
    [4X[28X<immutable digraph with 4 vertices, 6 edges>[128X[104X
    [4X[25Xgap>[125X [27XHomomorphicProduct(D1, D2);[127X[104X
    [4X[28X<immutable digraph with 20 vertices, 180 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.3-35 LexicographicProduct[101X
  
  [33X[1;0Y[29X[2XLexicographicProduct[102X( [3XD1[103X, [3XD2[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3XD1[103X and [3XD2[103X are digraphs without multiple edges, then [10XLexicographicProduct[110X
  calculates  the  [13Xlexicographic  product  digraph[113X ([10XLPD[110X) of [3XD1[103X and [3XD2[103X. [10XLPD[110X has
  vertex set [10XV1 x V2[110X where [10XV1[110X is the vertex set of [3XD1[103X and [10XV2[110X is the vertex set
  of [3XD2[103X (a vertex [10X[a, b][110X has label [10X(a - 1) * |V2| + b[110X in the output). There is
  an  edge  from  [10X[a,  b][110X  to  [10X[c,  d][110X  when at least one of the following two
  conditions are satisfied:[133X
  
  [30X    [33X[0;6YThere is an edge from [10Xa[110X to [10Xc[110X in [3XD1[103X.[133X
  
  [30X    [33X[0;6YThe  vertices [10Xa[110X and [10Xc[110X of [3XD1[103X are equal and there is an edge from [10Xb[110X to [10Xd[110X
        in [3XD2[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XLexicographicProduct(DigraphSymmetricClosure(CycleDigraph(3)),[127X[104X
    [4X[25X>[125X [27XDigraphSymmetricClosure(ChainDigraph(2)));[127X[104X
    [4X[28X<immutable digraph with 6 vertices, 30 edges>[128X[104X
    [4X[25Xgap>[125X [27XOutNeighbours(last);[127X[104X
    [4X[28X[ [ 2, 3, 4, 5, 6 ], [ 1, 3, 4, 5, 6 ], [ 1, 2, 4, 5, 6 ], [128X[104X
    [4X[28X  [ 1, 2, 3, 5, 6 ], [ 1, 2, 3, 4, 6 ], [ 1, 2, 3, 4, 5 ] ][128X[104X
    [4X[25Xgap>[125X [27XLexicographicProduct(NullDigraph(0), CompleteDigraph(10));[127X[104X
    [4X[28X<immutable empty digraph with 0 vertices>[128X[104X
  [4X[32X[104X
  
  [1X3.3-36 ModularProduct[101X
  
  [33X[1;0Y[29X[2XModularProduct[102X( [3XD1[103X, [3XD2[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3XD1[103X  and  [3XD2[103X  are  digraphs  without  multiple edges, then [10XModularProduct[110X
  calculates  the  [13Xmodular  product digraph[113X ([10XMPD[110X) of [3XD1[103X and [3XD2[103X. [10XMPD[110X has vertex
  set  [10XV1 x V2[110X where [10XV1[110X is the vertex set of [3XD1[103X and [10XV2[110X is the vertex set of [3XD2[103X
  (a  vertex  [10X[a,  b][110X has label [10X(a - 1) * |V2| + b[110X in the output). There is an
  edge  from  [10X[a, b][110X to [10X[c, d][110X precisely when the following two conditions are
  satisfied:[133X
  
  [30X    [33X[0;6YThe vertices [10Xa[110X and [10Xc[110X of [3XD1[103X are equal if and only if the vertices [10Xb[110X and
        [10Xd[110X of [3XD2[103X are equal.[133X
  
  [30X    [33X[0;6YThere  is  an  edge  from [10Xa[110X to [10Xc[110X in [3XD1[103X if and only if there is an edge
        from [10Xb[110X to [10Xd[110X in [3XD2[103X.[133X
  
  [33X[0;0YNotably,  the  complete  (with  loops)  subdigraphs of [10XMPD[110X are precisely the
  partial isomorphisms from [3XD1[103X to [3XD2[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XModularProduct(Digraph([[1], [1, 2]]), Digraph([[], [2]]));[127X[104X
    [4X[28X<immutable digraph with 4 vertices, 4 edges>[128X[104X
    [4X[25Xgap>[125X [27XOutNeighbours(last);[127X[104X
    [4X[28X[ [ 4 ], [ 2, 3 ], [  ], [ 4 ] ][128X[104X
    [4X[25Xgap>[125X [27XModularProduct(PetersenGraph(),[127X[104X
    [4X[25X>[125X [27XDigraphSymmetricClosure(CycleDigraph(5)));[127X[104X
    [4X[28X<immutable digraph with 50 vertices, 950 edges>[128X[104X
    [4X[25Xgap>[125X [27XModularProduct(NullDigraph(0), CompleteDigraph(10));[127X[104X
    [4X[28X<immutable empty digraph with 0 vertices>[128X[104X
  [4X[32X[104X
  
  [1X3.3-37 StrongProduct[101X
  
  [33X[1;0Y[29X[2XStrongProduct[102X( [3XD1[103X, [3XD2[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3XD1[103X  and  [3XD2[103X  are  digraphs  without  multiple  edges, then [10XStrongProduct[110X
  calculates the [13Xstrong product digraph[113X ([10XSPD[110X) of [3XD1[103X and [3XD2[103X. [10XSPD[110X has vertex set
  [10XV1  x  V2[110X where [10XV1[110X is the vertex set of [3XD1[103X and [10XV2[110X is the vertex set of [3XD2[103X (a
  vertex  [10X[a, b][110X has label [10X(a - 1) * |V2| + b[110X in the output). There is an edge
  from  [10X[a,  b][110X  to [10X[c, d][110X when at least one of the following three conditions
  are satisfied:[133X
  
  [30X    [33X[0;6YThe  vertices [10Xa[110X and [10Xc[110X of [3XD1[103X are equal and there is an edge from [10Xb[110X to [10Xd[110X
        in [3XD2[103X.[133X
  
  [30X    [33X[0;6YThe  vertices [10Xb[110X and [10Xd[110X of [3XD2[103X are equal and there is an edge from [10Xa[110X to [10Xc[110X
        in [3XD1[103X.[133X
  
  [30X    [33X[0;6YThere is an edge from [10Xa[110X to [10Xc[110X in [3XD1[103X and there is an edge from [10Xb[110X to [10Xd[110X in
        [3XD2[103X.[133X
  
  [33X[0;0YThe SPD of two paths of lengths [10Xm[110X and [10Xn[110X is also the king's graph for an [10Xm[110X by
  [10Xn[110X board.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD1 := Digraph([[2], [1, 3, 4], [2, 5], [2, 5], [3, 4]]);[127X[104X
    [4X[28X<immutable digraph with 5 vertices, 10 edges>[128X[104X
    [4X[25Xgap>[125X [27XD2 := Digraph([[2], [1, 3, 4], [2], [2]]);[127X[104X
    [4X[28X<immutable digraph with 4 vertices, 6 edges>[128X[104X
    [4X[25Xgap>[125X [27XStrongProduct(D1, D2);[127X[104X
    [4X[28X<immutable digraph with 20 vertices, 130 edges>[128X[104X
    [4X[25Xgap>[125X [27XStrongProduct(DigraphSymmetricClosure(ChainDigraph(3)),[127X[104X
    [4X[25X>[125X [27XDigraphSymmetricClosure(ChainDigraph(4)));[127X[104X
    [4X[28X<immutable digraph with 12 vertices, 58 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.3-38 DigraphCartesianProductProjections[101X
  
  [33X[1;0Y[29X[2XDigraphCartesianProductProjections[102X( [3Xdigraph[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10YA list of transformations.[133X
  
  [33X[0;0YIf    [3Xdigraph[103X    is    a    Cartesian    product    digraph,    [10Xdigraph    =
  DigraphCartesianProduct(gr_1,         gr_2,        ...        )[110X,        then
  [10XDigraphCartesianProductProjections[110X  returns a list [10Xproj[110X such that [10Xproj[i][110X is
  the projection onto the [10Xi[110X-th coordinate of the product.[133X
  
  [33X[0;0YA  projection is an idempotent endomorphism of [3Xdigraph[103X. If [10Xgr1, gr2, ...[110X are
  all  loopless  digraphs, then the induced subdigraph of [3Xdigraph[103X on the image
  of [10Xproj[i][110X is isomorphic to [10Xgr_i[110X.[133X
  
  [33X[0;0YCurrently  this attribute is only set upon creating an immutable digraph via
  [10XDigraphCartesianProduct[110X  and  there  is  no  way of calculating it for other
  digraphs.[133X
  
  [33X[0;0YFor more information see [2XDigraphCartesianProduct[102X ([14X3.3-31[114X)[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := DigraphCartesianProduct(ChainDigraph(3), CycleDigraph(4),[127X[104X
    [4X[25X>[125X [27XDigraph([[2], [2]]));;[127X[104X
    [4X[25Xgap>[125X [27XHasDigraphCartesianProductProjections(D);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27Xproj := DigraphCartesianProductProjections(D);; Length(proj);[127X[104X
    [4X[28X3[128X[104X
    [4X[25Xgap>[125X [27XIsIdempotent(proj[2]);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XRankOfTransformation(proj[3]);[127X[104X
    [4X[28X2[128X[104X
    [4X[25Xgap>[125X [27XS := ImageSetOfTransformation(proj[2]);;[127X[104X
    [4X[25Xgap>[125X [27XIsIsomorphicDigraph(CycleDigraph(4), InducedSubdigraph(D, S));[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.3-39 DigraphDirectProductProjections[101X
  
  [33X[1;0Y[29X[2XDigraphDirectProductProjections[102X( [3Xdigraph[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10YA list of transformations.[133X
  
  [33X[0;0YIf [3Xdigraph[103X is a direct product digraph, [10Xdigraph = DigraphDirectProduct(gr_1,
  gr_2,  ...  )[110X, then [10XDigraphDirectProductProjections[110X returns a list [10Xproj[110X such
  that [10Xproj[i][110X is the projection onto the [10Xi[110X-th coordinate of the product.[133X
  
  [33X[0;0YA  projection is an idempotent endomorphism of [3Xdigraph[103X. If [10Xgr1, gr2, ...[110X are
  all loopless digraphs, then the image of [3Xdigraph[103X under [10Xproj[i][110X is isomorphic
  to [10Xgr_i[110X.[133X
  
  [33X[0;0YCurrently  this attribute is only set upon creating an immutable digraph via
  [10XDigraphDirectProduct[110X  and  there  is  no  way  of  calculating  it for other
  digraphs.[133X
  
  [33X[0;0YFor more information, see [2XDigraphDirectProduct[102X ([14X3.3-32[114X)[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := DigraphDirectProduct(ChainDigraph(3), CycleDigraph(4),[127X[104X
    [4X[25X>[125X [27XDigraph([[2], [2]]));;[127X[104X
    [4X[25Xgap>[125X [27XHasDigraphDirectProductProjections(D);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27Xproj := DigraphDirectProductProjections(D);; Length(proj);[127X[104X
    [4X[28X3[128X[104X
    [4X[25Xgap>[125X [27XIsIdempotent(proj[2]);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XRankOfTransformation(proj[3]);[127X[104X
    [4X[28X2[128X[104X
    [4X[25Xgap>[125X [27XP := DigraphRemoveAllMultipleEdges([127X[104X
    [4X[25X>[125X [27XReducedDigraph(OnDigraphs(D, proj[2])));; [127X[104X
    [4X[25Xgap>[125X [27XIsIsomorphicDigraph(CycleDigraph(4), P);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.3-40 LineDigraph[101X
  
  [33X[1;0Y[29X[2XLineDigraph[102X( [3Xdigraph[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XEdgeDigraph[102X( [3Xdigraph[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YGiven  a  digraph  [3Xdigraph[103X,  the  operation  returns the digraph obtained by
  associating  a vertex with each edge of [3Xdigraph[103X, and creating an edge from a
  vertex  [9Xv[109X  to  a  vertex  [9Xu[109X  if  and only if the terminal vertex of the edge
  associated with [9Xv[109X is the start vertex of the edge associated with [9Xu[109X.[133X
  
  [33X[0;0YNote  that  the  returned digraph is always a new immutable digraph, and the
  argument [3Xdigraph[103X is never modified.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XLineDigraph(CompleteDigraph(3));[127X[104X
    [4X[28X<immutable digraph with 6 vertices, 12 edges>[128X[104X
    [4X[25Xgap>[125X [27XLineDigraph(ChainDigraph(3));[127X[104X
    [4X[28X<immutable digraph with 2 vertices, 1 edge>[128X[104X
  [4X[32X[104X
  
  [1X3.3-41 LineUndirectedDigraph[101X
  
  [33X[1;0Y[29X[2XLineUndirectedDigraph[102X( [3Xdigraph[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XEdgeUndirectedDigraph[102X( [3Xdigraph[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YGiven  a  symmetric  digraph  [3Xdigraph[103X,  the  operation returns the symmetric
  digraph obtained by associating a vertex with each edge of [3Xdigraph[103X, ignoring
  directions and multiplicites, and adding an edge between two vertices if and
  only if the corresponding edges have a vertex in common.[133X
  
  [33X[0;0YNote  that  the  returned digraph is always a new immutable digraph, and the
  argument [3Xdigraph[103X is never modified.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XLineUndirectedDigraph(CompleteDigraph(3));[127X[104X
    [4X[28X<immutable digraph with 3 vertices, 6 edges>[128X[104X
    [4X[25Xgap>[125X [27XLineUndirectedDigraph(DigraphSymmetricClosure(ChainDigraph(3)));[127X[104X
    [4X[28X<immutable digraph with 2 vertices, 2 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.3-42 DoubleDigraph[101X
  
  [33X[1;0Y[29X[2XDoubleDigraph[102X( [3Xdigraph[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YLet [3Xdigraph[103X be a digraph with vertex set [10XV[110X. This function returns the double
  digraph  of  [3Xdigraph[103X.  The  vertex  set of the double digraph is the orginal
  vertex  set  together  with  a duplicate. The edges are [10X[u_1, v_2][110X and [10X[u_2,
  v_1][110X if and only if [10X[u, v][110X is an edge in [3Xdigraph[103X, together with the original
  edges and their duplicates.[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  is  mutable,  then  [3Xdigraph[103X is modified in-place. If [3Xdigraph[103X is
  immutable,  then  a  new immutable digraph constructed as described above is
  returned.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xgamma := Digraph([[2], [3], [1]]);[127X[104X
    [4X[28X<immutable digraph with 3 vertices, 3 edges>[128X[104X
    [4X[25Xgap>[125X [27XDoubleDigraph(gamma);[127X[104X
    [4X[28X<immutable digraph with 6 vertices, 12 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.3-43 BipartiteDoubleDigraph[101X
  
  [33X[1;0Y[29X[2XBipartiteDoubleDigraph[102X( [3Xdigraph[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YLet  [3Xdigraph[103X  be  a  digraph  with  vertex  set [10XV[110X. This function returns the
  bipartite double digraph of [3Xdigraph[103X. The vertex set of the double digraph is
  the  original vertex set together with a duplicate. The edges are [10X[u_1, v_2][110X
  and  [10X[u_2,  v_1][110X  if and only if [10X[u, v][110X is an edge in [3Xdigraph[103X. The resulting
  graph  is  bipartite,  since  the  orignal  edges  are  not  included in the
  resulting digraph.[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  is  mutable,  then  [3Xdigraph[103X is modified in-place. If [3Xdigraph[103X is
  immutable,  then  a  new immutable digraph constructed as described above is
  returned.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xgamma := Digraph([[2], [3], [1]]);[127X[104X
    [4X[28X<immutable digraph with 3 vertices, 3 edges>[128X[104X
    [4X[25Xgap>[125X [27XBipartiteDoubleDigraph(gamma);[127X[104X
    [4X[28X<immutable digraph with 6 vertices, 6 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.3-44 DigraphAddAllLoops[101X
  
  [33X[1;0Y[29X[2XDigraphAddAllLoops[102X( [3Xdigraph[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XDigraphAddAllLoopsAttr[102X( [3Xdigraph[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YFor  a digraph [3Xdigraph[103X this operation returns a new digraph constructed from
  [3Xdigraph[103X,  such  that  a  loop is added for every vertex which did not have a
  loop in [3Xdigraph[103X.[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  is  immutable,  then  a  new  immutable  digraph  is  returned.
  Otherwise,  the  loops  are  added  to  the loopless vertices of the mutable
  digraph [3Xdigraph[103X in-place.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := EmptyDigraph(13);[127X[104X
    [4X[28X<immutable empty digraph with 13 vertices>[128X[104X
    [4X[25Xgap>[125X [27XD := DigraphAddAllLoops(D);[127X[104X
    [4X[28X<immutable reflexive digraph with 13 vertices, 13 edges>[128X[104X
    [4X[25Xgap>[125X [27XOutNeighbours(D);[127X[104X
    [4X[28X[ [ 1 ], [ 2 ], [ 3 ], [ 4 ], [ 5 ], [ 6 ], [ 7 ], [ 8 ], [ 9 ], [128X[104X
    [4X[28X  [ 10 ], [ 11 ], [ 12 ], [ 13 ] ][128X[104X
    [4X[25Xgap>[125X [27XD := Digraph([[1, 2, 3], [1, 3], [1]]);[127X[104X
    [4X[28X<immutable digraph with 3 vertices, 6 edges>[128X[104X
    [4X[25Xgap>[125X [27XD := DigraphAddAllLoops(D);[127X[104X
    [4X[28X<immutable reflexive digraph with 3 vertices, 8 edges>[128X[104X
    [4X[25Xgap>[125X [27XOutNeighbours(D);[127X[104X
    [4X[28X[ [ 1, 2, 3 ], [ 1, 3, 2 ], [ 1, 3 ] ][128X[104X
    [4X[25Xgap>[125X [27XD := CycleDigraph(IsMutableDigraph, 3);[127X[104X
    [4X[28X<mutable digraph with 3 vertices, 3 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphAddAllLoops(D);[127X[104X
    [4X[28X<mutable digraph with 3 vertices, 6 edges>[128X[104X
    [4X[25Xgap>[125X [27XD;[127X[104X
    [4X[28X<mutable digraph with 3 vertices, 6 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.3-45 DistanceDigraph[101X
  
  [33X[1;0Y[29X[2XDistanceDigraph[102X( [3Xdigraph[103X, [3Xi[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XDistanceDigraph[102X( [3Xdigraph[103X, [3Xlist[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YThe  first  argument  is  a  digraph,  the second argument is a non-negative
  integer  or a list of positive integers. This operation returns a digraph on
  the same set of vertices as [3Xdigraph[103X, with two vertices being adjacent if and
  only  if  the  distance  between  them in [3Xdigraph[103X equals [3Xi[103X or is a number in
  [3Xlist[103X. See [2XDigraphShortestDistance[102X ([14X5.3-2[114X).[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  is  mutable,  then  [3Xdigraph[103X is modified in-place. If [3Xdigraph[103X is
  immutable,  then  a  new immutable digraph constructed as described above is
  returned.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xdigraph := DigraphFromSparse6String([127X[104X
    [4X[25X>[125X [27X":]n?AL`BC_DEbEF`GIaGHdIJeGKcKL_@McDHfILaBJfHMjKM");[127X[104X
    [4X[28X<immutable symmetric digraph with 30 vertices, 90 edges>[128X[104X
    [4X[25Xgap>[125X [27XDistanceDigraph(digraph, 1);[127X[104X
    [4X[28X<immutable digraph with 30 vertices, 90 edges>[128X[104X
    [4X[25Xgap>[125X [27XDistanceDigraph(digraph, [1, 2]);[127X[104X
    [4X[28X<immutable digraph with 30 vertices, 270 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.3-46 DigraphClosure[101X
  
  [33X[1;0Y[29X[2XDigraphClosure[102X( [3Xdigraph[103X, [3Xk[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YGiven  a  symmetric  loopless  digraph  with  no multiple edges [3Xdigraph[103X, the
  [13X[3Xk[103X-closure of [3Xdigraph[103X[113X is defined to be the unique smallest symmetric loopless
  digraph  [10XC[110X  with  no multiple edges on the vertices of [3Xdigraph[103X that contains
  all  the  edges  of  [3Xdigraph[103X  and satsifies the property that the sum of the
  degrees  of  every  two  non-adjacenct  vertices  in  [10XC[110X  is less than [3Xk[103X. See
  [2XIsSymmetricDigraph[102X   ([14X6.1-12[114X),   [2XDigraphHasLoops[102X   ([14X6.1-1[114X),   [2XIsMultiDigraph[102X
  ([14X6.1-10[114X), and [2XOutDegreeOfVertex[102X ([14X5.2-10[114X).[133X
  
  [33X[0;0YThe operation [10XDigraphClosure[110X returns the [3Xk[103X-closure of [3Xdigraph[103X.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := CompleteDigraph(6);[127X[104X
    [4X[28X<immutable complete digraph with 6 vertices>[128X[104X
    [4X[25Xgap>[125X [27XD := DigraphRemoveEdges(D, [[1, 2], [2, 1]]);[127X[104X
    [4X[28X<immutable digraph with 6 vertices, 28 edges>[128X[104X
    [4X[25Xgap>[125X [27Xclosure := DigraphClosure(D, 6);[127X[104X
    [4X[28X<immutable digraph with 6 vertices, 30 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsCompleteDigraph(closure);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.3-47 DigraphMycielskian[101X
  
  [33X[1;0Y[29X[2XDigraphMycielskian[102X( [3Xdigraph[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XDigraphMycielskianAttr[102X( [3Xdigraph[103X ) [32X attribute[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  is  a  symmetric  digraph,  then [10XDigraphMycielskian[110X returns the
  Mycielskian of [3Xdigraph[103X.[133X
  
  [33X[0;0YThe  Mycielskian  of  a  symmetric  digraph  is  a  larger symmetric digraph
  constructed  from  it,  which  has  a  larger  chromatic number. For further
  information, see [7Xhttps://en.wikipedia.org/wiki/Mycielskian[107X.[133X
  
  [33X[0;0YIf  [3Xdigraph[103X  is  immutable,  then  a  new  immutable  digraph  is  returned.
  Otherwise,  the  mutable  digraph  [3Xdigraph[103X  is  changed  in-place  into  its
  Mycielskian.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := CycleDigraph(2);[127X[104X
    [4X[28X<immutable cycle digraph with 2 vertices>[128X[104X
    [4X[25Xgap>[125X [27XChromaticNumber(D);[127X[104X
    [4X[28X2[128X[104X
    [4X[25Xgap>[125X [27XD := DigraphMycielskian(D);[127X[104X
    [4X[28X<immutable digraph with 5 vertices, 10 edges>[128X[104X
    [4X[25Xgap>[125X [27XChromaticNumber(D);[127X[104X
    [4X[28X3[128X[104X
    [4X[25Xgap>[125X [27XD := DigraphMycielskian(D);[127X[104X
    [4X[28X<immutable digraph with 11 vertices, 40 edges>[128X[104X
    [4X[25Xgap>[125X [27XChromaticNumber(D);[127X[104X
    [4X[28X4[128X[104X
    [4X[25Xgap>[125X [27XD := CompleteBipartiteDigraph(IsMutable, 2, 3);[127X[104X
    [4X[28X<mutable digraph with 5 vertices, 12 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphMycielskian(D);[127X[104X
    [4X[28X<mutable digraph with 11 vertices, 46 edges>[128X[104X
    [4X[25Xgap>[125X [27XD;[127X[104X
    [4X[28X<mutable digraph with 11 vertices, 46 edges>[128X[104X
  [4X[32X[104X
  
  
  [1X3.4 [33X[0;0YRandom digraphs[133X[101X
  
  [1X3.4-1 RandomDigraph[101X
  
  [33X[1;0Y[29X[2XRandomDigraph[102X( [[3Xfilt[103X, ][3Xn[103X[, [3Xp[103X] ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [33X[0;0YIf [3Xn[103X is a positive integer, then this function returns a random digraph with
  [3Xn[103X vertices and without multiple edges. The result may or may not have loops.[133X
  
  [33X[0;0YIf the optional second argument [3Xp[103X is a float with value [22X0 ≤[122X [3X p [103X [22X≤ 1[122X, then an
  edge will exist between each pair of vertices with probability approximately
  [3Xp[103X.  If [3Xp[103X is not specified, then a random probability will be assumed (chosen
  with uniform probability).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XRandomDigraph(1000);[127X[104X
    [4X[28X<immutable digraph with 1000 vertices, 364444 edges>[128X[104X
    [4X[25Xgap>[125X [27XRandomDigraph(10000, 0.023);[127X[104X
    [4X[28X<immutable digraph with 10000 vertices, 2300438 edges>[128X[104X
    [4X[25Xgap>[125X [27XRandomDigraph(IsMutableDigraph, 1000, 1 / 2);[127X[104X
    [4X[28X<mutable digraph with 1000 vertices, 499739 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.4-2 RandomMultiDigraph[101X
  
  [33X[1;0Y[29X[2XRandomMultiDigraph[102X( [3Xn[103X[, [3Xm[103X] ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf [3Xn[103X is a positive integer, then this function returns a random digraph with
  [3Xn[103X  vertices.  If  the optional second argument [3Xm[103X is a positive integer, then
  the  digraph  will  have  [3Xm[103X edges. If [3Xm[103X is not specified, then the number of
  edges  will  be chosen randomly (with uniform probability) from the range [10X[1
  .. [110X[22Xn choose 2[122X[10X][110X.[133X
  
  [33X[0;0YThe  method  used  by  this  function  chooses each edge from the set of all
  possible edges with uniform probability. No effort is made to avoid creating
  multiple  edges, so it is possible (but not guaranteed) that the result will
  have multiple edges. The result may or may not have loops.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XRandomMultiDigraph(1000);[127X[104X
    [4X[28X<immutable multidigraph with 1000 vertices, 216659 edges>[128X[104X
    [4X[25Xgap>[125X [27XRandomMultiDigraph(1000, 950);[127X[104X
    [4X[28X<immutable multidigraph with 1000 vertices, 950 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.4-3 RandomTournament[101X
  
  [33X[1;0Y[29X[2XRandomTournament[102X( [[3Xfilt[103X, ][3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [33X[0;0YIf  [3Xn[103X  is  a non-negative integer, this function returns a random tournament
  with [3Xn[103X vertices. See [2XIsTournament[102X ([14X6.1-13[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XRandomTournament(10);[127X[104X
    [4X[28X<immutable tournament with 10 vertices>[128X[104X
    [4X[25Xgap>[125X [27XRandomTournament(IsMutableDigraph, 10);[127X[104X
    [4X[28X<mutable digraph with 1000 vertices, 500601 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.4-4 RandomLattice[101X
  
  [33X[1;0Y[29X[2XRandomLattice[102X( [3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [33X[0;0YIf  [3Xn[103X  is  a  positive integer, this function return a random lattice with [10Xm[110X
  vertices,  where  it  is  guaranteed  that  [10Xm[110X  is  between  [3Xn[103X and [10X2 * [3Xn[103X[10X[110X. See
  [2XIsLatticeDigraph[102X ([14X6.1-17[114X).[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XRandomLattice(10);[127X[104X
    [4X[28X<immutable lattice digraph with 10 vertices, 39 edges>[128X[104X
    [4X[25Xgap>[125X [27XRandomLattice(IsMutableDigraph, 10);[127X[104X
    [4X[28X<mutable digraph with 12 vertices, 52 edges>[128X[104X
  [4X[32X[104X
  
  
  [1X3.5 [33X[0;0YStandard examples[133X[101X
  
  [1X3.5-1 AndrasfaiGraph[101X
  
  [33X[1;0Y[29X[2XAndrasfaiGraph[102X( [[3Xfilt[103X, ][3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xn[103X  is  an  integer  greater  than 0, then this operation returns the [3Xn[103Xth
  [13XAndrasfai  graph[113X.  The  Andrasfai  graph  is  a  circulant graph with [10X3[3Xn[103X[10X - 1[110X
  vertices.  The  indices  of  the  Andrasfai  graph  are given by the numbers
  between  [10X1[110X and [10X3[3Xn[103X[10X - 1[110X that are congruent to [10X1[110X mod [10X3[110X (that is, for each index
  [22Xj[122X,  vertex  [22Xi[122X  is adjacent to the [22Xi + j[122Xth and [22Xi - j[122X vertices). The graph has
  [10X6(3[3Xn[103X[10X - 1)[110X edges. The graph is triangle free.[133X
  
  [33X[0;0YAs   a   circulant  graph,  the  Andrasfai  graph  is  biconnected,  cyclic,
  Hamiltonian, regular, and vertex transitive.[133X
  
  [33X[0;0YSee [7Xhttps://mathworld.wolfram.com/AndrasfaiGraph.html[107X for further details.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := AndrasfaiGraph(4);[127X[104X
    [4X[28X<immutable Hamiltonian biconnected vertex-transitive symmetric digraph\[128X[104X
    [4X[28X with 11 vertices, 44 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsBiconnectedDigraph(D);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsIsomorphicDigraph(D, CirculantGraph(11, [1, 4, 7, 10]));[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.5-2 BananaTree[101X
  
  [33X[1;0Y[29X[2XBananaTree[102X( [[3Xfilt[103X, ][3Xn[103X, [3Xk[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph[133X
  
  [33X[0;0YIf  [3Xn[103X and [3Xk[103X are positive integers with [3Xk[103X greater than [22X1[122X, then this operation
  returns the [13Xbanana tree[113X with parameters [3Xn[103X and [3Xk[103X, as defined below.[133X
  
  [33X[0;0YFrom [7Xhttps://mathworld.wolfram.com/BananaTree.html[107X:[133X
  
  [33X[0;0Y[21XAn  [10X([3Xn[103X[10X,[3Xk[103X[10X)[110X-banana tree, as defined by Chen et al. (1997), is a graph obtained
  by  connecting one leaf of each of [3Xn[103X copies of an [3Xk[103X-star graph with a single
  root vertex that is distinct from all the stars.[121X[133X
  
  [33X[0;0YSpecifically, in the resulting digraph, vertex [10X1[110X is the 'root', and for each
  [10Xm[110X in [10X[1 .. [3Xk[103X[10X][110X, the [10Xm[110Xth star is on the vertices [10X[((m - 1) * n) + 2 .. (m * n)
  + 1][110X, with the first of these being the 'centre' of the star, and the second
  being the 'leaf' adjacent [10X1[110X.[133X
  
  [33X[0;0YSee also [2XStarGraph[102X ([14X3.5-43[114X) and [2XIsUndirectedTree[102X ([14X6.3-9[114X).[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := BananaTree(2, 4);[127X[104X
    [4X[28X<immutable undirected tree digraph with 9 vertices>[128X[104X
    [4X[25Xgap>[125X [27XD := BananaTree(3, 3);[127X[104X
    [4X[28X<immutable undirected tree digraph with 10 vertices>[128X[104X
    [4X[25Xgap>[125X [27XD := BananaTree(5, 2);[127X[104X
    [4X[28X<immutable undirected tree digraph with 11 vertices>[128X[104X
    [4X[25Xgap>[125X [27XD := BananaTree(3, 4);[127X[104X
    [4X[28X<immutable undirected tree digraph with 13 vertices>[128X[104X
  [4X[32X[104X
  
  [1X3.5-3 BinaryTree[101X
  
  [33X[1;0Y[29X[2XBinaryTree[102X( [[3Xfilt[103X, ][3Xm[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YThis  function returns a binary tree of depth [3Xm[103X with [10X2 ^ [3Xm[103X[10X - 1[110X vertices. All
  edges are directed towards the root of the tree, which is vertex [10X1[110X.[133X
  
  [33X[0;0YNote  that [10XBinaryTree([3Xm[103X[10X)[110X is the induced subdigraph of [10XBinaryTree([3Xm[103X[10X+1)[110X on the
  vertices [10X[1..2^([3Xm[103X[10X-1)][110X.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XBinaryTree(1);[127X[104X
    [4X[28X<immutable empty digraph with 1 vertex>[128X[104X
    [4X[25Xgap>[125X [27XBinaryTree(8);[127X[104X
    [4X[28X<immutable digraph with 255 vertices, 254 edges>[128X[104X
    [4X[25Xgap>[125X [27XBinaryTree(IsMutableDigraph, 8);[127X[104X
    [4X[28X<mutable digraph with 255 vertices, 254 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.5-4 BinomialTreeGraph[101X
  
  [33X[1;0Y[29X[2XBinomialTreeGraph[102X( [[3Xfilt[103X, ][3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf [3Xn[103X is a positive integer then this operation returns the [3Xn[103Xth [13Xbinomial tree
  graph[113X.  The binomial tree graph has [3Xn[103X vertices and [10X[3Xn[103X[10X-1[110X undirected edges. The
  vertices  of  the  binomial tree graph are the numbers from 1 to [3Xn[103X in binary
  representation,  with  a  vertex [10Xv[110X having as a direct parent the vertex with
  binary  representation  the same as [10Xv[110X but with the lowest 1-bit cleared. For
  example, the vertex [22X011[122X has parent [22X010[122X, and the vertex [22X010[122X has parent [22X000[122X.[133X
  
  [33X[0;0YThe  binomial  tree  graph  is  an  undirected  tree,  and is symmetric as a
  digraph.[133X
  
  [33X[0;0YSee [7Xhttps://metacpan.org/pod/Graph::Maker::BinomialTree[107X for further details.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := BinomialTreeGraph(9);[127X[104X
    [4X[28X<immutable undirected tree digraph with 9 vertices>[128X[104X
  [4X[32X[104X
  
  [1X3.5-5 BishopsGraph[101X
  
  [33X[1;0Y[29X[2XBishopsGraph[102X( [[3Xfilt[103X, ][[3Xcolor[103X, ][3Xm[103X, [3Xn[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XBishopGraph[102X( [[3Xfilt[103X, ][[3Xcolor[103X, ][3Xm[103X, [3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xm[103X  and [3Xn[103X are positive integers, then this operation returns the [13Xbishop's
  graph[113X of an [3Xm[103X by [3Xn[103X chessboard, as a symmetric digraph.[133X
  
  [33X[0;0YA  bishop's  graph  represents  all possible moves of the bishop chess piece
  across  a  chessboard. An [3Xm[103X by [3Xn[103X chessboard is a grid of [3Xm[103X columns (‘files’)
  and  [3Xn[103X  rows  (‘ranks’)  that  intersect  in  squares. Orthogonally adjacent
  squares are alternately colored light and dark, with the square in the first
  rank and file being dark.[133X
  
  [33X[0;0YThe  [10X[3Xm[103X[10X  *  [3Xn[103X[10X[110X  vertices  of  the  bishop's graph can be placed onto the [10X[3Xm[103X[10X * [3Xn[103X[10X[110X
  squares  of an [3Xm[103X by [3Xn[103X chessboard, such that two vertices are adjacent in the
  digraph  if  and only if a bishop can move between the corresponding squares
  in  a  single turn. A legal bishop's move is defined as any move which moves
  the bishop piece to a diagonally adjacent square or to a square which can be
  reached  through  a series of diagonally adjacent squares, with all of these
  small moves being in the same direction.[133X
  
  [33X[0;0YThe  chosen  correspondence  between  vertices and chess squares is given by
  [2XDigraphVertexLabels[102X  ([14X5.1-10[114X).  In  more detail, the vertices of the digraph
  are labelled by elements of the Cartesian product [10X[1..[3Xm[103X[10X] x [1..[3Xn[103X[10X][110X, where the
  first  entry  indexes the column (file) of the square in the chessboard, and
  the  second entry indexes the row (rank) of the square. (Note that the files
  are  traditionally  indexed  by  the lowercase letters of the alphabet). The
  vertices  are sorted in ascending order, first by row (second component) and
  then column (first component).[133X
  
  [33X[0;0YIf the optional second argument [3Xcolor[103X is present, then this should be one of
  the strings [10X"dark"[110X, [10X"light"[110X, or [10X"both"[110X. The default is [10X"both"[110X. A bishop on a
  light  square  can only move to light squares, and a bishop on a dark square
  can only move to dark squares. This optional argument controls which bishops
  are  represented  in  the  resulting  digraph.  If [3Xcolor[103X is [10X"both"[110X, then the
  resulting  digraph  will  show all the vertices of an [3Xm[103X by [3Xn[103X chessboard, and
  will be disconnected (unless [10X[3Xm[103X[10X = [3Xn[103X[10X = 1[110X). Otherwise, [2XBishopsGraph[102X returns the
  induced  subdigraph  of  this  on the vertices that correspond to either the
  dark squares or the light squares, according to the value of [3Xcolor[103X.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XBishopsGraph(8, 8);[127X[104X
    [4X[28X<immutable symmetric digraph with 64 vertices, 560 edges>[128X[104X
    [4X[25Xgap>[125X [27XD := BishopsGraph("dark", 3, 5);[127X[104X
    [4X[28X<immutable connected symmetric digraph with 8 vertices, 24 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsConnectedDigraph(D);       [127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XBishopsGraph("light", 4, 4);[127X[104X
    [4X[28X<immutable connected symmetric digraph with 8 vertices, 28 edges>[128X[104X
    [4X[25Xgap>[125X [27XD := BishopsGraph("both", 1, 5);[127X[104X
    [4X[28X<immutable empty digraph with 5 vertices>[128X[104X
  [4X[32X[104X
  
  [1X3.5-6 BondyGraph[101X
  
  [33X[1;0Y[29X[2XBondyGraph[102X( [[3Xfilt[103X, ][3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xn[103X  is  a  non-negative integer then this operation returns the [3Xn[103Xth [13XBondy
  graph[113X.  The  Bondy  graphs  are  a family of hypohamiltonian graphs: a graph
  which  is  not  Hamiltonian  itself but the removal of any vertex produces a
  Hamiltonian  graph.  The  Bondy  graphs  are  the  [10X(3(2[3Xn[103X[10X  +  1)  +  2, 2)[110X-th
  Generalised  Petersen  graphs,  and  have  [10X12[3Xn[103X[10X  +  10[110X  vertices and [10X15 + 18[3Xn[103X[10X[110X
  undirected edges.[133X
  
  [33X[0;0YSee   [7Xhttps://mathworld.wolfram.com/HypohamiltonianGraph.html[107X   for  further
  details.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := BondyGraph(1);[127X[104X
    [4X[28X<immutable symmetric digraph with 22 vertices, 66 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsHamiltonianDigraph(D);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XG := List([1 .. 22], x -> DigraphRemoveVertex(D, x));;[127X[104X
    [4X[25Xgap>[125X [27XForAll(G, x -> IsHamiltonianDigraph(x));[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.5-7 BookGraph[101X
  
  [33X[1;0Y[29X[2XBookGraph[102X( [[3Xfilt[103X, ][3Xm[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YThe  [13Xbook  graph[113X  is  the  Cartesian  product of a complete digraph with two
  vertices  (as the "book spine") and the [22X[3Xm[103X+1[122X star graph (as the "pages"). For
  more     details     on     the     book     graph     please    refer    to
  [7Xhttps://mathworld.wolfram.com/BookGraph.html[107X.[133X
  
  [33X[0;0YSee   [2XDigraphCartesianProduct[102X   ([14X3.3-31[114X),   [2XCompleteDigraph[102X   ([14X3.5-11[114X),  and
  [2XStarGraph[102X ([14X3.5-43[114X).[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XBookGraph(1);[127X[104X
    [4X[28X<immutable bipartite symmetric digraph with bicomponent sizes 2 and 2>[128X[104X
    [4X[25Xgap>[125X [27XBookGraph(2);[127X[104X
    [4X[28X<immutable bipartite symmetric digraph with bicomponent sizes 3 and 3>[128X[104X
    [4X[25Xgap>[125X [27XBookGraph(IsMutable, 12);[127X[104X
    [4X[28X<mutable digraph with 26 vertices, 74 edges>[128X[104X
    [4X[25Xgap>[125X [27XBookGraph(7);[127X[104X
    [4X[28X<immutable bipartite symmetric digraph with bicomponent sizes 8 and 8>[128X[104X
    [4X[25Xgap>[125X [27XIsSymmetricDigraph(BookGraph(24));[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsBipartiteDigraph(BookGraph(24));[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.5-8 StackedBookGraph[101X
  
  [33X[1;0Y[29X[2XStackedBookGraph[102X( [[3Xfilt[103X, ][3Xm[103X, [3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YThe  [13Xstacked book graph[113X is the Cartesian product of the symmetric closure of
  the  chain  digraph  with  [3Xn[103X vertices (as the "book spine") and the [22X[3Xm[103X+1[122X star
  graph  (as  the  "pages"). For more details on the stacked book graph please
  refer to [7Xhttps://mathworld.wolfram.com/StackedBookGraph.html[107X.[133X
  
  [33X[0;0YSee   [2XDigraphCartesianProduct[102X  ([14X3.3-31[114X),  [2XDigraphSymmetricClosure[102X  ([14X3.3-12[114X),
  [2XChainDigraph[102X ([14X3.5-9[114X), and [2XStarGraph[102X ([14X3.5-43[114X).[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XStackedBookGraph(1, 1);[127X[104X
    [4X[28X<immutable bipartite symmetric digraph with bicomponent sizes 1 and 1>[128X[104X
    [4X[25Xgap>[125X [27XStackedBookGraph(1, 2);[127X[104X
    [4X[28X<immutable bipartite symmetric digraph with bicomponent sizes 2 and 2>[128X[104X
    [4X[25Xgap>[125X [27XStackedBookGraph(3, 4);[127X[104X
    [4X[28X<immutable bipartite symmetric digraph with bicomponent sizes 8 and 8>[128X[104X
    [4X[25Xgap>[125X [27XStackedBookGraph(IsMutable, 12, 5);[127X[104X
    [4X[28X<mutable digraph with 65 vertices, 224 edges>[128X[104X
    [4X[25Xgap>[125X [27XStackedBookGraph(5, 5);[127X[104X
    [4X[28X<immutable bipartite symmetric digraph with bicomponent sizes 13 and 1\[128X[104X
    [4X[28X7>[128X[104X
    [4X[25Xgap>[125X [27XIsSymmetricDigraph(StackedBookGraph(24, 8));[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsBipartiteDigraph(StackedBookGraph(24, 8));[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.5-9 ChainDigraph[101X
  
  [33X[1;0Y[29X[2XChainDigraph[102X( [[3Xfilt[103X, ][3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xn[103X  is  a positive integer, this function returns a chain with [3Xn[103X vertices
  and  [10X[3Xn[103X[10X  -  1[110X edges. Specifically, for each vertex [10Xi[110X (with [10Xi[110X < [10Xn[110X), there is a
  directed edge with source [10Xi[110X and range [10Xi + 1[110X.[133X
  
  [33X[0;0YThe [2XDigraphReflexiveTransitiveClosure[102X ([14X3.3-13[114X) of a chain represents a total
  order.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XChainDigraph(42);[127X[104X
    [4X[28X<immutable chain digraph with 42 vertices>[128X[104X
    [4X[25Xgap>[125X [27XChainDigraph(IsMutableDigraph, 10);[127X[104X
    [4X[28X<mutable digraph with 10 vertices, 9 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.5-10 CirculantGraph[101X
  
  [33X[1;0Y[29X[2XCirculantGraph[102X( [[3Xfilt[103X, ][3Xn[103X, [3Xpar[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xn[103X  is  an integer greater than 1, and [3Xpar[103X is a list of integers that are
  contained  in  [10X[1..[3Xn[103X[10X][110X  then  this  operation  returns a [13Xcirculant graph[113X. The
  circulant  graph  is a graph on [3Xn[103X vertices, where for each element [22Xj[122X of [3Xpar[103X,
  the [22Xi[122Xth vertex is adjacent to the [22X(i + j)[122Xth and [22X(i - j)[122Xth vertices.[133X
  
  [33X[0;0YIf  [3Xpar[103X  is  [22X[1][122X,  then  the  graph  is  the  [3Xn[103Xth  cyclic  graph.  If [3Xpar[103X is
  [10X[1,2,...,Int([3Xn[103X[10X/2)][110X, then the graph is the complete graph on [3Xn[103X vertices. If [3Xn[103X
  is  at  least  4  and  [3Xpar[103X  is [10X[1,[3Xn[103X[10X][110X then the graph is the [3Xn[103Xth Mobius ladder
  graph.[133X
  
  [33X[0;0YA  circulant  graph is biconnected, cyclic, Hamiltonian, regular, and vertex
  transitive.[133X
  
  [33X[0;0YSee [7Xhttps://mathworld.wolfram.com/CirculantGraph.html[107X for further details.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := CirculantGraph(6, [1, 2, 3]);[127X[104X
    [4X[28X<immutable Hamiltonian biconnected vertex-transitive symmetric digraph\[128X[104X
    [4X[28X with 6 vertices, 30 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsIsomorphicDigraph(D, CompleteDigraph(6));[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.5-11 CompleteDigraph[101X
  
  [33X[1;0Y[29X[2XCompleteDigraph[102X( [[3Xfilt[103X, ][3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xn[103X  is a non-negative integer, this function returns the complete digraph
  with [3Xn[103X vertices. See [2XIsCompleteDigraph[102X ([14X6.1-5[114X).[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XCompleteDigraph(20);[127X[104X
    [4X[28X<immutable complete digraph with 20 vertices>[128X[104X
    [4X[25Xgap>[125X [27XCompleteDigraph(IsMutableDigraph, 10);[127X[104X
    [4X[28X<mutable digraph with 10 vertices, 90 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.5-12 CompleteBipartiteDigraph[101X
  
  [33X[1;0Y[29X[2XCompleteBipartiteDigraph[102X( [[3Xfilt[103X, ][3Xm[103X, [3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YA  complete bipartite digraph is a digraph whose vertices can be partitioned
  into  two non-empty vertex sets, such there exists a unique edge with source
  [10Xi[110X and range [10Xj[110X if and only if [10Xi[110X and [10Xj[110X lie in different vertex sets.[133X
  
  [33X[0;0YIf  [3Xm[103X  and  [3Xn[103X  are  positive  integers,  this  function returns the complete
  bipartite digraph with vertex sets of sizes [3Xm[103X (containing the vertices [10X[1 ..
  m][110X) and [3Xn[103X (containing the vertices [10X[m + 1 .. m + n][110X).[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XCompleteBipartiteDigraph(2, 3);[127X[104X
    [4X[28X<immutable complete bipartite digraph with bicomponent sizes 2 and 3>[128X[104X
    [4X[25Xgap>[125X [27XCompleteBipartiteDigraph(IsMutableDigraph, 3, 2);[127X[104X
    [4X[28X<mutable digraph with 5 vertices, 12 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.5-13 CompleteMultipartiteDigraph[101X
  
  [33X[1;0Y[29X[2XCompleteMultipartiteDigraph[102X( [[3Xfilt[103X, ][3Xorders[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YFor  a list [3Xorders[103X of [10Xn[110X positive integers, this function returns the digraph
  containing  [10Xn[110X  independent  sets  of  vertices  of  orders  [10X[[3Xl[103X[10X[1]  .. [3Xl[103X[10X[n]][110X.
  Moreover,  each  vertex is adjacent to every other not contained in the same
  independent set.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XCompleteMultipartiteDigraph([5, 4, 2]);[127X[104X
    [4X[28X<immutable complete multipartite digraph with 11 vertices, 76 edges>[128X[104X
    [4X[25Xgap>[125X [27XCompleteMultipartiteDigraph(IsMutableDigraph, [5, 4, 2]);[127X[104X
    [4X[28X<mutable digraph with 11 vertices, 76 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.5-14 CycleDigraph[101X
  
  [33X[1;0Y[29X[2XCycleDigraph[102X( [[3Xfilt[103X, ][3Xn[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XDigraphCycle[102X( [[3Xfilt[103X, ][3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf [3Xn[103X is a positive integer, then these functions return a [13Xcycle digraph[113X with
  [3Xn[103X  vertices and [3Xn[103X edges. Specifically, for each vertex [10Xi[110X (with [10Xi[110X < [10Xn[110X), there
  is  a  directed edge with source [10Xi[110X and range [10Xi + 1[110X. In addition, there is an
  edge with source [10Xn[110X and range [10X1[110X.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XCycleDigraph(1);[127X[104X
    [4X[28X<immutable digraph with 1 vertex, 1 edge>[128X[104X
    [4X[25Xgap>[125X [27XCycleDigraph(123);[127X[104X
    [4X[28X<immutable cycle digraph with 123 vertices>[128X[104X
    [4X[25Xgap>[125X [27XCycleDigraph(IsMutableDigraph, 10);[127X[104X
    [4X[28X<mutable digraph with 10 vertices, 10 edges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphCycle(4) = CycleDigraph(4);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.5-15 CycleGraph[101X
  
  [33X[1;0Y[29X[2XCycleGraph[102X( [[3Xfilt[103X, ][3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xn[103X is an integer greater than 2 then this operation returns the [3Xn[103Xth [13Xcycle
  graph[113X,  consisting  of  the cycle on [3Xn[103X vertices. The cycle graph, unlike the
  cycle digraph, is symmetric. The cycle graph has [3Xn[103X vertices and [3Xn[103X undirected
  edges.  The  cycle  graph  is  simple so the non-simple graphs with a single
  vertex  and single loop and with two vertices and two edges between them are
  excluded.[133X
  
  [33X[0;0YSee [7Xhttps://mathworld.wolfram.com/CycleGraph.html[107X for further details.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := CycleGraph(7);[127X[104X
    [4X[28X<immutable symmetric digraph with 7 vertices, 14 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.5-16 EmptyDigraph[101X
  
  [33X[1;0Y[29X[2XEmptyDigraph[102X( [[3Xfilt[103X, ][3Xn[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XNullDigraph[102X( [[3Xfilt[103X, ][3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xn[103X  is  a  non-negative  integer, this function returns the [13Xempty[113X or [13Xnull[113X
  digraph with [3Xn[103X vertices. An empty digraph is one with no edges.[133X
  
  [33X[0;0Y[10XNullDigraph[110X is a synonym for [10XEmptyDigraph[110X.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XEmptyDigraph(20);[127X[104X
    [4X[28X<immutable empty digraph with 20 vertices>[128X[104X
    [4X[25Xgap>[125X [27XNullDigraph(10);[127X[104X
    [4X[28X<immutable empty digraph with 10 vertices>[128X[104X
    [4X[25Xgap>[125X [27XEmptyDigraph(IsMutableDigraph, 10);[127X[104X
    [4X[28X<mutable empty digraph with 10 vertices>[128X[104X
  [4X[32X[104X
  
  [1X3.5-17 GearGraph[101X
  
  [33X[1;0Y[29X[2XGearGraph[102X( [[3Xfilt[103X, ][3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xn[103X is a positive integer at least 3, then this operation returns the [13Xgear
  graph[113X  with  [10X2[3Xn[103X[10X  + 1[110X vertices and [10X3[3Xn[103X[10X[110X undirected edges. The [3Xn[103Xth gear graph is
  the [10X2[3X[103X[10X[110Xth cycle graph with one additional central vertex, to which every other
  vertex  of  the cycle is connected. The gear graph is a symmetric digraph. A
  gear  graph  is a Matchstick graph, that is it is simple with a planar graph
  embedding,  and  is  a unit-distance graph (that is, it can be embedded into
  the  Euclidean  plane  with  vertices being distinct points and edges having
  length 1).[133X
  
  [33X[0;0YSee [7Xhttps://mathworld.wolfram.com/GearGraph.html[107X for further details.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := GearGraph(4);[127X[104X
    [4X[28X<immutable symmetric digraph with 9 vertices, 24 edges>[128X[104X
    [4X[25Xgap>[125X [27XChromaticNumber(D);[127X[104X
    [4X[28X2[128X[104X
    [4X[25Xgap>[125X [27XIsVertexTransitive(D);[127X[104X
    [4X[28Xfalse[128X[104X
  [4X[32X[104X
  
  [1X3.5-18 HaarGraph[101X
  
  [33X[1;0Y[29X[2XHaarGraph[102X( [[3Xfilt[103X, ][3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf [3Xn[103X is a positive integer then this operation returns the [13XHaar graph[113X [22XH([3Xn[103X)[122X.[133X
  
  [33X[0;0YThe  number  of vertices in the Haar graph [22XH([3Xn[103X)[122X is equal to twice [22Xm[122X, where [22Xm[122X
  is  the  number  of digits required to represent [3Xn[103X in binary. These vertices
  are  arranged  into  bicomponents [10X[1..m][110X and [10X[m+1..2*m][110X. Vertices [22Xi[122X and [22Xj[122X in
  different bicomponents are adjacent by a symmetric pair of edges if and only
  if  the  binary  representation  of [3Xn[103X has a 1 in position ([22Xj-i[122X modulo [22Xm[122X) + 1
  from the left.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XHaarGraph(3);[127X[104X
    [4X[28X<immutable bipartite vertex-transitive symmetric digraph with bicompon\[128X[104X
    [4X[28Xent sizes 2 and 2>[128X[104X
    [4X[25Xgap>[125X [27XD := HaarGraph(16);[127X[104X
    [4X[28X<immutable bipartite vertex-transitive symmetric digraph with bicompon\[128X[104X
    [4X[28Xent sizes 5 and 5>[128X[104X
  [4X[32X[104X
  
  [1X3.5-19 HalvedCubeGraph[101X
  
  [33X[1;0Y[29X[2XHalvedCubeGraph[102X( [[3Xfilt[103X, ][3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xn[103X  is a positive integer at least 1, then this operation returns the [3Xn[103Xth
  [13Xhalved  cube  graph[113X,  the graph of the [3Xn[103X- demihypercube. The vertices of the
  graph  are  those  of  the [3Xn[103Xth- hypercube, with two vertices adjacent if and
  only   if  they  are  at  distance  1  or  2  from  each  other.  Equivalent
  constructions are as the second graph power of the [10X[3Xn[103X[10X-1[110Xth hypercube graph, or
  as  with  vertices  labelled  as  the  binary numbers where two vertices are
  adjacent  if they differ in a single bit, or with vertices labelled with the
  subset  of  binary  numbers  with even Hamming weight, with edges connecting
  vertices  with Hamming distance exactly 2. The Halved Cube graph is distance
  regular and contains a Hamiltonian cycle.[133X
  
  [33X[0;0YSee [7Xhttps://mathworld.wolfram.com/HalvedCubeGraph.html[107X for further details.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := HalvedCubeGraph(3);[127X[104X
    [4X[28X<immutable Hamiltonian connected symmetric digraph with 4 vertices, 12\[128X[104X
    [4X[28X edges>[128X[104X
    [4X[25Xgap>[125X [27XIsDistanceRegularDigraph(D);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsHamiltonianDigraph(D);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.5-20 HanoiGraph[101X
  
  [33X[1;0Y[29X[2XHanoiGraph[102X( [[3Xfilt[103X, ][3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xn[103X  is  positive integer then this operation returns the [3Xn[103Xth [13XHanoi graph[113X.
  The  Hanoi  graph's  vertices represent the possible states of the 'Tower of
  Hanoi'  puzzle  on three 'towers', while its edges represent possible moves.
  The  Hanoi  graph  has  [10X3^[3Xn[103X[10X[110X  vertices,  and  [10XBinomial(3,  3) * (3^[3Xn[103X[10X - 1) / 2[110X
  undirected edges.[133X
  
  [33X[0;0YThe  Hanoi  graph  is  Hamiltonian.  The  graph  superficially resembles the
  Sierpinski  triangle.  The  graph  is  also  a 'penny graph' - a graph whose
  vertices  can  be  considered  to  be non-overlapping unit circles on a flat
  surface,  with  two  vertices  adjacent  only if the unit circles touch at a
  single point. Thus the Hanoi graph is planar.[133X
  
  [33X[0;0YSee [7Xhttps://mathworld.wolfram.com/HanoiGraph.html[107X for further details.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := HanoiGraph(5);[127X[104X
    [4X[28X<immutable Hamiltonian connected symmetric digraph with 243 vertices, \[128X[104X
    [4X[28X726 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsPlanarDigraph(D);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.5-21 HelmGraph[101X
  
  [33X[1;0Y[29X[2XHelmGraph[102X( [[3Xfilt[103X, ][3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xn[103X  is a positive integer at least 3, then this operation returns the [3Xn[103Xth
  [13Xhelm  graph[113X. The helm graph is the [3Xn[103X-1th wheel graph with, for each external
  vertex  of  the  'wheel',  adjoining a new vertex incident only to the first
  vertex. That is, the graph looks similar to a ship's helm.[133X
  
  [33X[0;0YSee [7Xhttps://mathworld.wolfram.com/WheelGraph.html[107X for further details.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := HelmGraph(4);[127X[104X
    [4X[28X<immutable symmetric digraph with 9 vertices, 24 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.5-22 HypercubeGraph[101X
  
  [33X[1;0Y[29X[2XHypercubeGraph[102X( [[3Xfilt[103X, ][3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xn[103X  is  a  non-negative  integer,  then  this  operation  returns the [3Xn[103Xth
  [13Xhypercube graph[113X. The graph has [10X2^[3Xn[103X[10X[110X vertices and [10X2^([3Xn[103X[10X-1)[3Xn[103X[10X[110X edges. It is formed
  from  the  vertices and edges of the [3Xn[103X-dimensional hypercube. Alternatively,
  the  graph  can  be  constructed  by  labelling  each vertex with the binary
  numbers,  with  two  vertices adjacent if they have Hamming distance exactly
  one. The hypercube graphs are Hamiltonian, distance-transitive and therefore
  distance-regular, and bipartite.[133X
  
  [33X[0;0YSee [7Xhttps://mathworld.wolfram.com/HypercubeGraph.html[107X for further details.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := HypercubeGraph(5);[127X[104X
    [4X[28X<immutable Hamiltonian connected bipartite symmetric digraph with bico\[128X[104X
    [4X[28Xmponent sizes 16 and 16>[128X[104X
  [4X[32X[104X
  
  [1X3.5-23 JohnsonDigraph[101X
  
  [33X[1;0Y[29X[2XJohnsonDigraph[102X( [[3Xfilt[103X, ][3Xn[103X, [3Xk[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xn[103X  and  [3Xk[103X  are  non-negative  integers,  then  this  operation returns a
  symmetric digraph which corresponds to the undirected [13XJohnson graph[113X [22XJ(n, k)[122X.[133X
  
  [33X[0;0YThe  [13XJohnson  graph[113X  [22XJ(n,  k)[122X has vertices given by all the [3Xk[103X-subsets of the
  range  [10X[1  ..  [3Xn[103X[10X][110X,  and two vertices are connected by an edge if and only if
  their intersection has size [22X[3Xk[103X - 1[122X.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27Xgr := JohnsonDigraph(3, 1);[127X[104X
    [4X[28X<immutable symmetric digraph with 3 vertices, 6 edges>[128X[104X
    [4X[25Xgap>[125X [27XOutNeighbours(gr);[127X[104X
    [4X[28X[ [ 2, 3 ], [ 1, 3 ], [ 1, 2 ] ][128X[104X
    [4X[25Xgap>[125X [27Xgr := JohnsonDigraph(4, 2);[127X[104X
    [4X[28X<immutable symmetric digraph with 6 vertices, 24 edges>[128X[104X
    [4X[25Xgap>[125X [27XOutNeighbours(gr);[127X[104X
    [4X[28X[ [ 2, 3, 4, 5 ], [ 1, 3, 4, 6 ], [ 1, 2, 5, 6 ], [ 1, 2, 5, 6 ], [128X[104X
    [4X[28X  [ 1, 3, 4, 6 ], [ 2, 3, 4, 5 ] ][128X[104X
    [4X[25Xgap>[125X [27XJohnsonDigraph(1, 0);[127X[104X
    [4X[28X<immutable empty digraph with 1 vertex>[128X[104X
    [4X[25Xgap>[125X [27XJohnsonDigraph(IsMutableDigraph, 1, 0);[127X[104X
    [4X[28X<mutable empty digraph with 1 vertex>[128X[104X
  [4X[32X[104X
  
  [1X3.5-24 KellerGraph[101X
  
  [33X[1;0Y[29X[2XKellerGraph[102X( [[3Xfilt[103X, ][3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xn[103X  is  a  nonnegative  integer  then  this  operation returns the [3Xn[103Xth or
  [3Xn[103X-dimensional  [13XKeller graph[113X. The graph has vertices given by the [3Xn[103X-tuples on
  the  set  [22X[0, 1, 2, 3][122X. Two vertices are adjacent if their respective tuples
  are  such  that  they differ in at least two coordinates and in at least one
  coordinate  the  difference between the two is [10X2[110X mod [10X4[110X. The Keller graph has
  [10X4^[3Xn[103X[10X[110X vertices.[133X
  
  [33X[0;0YThe   Keller   graphs   were  constructed  with  the  intention  of  finding
  counterexamples              to              Keller's             conjecture
  ([7Xhttps://mathworld.wolfram.com/KellersConjecture.html[107X),  and  has  been used
  since for testing maximum clique algorithms.[133X
  
  [33X[0;0YIf [3Xn[103X is 1 then the graph is empty, for [3Xn[103X greater than 1 the chromatic number
  of the Keller graph is [10X2^[3Xn[103X[10X[110X and the graph is Hamiltonian.[133X
  
  [33X[0;0YSee [7Xhttps://mathworld.wolfram.com/KellerGraph.html[107X for further details.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := KellerGraph(3);[127X[104X
    [4X[28X<immutable Hamiltonian connected symmetric digraph with 64 vertices, 2\[128X[104X
    [4X[28X176 edges>[128X[104X
    [4X[25Xgap>[125X [27XChromaticNumber(D);[127X[104X
    [4X[28X8[128X[104X
  [4X[32X[104X
  
  [1X3.5-25 KingsGraph[101X
  
  [33X[1;0Y[29X[2XKingsGraph[102X( [[3Xfilt[103X, ][3Xm[103X, [3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xm[103X  and  [3Xn[103X  are positive integers, then this operation returns the [13Xking's
  graph[113X of an [3Xm[103X by [3Xn[103X chessboard, as a symmetric digraph.[133X
  
  [33X[0;0YThe  king's  graph  represents  all  possible  moves of the king chess piece
  across  a  chessboard. An [3Xm[103X by [3Xn[103X chessboard is a grid of [3Xm[103X columns (‘files’)
  and  [3Xn[103X  rows  (‘ranks’)  that  intersect  in  squares. Orthogonally adjacent
  squares are alternately colored light and dark, with the square in the first
  rank and file being dark.[133X
  
  [33X[0;0YThe  king  can  move only to any orthogonally or diagonally adjacent square.
  Thus  the  [10X[3Xm[103X[10X  *  [3Xn[103X[10X[110X vertices of the king's graph can be placed onto the [10X[3Xm[103X[10X * [3Xn[103X[10X[110X
  squares  of an [3Xm[103X by [3Xn[103X chessboard, such that two vertices are adjacent in the
  digraph  if  and  only  if  the  corresponding  squares  are orthogonally or
  diagonally adjacent on the chessboard.[133X
  
  [33X[0;0YThe  chosen  correspondence  between  vertices and chess squares is given by
  [2XDigraphVertexLabels[102X  ([14X5.1-10[114X).  In  more detail, the vertices of the digraph
  are labelled by elements of the Cartesian product [10X[1..[3Xm[103X[10X] x [1..[3Xn[103X[10X][110X, where the
  first  entry  indexes the column (file) of the square in the chessboard, and
  the  second entry indexes the row (rank) of the square. (Note that the files
  are  traditionally  indexed  by  the lowercase letters of the alphabet). The
  vertices  are sorted in ascending order, first by row (second component) and
  then column (first component).[133X
  
  [33X[0;0YSee   Wikipedia   ([7Xhttps://en.wikipedia.org/wiki/King's_graph[107X)  for  further
  information.   See   also   [2XSquareGridGraph[102X   ([14X3.5-41[114X),  [2XTriangularGridGraph[102X
  ([14X3.5-42[114X), and [2XStrongProduct[102X ([14X3.3-37[114X).[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XKingsGraph(8, 8);[127X[104X
    [4X[28X<immutable connected symmetric digraph with 64 vertices, 420 edges>[128X[104X
    [4X[25Xgap>[125X [27XD := KingsGraph(IsMutable, 2, 7);[127X[104X
    [4X[28X<mutable digraph with 14 vertices, 62 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsPlanarDigraph(D);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XD := KingsGraph(3, 3);[127X[104X
    [4X[28X<immutable connected symmetric digraph with 9 vertices, 40 edges>[128X[104X
    [4X[25Xgap>[125X [27XOutNeighbors(D);[127X[104X
    [4X[28X[ [ 2, 4, 5 ], [ 1, 3, 5, 4, 6 ], [ 2, 6, 5 ], [ 5, 1, 7, 2, 8 ], [128X[104X
    [4X[28X  [ 4, 6, 2, 8, 3, 7, 1, 9 ], [ 5, 3, 9, 8, 2 ], [ 8, 4, 5 ], [128X[104X
    [4X[28X  [ 7, 9, 5, 6, 4 ], [ 8, 6, 5 ] ][128X[104X
    [4X[25Xgap>[125X [27XIsSubdigraph(QueensGraph(3, 4), KingsGraph(3, 4));[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.5-26 KneserGraph[101X
  
  [33X[1;0Y[29X[2XKneserGraph[102X( [[3Xfilt[103X, ][3Xn[103X, [3Xk[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xn[103X  and  [3Xk[103X  are  integers  greater  than 0, with [3Xk[103X less than [3Xn[103X, then this
  operation  returns  the  [10X([3Xn[103X[10X,[3Xk[103X[10X)[110X-th  [13XKneser graph[113X. The Kneser graph's vertices
  correspond  to  the  [3Xk[103X-  element  subsets  of  a set of [3Xn[103X elements, with two
  vertices  being  adjacent if and only if the subsets are disjoint. The graph
  has  [10XBinomial([3Xn[103X[10X,  [3Xk[103X[10X)[110X vertices and [10XBinomial([3Xn[103X[10X, [3Xk[103X[10X) * Binomial([3Xn[103X[10X - [3Xk[103X[10X, [3Xk[103X[10X)[110X edges.
  Kneser  graphs  are regular, edge transitive, and vertex transitive. If [3Xk[103X is
  1,  then  the graph is the complete graph on [3Xn[103X vertices. If [10X([3Xn[103X[10X, [3Xk[103X[10X)[110X is [10X(2m-1,
  [3Xn[103X[10X-1)[110X,  then  the  graph  is the [10Xm[110Xth Odd graph. The Petersen graph is the [22X(5,
  2)[122Xth Kneser graph.[133X
  
  [33X[0;0YIf [10X[3Xn[103X[10X >= 2[3Xk[103X[10X[110X then the graph's chromatic number is [10X[3Xn[103X[10X - 2[3Xk[103X[10X + 2[110X, and otherwise is
  1.  The  Kneser  graph contains a Hamiltonian cycle if [10X[3Xn[103X[10X >= ((3 + 5 ^ 0.5) /
  2)[3Xk[103X[10X + 1[110X. The graph has clique number equal to the floor of [10X[3Xn[103X[10X / [3Xk[103X[10X[110X.[133X
  
  [33X[0;0YSee [7Xhttps://mathworld.wolfram.com/KneserGraph.html[107X for further details.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := KneserGraph(7, 3);[127X[104X
    [4X[28X<immutable edge- and vertex-transitive symmetric digraph with 35 verti\[128X[104X
    [4X[28Xces, 140 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsRegularDigraph(D);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XChromaticNumber(D);[127X[104X
    [4X[28X3[128X[104X
    [4X[25Xgap>[125X [27XCliqueNumber(D);[127X[104X
    [4X[28X2[128X[104X
  [4X[32X[104X
  
  [1X3.5-27 KnightsGraph[101X
  
  [33X[1;0Y[29X[2XKnightsGraph[102X( [[3Xfilt[103X, ][3Xm[103X, [3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xm[103X  and [3Xn[103X are positive integers, then this operation returns the [13Xknight's
  graph[113X of an [3Xm[103X by [3Xn[103X chessboard, as a symmetric digraph.[133X
  
  [33X[0;0YA  knight's  graph  represents  all possible moves of the knight chess piece
  across  a  chessboard. An [3Xm[103X by [3Xn[103X chessboard is a grid of [3Xm[103X columns (‘files’)
  and  [3Xn[103X  rows  (‘ranks’)  that  intersect  in  squares. Orthogonally adjacent
  squares are alternately colored light and dark, with the square in the first
  rank and file being dark.[133X
  
  [33X[0;0YThe  [10X[3Xm[103X[10X  *  [3Xn[103X[10X[110X  vertices  of  the  knight's graph can be placed onto the [10X[3Xm[103X[10X * [3Xn[103X[10X[110X
  squares  of an [3Xm[103X by [3Xn[103X chessboard, such that two vertices are adjacent in the
  digraph  if  and only if a knight can move between the corresponding squares
  in a single turn.[133X
  
  [33X[0;0YThe  chosen  correspondence  between  vertices and chess squares is given by
  [2XDigraphVertexLabels[102X  ([14X5.1-10[114X).  In  more detail, the vertices of the digraph
  are labelled by elements of the Cartesian product [10X[1..[3Xm[103X[10X] x [1..[3Xn[103X[10X][110X, where the
  first  entry  indexes the column (file) of the square in the chessboard, and
  the  second entry indexes the row (rank) of the square. (Note that the files
  are  traditionally  indexed  by  the lowercase letters of the alphabet). The
  vertices  are sorted in ascending order, first by row (second component) and
  then column (first component).[133X
  
  [33X[0;0YSee  Wikipedia  ([7Xhttps://en.wikipedia.org/wiki/Knight's_graph[107X)  for  further
  information.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := KnightsGraph(8, 8);[127X[104X
    [4X[28X<immutable connected symmetric digraph with 64 vertices, 336 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsConnectedDigraph(D);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XD := KnightsGraph(3, 3);[127X[104X
    [4X[28X<immutable symmetric digraph with 9 vertices, 16 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsConnectedDigraph(D);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XKnightsGraph(IsMutable, 3, 9);[127X[104X
    [4X[28X<mutable digraph with 27 vertices, 88 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.5-28 LindgrenSousselierGraph[101X
  
  [33X[1;0Y[29X[2XLindgrenSousselierGraph[102X( [[3Xfilt[103X, ][3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xn[103X  is  an  integer  greater  than 0, then this operation returns the [3Xn[103Xth
  [13XLindgren-Sousselier  graph[113X, an infinite family of hyophamiltonian graphs - a
  graph  that  is  non-Hamiltonian but removing any vector gives a Hamiltonian
  graph.  The  graph  has [10X6[3Xn[103X[10X+4[110X vertices and [10X15 + 10([3Xn[103X[10X-1)[110X undirected edges. The
  first  Lindgren-Sousselier  graph  is the Petersen graph, and is in fact the
  smallest hyophamiltonian graph.[133X
  
  [33X[0;0YSee   [7Xhttps://mathworld.wolfram.com/HypohamiltonianGraph.html[107X   for  further
  details.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := LindgrenSousselierGraph(3);[127X[104X
    [4X[28X<immutable symmetric digraph with 22 vertices, 70 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsHamiltonianDigraph(D);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XIsHamiltonianDigraph(DigraphRemoveVertex(D, 1));[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsIsomorphicDigraph(LindgrenSousselierGraph(1), PetersenGraph());[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.5-29 LollipopGraph[101X
  
  [33X[1;0Y[29X[2XLollipopGraph[102X( [[3Xfilt[103X, ][3Xm[103X, [3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xm[103X  and  [3Xn[103X  are  positive  integers,  then  this  operation  returns  the
  [13X([3Xm[103X,[3Xn[103X)-lollipop            graph[113X.           As           defined           at
  [7Xhttps://en.wikipedia.org/wiki/Lollipop_graph[107X,  this  consists  of a complete
  digraph  on  the  vertices  [10X[1..[3Xm[103X[10X][110X  (the  'head'  of  the lollipop), and the
  symmetric  closure  of  a  chain  digraph  on  the remaining [3Xn[103X vertices (the
  'stick'), connected by a bridge (the edge [10X[[3Xm[103X[10X, [3Xm[103X[10X+1][110X and its reverse).[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := LollipopGraph(5, 3);[127X[104X
    [4X[28X<immutable connected symmetric digraph with 8 vertices, 26 edges>[128X[104X
    [4X[25Xgap>[125X [27XCliqueNumber(D);[127X[104X
    [4X[28X5[128X[104X
    [4X[25Xgap>[125X [27XDigraphUndirectedGirth(D);[127X[104X
    [4X[28X3[128X[104X
    [4X[25Xgap>[125X [27XLollipopGraph(IsMutableDigraph, 3, 8);[127X[104X
    [4X[28X<mutable digraph with 11 vertices, 22 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.5-30 MobiusLadderGraph[101X
  
  [33X[1;0Y[29X[2XMobiusLadderGraph[102X( [[3Xfilt[103X, ][3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xn[103X  is  a  positive  integer  at least 4, then this operation returns the
  [13XMobius  ladder  graph[113X  that  is obtained by introducing a 'twist' in the [3Xn[103Xth
  prism  graph,  similar  to  the  construction  of a Mobius strip. The Mobius
  ladder graph is isomorphic to the circulant graph [10XCi(2[3Xn[103X[10X, [1, [3Xn[103X[10X])[110X. The Mobius
  ladders  are cubic, symmetric, Hamiltonian, vertex-transitive, and graceful.
  They are also non-planar and apex, meaning removing a single vertex produces
  a planar graph.[133X
  
  [33X[0;0YSee [7Xhttps://mathworld.wolfram.com/MoebiusLadder.html[107X for further details.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := MobiusLadderGraph(7);[127X[104X
    [4X[28X<immutable symmetric digraph with 14 vertices, 42 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsHamiltonianDigraph(D);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsVertexTransitive(D);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsPlanarDigraph(D);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XD2 := DigraphRemoveVertex(D, 1);[127X[104X
    [4X[28X<immutable digraph with 13 vertices, 36 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsPlanarDigraph(D2);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.5-31 MycielskiGraph[101X
  
  [33X[1;0Y[29X[2XMycielskiGraph[102X( [[3Xfilt[103X, ][3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xn[103X  is  an  integer  greater  than 1, then this operation returns the [3Xn[103Xth
  [13XMycielski  graph[113X. The Mycielskian of a triangle-free graph is a construction
  that  adds  vertices  and  edges  to  produce  a  new  graph  that  is still
  triangle-free  but has a larger chromatic number. The Mycielski graphs are a
  series of graphs with this construction repeated, starting with the complete
  graph  on  two  vertices.  The  graph has [10X3 * 2^([3Xn[103X[10X-2) - 1[110X vertices, with the
  number of edges being [10X(18 - 27 * 2 ^ [3Xn[103X[10X + 14 * 3 ^ [3Xn[103X[10X) / 36[110X.[133X
  
  [33X[0;0YThe  Mycielski graph has chromatic number equal to [3Xn[103X, clique number equal to
  [22X2[122X,  and is Hamiltonian. The graph is in fact the graph with chromatic number
  [3Xn[103X with the least possible vertices.[133X
  
  [33X[0;0YSee [7Xhttps://mathworld.wolfram.com/MycielskiGraph.html[107X for further details.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := MycielskiGraph(4);[127X[104X
    [4X[28X<immutable Hamiltonian connected symmetric digraph with 11 vertices, 4\[128X[104X
    [4X[28X0 edges>[128X[104X
    [4X[25Xgap>[125X [27XChromaticNumber(D);[127X[104X
    [4X[28X4[128X[104X
    [4X[25Xgap>[125X [27XCliqueNumber(D);[127X[104X
    [4X[28X2[128X[104X
  [4X[32X[104X
  
  [1X3.5-32 OddGraph[101X
  
  [33X[1;0Y[29X[2XOddGraph[102X( [[3Xfilt[103X, ][3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xn[103X  is an integer greater than 0, then this operation returns the [3Xn[103Xth [13Xodd
  graph[113X.  The  odd  graph  has  vertices  labelled  with  the [10X[3Xn[103X[10X-1[110X-subsets of a
  [10X2[3Xn[103X[10X-1[110X-set,  with  two  vertices  adjacent  if  and  only if their subsets are
  disjoint.  The  [3Xn[103Xth  odd graph is the [10X(2[3Xn[103X[10X-1, [3Xn[103X[10X-1)[110X-th Kneser graph. The graph
  has [10XBinomial(2[3Xn[103X[10X-1, [3Xn[103X[10X-1)[110X vertices and [10X[3Xn[103X[10X * Binomial(2[3Xn[103X[10X-1, [3Xn[103X[10X-1) / 2[110X edges.[133X
  
  [33X[0;0YThe  odd  graph  is  regular and distance transitive (and therefore distance
  regular).  They  have chromatic number equal to 3, and all Odd graphs with [3Xn[103X
  greater than 3 are Hamiltonian. They are also vertex and edge transitive.[133X
  
  [33X[0;0YSee [7Xhttps://mathworld.wolfram.com/OddGraph.html[107X for further details.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := OddGraph(4);[127X[104X
    [4X[28X<immutable edge- and vertex-transitive symmetric digraph with 35 verti\[128X[104X
    [4X[28Xces, 140 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsIsomorphicDigraph(D, KneserGraph(7, 3));[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XChromaticNumber(D);[127X[104X
    [4X[28X3[128X[104X
  [4X[32X[104X
  
  [1X3.5-33 PathGraph[101X
  
  [33X[1;0Y[29X[2XPathGraph[102X( [[3Xfilt[103X, ][3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xn[103X  is  a  non-negative  integer then this operation returns the [3Xn[103Xth [13Xpath
  graph[113X,  consisting  of the path on [3Xn[103X vertices. This is the symmetric closure
  of  the  [2XChainDigraph[102X  ([14X3.5-9[114X). The path graph has [3Xn[103X vertices and [10X[3Xn[103X[10X-1[110X edges.
  The path graph is an undirected tree.[133X
  
  [33X[0;0YSee [7Xhttps://mathworld.wolfram.com/PathGraph.html[107X for further details.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := PathGraph(12);[127X[104X
    [4X[28X<immutable undirected tree digraph with 12 vertices>[128X[104X
  [4X[32X[104X
  
  [1X3.5-34 PermutationStarGraph[101X
  
  [33X[1;0Y[29X[2XPermutationStarGraph[102X( [[3Xfilt[103X, ][3Xn[103X, [3Xk[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf [3Xn[103X is an integer at greater than 0 and [3Xk[103X is an integer greater than 1, and
  [3Xk[103X  less  than  or  equal  to  [3Xn[103X,  then  this operation returns the [10X([3Xn[103X[10X, [3Xk[103X[10X)[110X-th
  [13Xpermutation  star graph[113X. The vertices of the graph are given by the [3Xk[103X-length
  ordered  subsets  of  an  [3Xn[103X-set,  with two vertices being adjacent if one is
  labelled  [10Xp1  p2 p3 ... pi ... p[3Xk[103X[10X[110X, and the other is either labelled [10Xpi p2 p3
  ... p1 ... p[3Xk[103X[10X[110X, or labelled [10Xx p2 p3 ... pi ... p[3Xk[103X[10X[110X where [10Xx[110X is in [10X[1..[3Xn[103X[10X][110X and is
  not equal to [10Xp1[110X. The graph has [10X[3Xn[103X[10X! / ([3Xn[103X[10X - [3Xk[103X[10X)![110X vertices.[133X
  
  [33X[0;0YThe permutation star graph is regular and vertex transitive. It has diameter
  [10X2[3Xk[103X[10X  - 1[110X if [3Xk[103X less than or equal to [10XInt([3Xn[103X[10X / 2)[110X, and diameter [10XInt(([3Xn[103X[10X - 1) / 2)
  + [3Xk[103X[10X[110X if [10X[3Xk[103X[10X >= Int([3Xn[103X[10X / 2) + 1[110X.[133X
  
  [33X[0;0YSee   [7Xhttps://mathworld.wolfram.com/PermutationStarGraph.html[107X   for  further
  details.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := PermutationStarGraph(6, 2);[127X[104X
    [4X[28X<immutable vertex-transitive symmetric digraph with 30 vertices, 150 e\[128X[104X
    [4X[28Xdges>[128X[104X
    [4X[25Xgap>[125X [27XDigraphDiameter(D);[127X[104X
    [4X[28X3[128X[104X
  [4X[32X[104X
  
  [1X3.5-35 PetersenGraph[101X
  
  [33X[1;0Y[29X[2XPetersenGraph[102X( [[3Xfilt[103X] ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YFrom [7Xhttps://en.wikipedia.org/wiki/Petersen_graph[107X:[133X
  
  [33X[0;0Y[21XThe  Petersen graph is an undirected graph with 10 vertices and 15 edges. It
  is a small graph that serves as a useful example and counterexample for many
  problems in graph theory. The Petersen graph is named after Julius Petersen,
  who in 1898 constructed it to be the smallest bridgeless cubic graph with no
  three-edge-coloring.[121X[133X
  
  [33X[0;0YSee also [2XGeneralisedPetersenGraph[102X ([14X3.5-36[114X).[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XChromaticNumber(PetersenGraph());[127X[104X
    [4X[28X3[128X[104X
    [4X[25Xgap>[125X [27XPetersenGraph(IsMutableDigraph);[127X[104X
    [4X[28X<mutable digraph with 10 vertices, 30 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.5-36 GeneralisedPetersenGraph[101X
  
  [33X[1;0Y[29X[2XGeneralisedPetersenGraph[102X( [[3Xfilt[103X, ][3Xn[103X, [3Xk[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xn[103X is a positive integer and [3Xk[103X is a non-negative integer less than [10X[3Xn[103X[10X / 2[110X,
  then this operation returns the [13Xgeneralised Petersen graph[113X [22XGPG([3Xn[103X, k)[122X.[133X
  
  [33X[0;0YFrom [7Xhttps://en.wikipedia.org/wiki/Generalized_Petersen_graph[107X:[133X
  
  [33X[0;0Y[21XThe  generalized  Petersen  graphs  are  a  family of cubic graphs formed by
  connecting  the  vertices of a regular polygon to the corresponding vertices
  of a star polygon. They include the Petersen graph and generalize one of the
  ways  of  constructing  the  Petersen  graph. The generalized Petersen graph
  family  was introduced in 1950 by H. S. M. Coxeter and was given its name in
  1969 by Mark Watkins.[121X[133X
  
  [33X[0;0YSee also [2XPetersenGraph[102X ([14X3.5-35[114X).[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XGeneralisedPetersenGraph(7, 2);[127X[104X
    [4X[28X<immutable symmetric digraph with 14 vertices, 42 edges>[128X[104X
    [4X[25Xgap>[125X [27XGeneralisedPetersenGraph(40, 1);[127X[104X
    [4X[28X<immutable symmetric digraph with 80 vertices, 240 edges>[128X[104X
    [4X[25Xgap>[125X [27XD := GeneralisedPetersenGraph(5, 2);[127X[104X
    [4X[28X<immutable symmetric digraph with 10 vertices, 30 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsIsomorphicDigraph(D, PetersenGraph());[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XGeneralisedPetersenGraph(IsMutableDigraph, 9, 4);[127X[104X
    [4X[28X<mutable digraph with 18 vertices, 54 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.5-37 PrismGraph[101X
  
  [33X[1;0Y[29X[2XPrismGraph[102X( [[3Xfilt[103X, ][3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf [3Xn[103X is a positive integer at least 3, then this operation returns the [13Xprism
  graph[113X  that  is  the  skeleton  of  the  [3Xn[103X-prism.  It has [10X2[3Xn[103X[10X[110X vertices and [10X3[3Xn[103X[10X[110X
  undirected  edges.  The  prism  graph  is a symmetric digraph. The [3Xn[103Xth prism
  graph  is isomorphic to the graph Cartesian product of the second path graph
  and  the  [3Xn[103Xth  cycle  graph,  isomorphic  to  the generalised Petersen graph
  [10XGP([3Xn[103X[10X,1)[110X.  If  [3Xn[103X  is  odd then the prism graph is isomorphic to the Circulant
  graph [10XCi(2[3Xn[103X[10X, [2,[3Xn[103X[10X])[110X. The prism graph is Hamiltonian.[133X
  
  [33X[0;0YSee [7Xhttps://mathworld.wolfram.com/PrismGraph.html[107X for further details.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := PrismGraph(4);[127X[104X
    [4X[28X<immutable symmetric digraph with 8 vertices, 24 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsHamiltonianDigraph(D);[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XD := PrismGraph(5);[127X[104X
    [4X[28X<immutable symmetric digraph with 10 vertices, 30 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsIsomorphicDigraph(D, CirculantGraph(10, [2, 5]));[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.5-38 StackedPrismGraph[101X
  
  [33X[1;0Y[29X[2XStackedPrismGraph[102X( [[3Xfilt[103X, ][3Xn[103X, [3Xk[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xn[103X  is  an  integer  at  least  3  and  [3Xk[103X is a positive integer then this
  operation  returns  the  [10X([3Xn[103X[10X,[3Xk[103X[10X)[110X-th  [13Xstacked  prism  graph[113X.  The  graph  is  [3Xk[103X
  concentric  [3Xn[103X-Cycle  graphs  connected  by  spokes. The stacked prism is the
  graph  Cartesian  product of the [3Xn[103Xth cycle graph and the [3Xk[103Xth path graph. The
  graph  has  [10X[3Xn[103X[10X[3Xk[103X[10X[110X  vertices  and [10X[3Xn[103X[10X(2[3Xk[103X[10X - 1)[110X undirected edges. If [3Xk[103X is 1 then the
  graph is the [3Xn[103Xth cycle graph, if [3Xk[103X is 2 then the graph is the prism graph.[133X
  
  [33X[0;0YSee    [7Xhttps://mathworld.wolfram.com/StackedPrismGraph.html[107X    for   further
  details.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := StackedPrismGraph(5, 2);[127X[104X
    [4X[28X<immutable symmetric digraph with 10 vertices, 30 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsIsomorphicDigraph(D, PrismGraph(5));[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.5-39 QueensGraph[101X
  
  [33X[1;0Y[29X[2XQueensGraph[102X( [[3Xfilt[103X, ][3Xm[103X, [3Xn[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XQueenGraph[102X( [[3Xfilt[103X, ][3Xm[103X, [3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xm[103X  and  [3Xn[103X are positive integers, then this operation returns the [13Xqueen's
  graph[113X of an [3Xm[103X by [3Xn[103X chessboard, as a symmetric digraph.[133X
  
  [33X[0;0YThe  queen's  graph  represents  all possible moves of the queen chess piece
  across  a  chessboard. An [3Xm[103X by [3Xn[103X chessboard is a grid of [3Xm[103X columns (‘files’)
  and  [3Xn[103X  rows  (‘ranks’)  that  intersect  in  squares. Orthogonally adjacent
  squares are alternately colored light and dark, with the square in the first
  rank and file being dark.[133X
  
  [33X[0;0YThe [10X[3Xm[103X[10X * [3Xn[103X[10X[110X vertices of the queen's graph can be placed onto the [10X[3Xm[103X[10X * [3Xn[103X[10X[110X squares
  of  an [3Xm[103X by [3Xn[103X chessboard, such that two vertices are adjacent in the digraph
  if  and  only  if  the queen can move between the corresponding squares in a
  single turn. A legal queen's move is defined as one which moves the queen to
  an (orthogonally or diagonally) adjacent square, or to a square which can be
  reached through a series of such moves, with all of the small moves being in
  the same direction.[133X
  
  [33X[0;0YNote that the [2XQueensGraph[102X is the [2XDigraphEdgeUnion[102X ([14X3.3-29[114X) of the [2XRooksGraph[102X
  ([14X3.5-40[114X) and the [2XBishopsGraph[102X ([14X3.5-5[114X) of the same dimensions.[133X
  
  [33X[0;0YThe  chosen  correspondence  between  vertices and chess squares is given by
  [2XDigraphVertexLabels[102X  ([14X5.1-10[114X).  In  more detail, the vertices of the digraph
  are labelled by elements of the Cartesian product [10X[1..[3Xm[103X[10X] x [1..[3Xn[103X[10X][110X, where the
  first  entry  indexes the column (file) of the square in the chessboard, and
  the  second entry indexes the row (rank) of the square. (Note that the files
  are  traditionally  indexed  by  the lowercase letters of the alphabet). The
  vertices  are sorted in ascending order, first by row (second component) and
  then column (first component).[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XQueensGraph(2, 5);[127X[104X
    [4X[28X<immutable connected symmetric digraph with 10 vertices, 66 edges>[128X[104X
    [4X[25Xgap>[125X [27XD := QueensGraph(4, 3);[127X[104X
    [4X[28X<immutable connected symmetric digraph with 12 vertices, 92 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsRegularDigraph(D);[127X[104X
    [4X[28Xfalse[128X[104X
    [4X[25Xgap>[125X [27XQueensGraph(6, 9) =[127X[104X
    [4X[25X>[125X [27X   DigraphEdgeUnion(RooksGraph(6, 9), BishopsGraph(6, 9));[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.5-40 RooksGraph[101X
  
  [33X[1;0Y[29X[2XRooksGraph[102X( [[3Xfilt[103X, ][3Xm[103X, [3Xn[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XRookGraph[102X( [[3Xfilt[103X, ][3Xm[103X, [3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xm[103X  and  [3Xn[103X  are positive integers, then this operation returns the [13Xrook's
  graph[113X of an [3Xm[103X by [3Xn[103X chessboard, as a symmetric digraph.[133X
  
  [33X[0;0YA  rook's graph represents all possible moves of the rook chess piece across
  a  chessboard.  An  [3Xm[103X by [3Xn[103X chessboard is a grid of [3Xm[103X columns (‘files’) and [3Xn[103X
  rows  (‘ranks’) that intersect in squares. Orthogonally adjacent squares are
  alternately  colored  light  and dark, with the square in the first rank and
  file being dark.[133X
  
  [33X[0;0YThe  [10X[3Xm[103X[10X * [3Xn[103X[10X[110X vertices of the rook's graph can be placed onto the [10X[3Xm[103X[10X * [3Xn[103X[10X[110X squares
  of  an [3Xm[103X by [3Xn[103X chessboard, such that two vertices are adjacent in the digraph
  if and only if a rook can move between the corresponding squares in a single
  turn.  A  legal  rook's  move  is  defined as one which moves the rook to an
  orthogonally  adjacent square, or to a square which can be reached through a
  series  of  such  moves,  with  all  of  the  small  moves being in the same
  direction.[133X
  
  [33X[0;0YThe  chosen  correspondence  between  vertices and chess squares is given by
  [2XDigraphVertexLabels[102X  ([14X5.1-10[114X).  In  more detail, the vertices of the digraph
  are labelled by elements of the Cartesian product [10X[1..[3Xm[103X[10X] x [1..[3Xn[103X[10X][110X, where the
  first  entry  indexes the column (file) of the square in the chessboard, and
  the  second entry indexes the row (rank) of the square. (Note that the files
  are  traditionally  indexed  by  the lowercase letters of the alphabet). The
  vertices  are sorted in ascending order, first by row (second component) and
  then column (first component).[133X
  
  [33X[0;0YSee   Wikipedia   ([7Xhttps://en.wikipedia.org/wiki/Rook's_graph[107X)  for  further
  information.  See  also  [2XDigraphCartesianProduct[102X  ([14X3.3-31[114X)  and  [2XLineDigraph[102X
  ([14X3.3-40[114X).[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := RooksGraph(7, 4);[127X[104X
    [4X[28X<immutable connected regular symmetric digraph with 28 vertices, 252 e\[128X[104X
    [4X[28Xdges>[128X[104X
    [4X[25Xgap>[125X [27XRooksGraph(1, 8);[127X[104X
    [4X[28X<immutable connected regular symmetric digraph with 8 vertices, 56 edg\[128X[104X
    [4X[28Xes>[128X[104X
  [4X[32X[104X
  
  [1X3.5-41 SquareGridGraph[101X
  
  [33X[1;0Y[29X[2XSquareGridGraph[102X( [[3Xfilt[103X, ][3Xn[103X, [3Xk[103X ) [32X operation[133X
  [33X[1;0Y[29X[2XGridGraph[102X( [[3Xfilt[103X, ][3Xn[103X, [3Xk[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xn[103X and [3Xk[103X are positive integers, then this operation returns a square grid
  graph of dimension [3Xn[103X by [3Xk[103X.[133X
  
  [33X[0;0YA  [13Xsquare  grid  graph[113X  of  dimension  [3Xn[103X by [3Xk[103X is the [2XDigraphCartesianProduct[102X
  ([14X3.3-31[114X)  of  the  symmetric  closures  of  the  chain digraphs with [3Xn[103X and [3Xk[103X
  vertices; see [2XDigraphSymmetricClosure[102X ([14X3.3-12[114X) and [2XChainDigraph[102X ([14X3.5-9[114X).[133X
  
  [33X[0;0YIn  particular,  the [10X[3Xn[103X[10X * [3Xk[103X[10X[110X vertices can be arranged into an [3Xn[103X by [3Xk[103X grid such
  that  two  vertices  are  adjacent  in  the  digraph if and only if they are
  orthogonally  adjacent  in the grid. The correspondence between vertices and
  grid positions is given by [2XDigraphVertexLabels[102X ([14X5.1-10[114X).[133X
  
  [33X[0;0YSee [7Xhttps://en.wikipedia.org/wiki/Lattice_graph[107X for more information.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XSquareGridGraph(5, 5);[127X[104X
    [4X[28X<immutable connected bipartite symmetric digraph with bicomponent size\[128X[104X
    [4X[28Xs 13 and 12>[128X[104X
    [4X[25Xgap>[125X [27XGridGraph(IsMutable, 3, 4);[127X[104X
    [4X[28X<mutable digraph with 12 vertices, 34 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.5-42 TriangularGridGraph[101X
  
  [33X[1;0Y[29X[2XTriangularGridGraph[102X( [[3Xfilt[103X, ][3Xn[103X, [3Xk[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xn[103X  and [3Xk[103X are positive integers, then this operation returns a triangular
  grid graph of dimension [3Xn[103X by [3Xk[103X.[133X
  
  [33X[0;0YA  [13Xtriangular  grid  graph[113X  of  dimension  [3Xn[103X  by  [3Xk[103X  is  a symmetric digraph
  constructed  from the [2XSquareGridGraph[102X ([14X3.5-41[114X) of the same dimensions, where
  additionally two vertices are adjacent in the digraph if they are diagonally
  adjacent   in   the  grid,  on  a  particular  one  of  the  diagonals.  The
  correspondence   between   vertices   and   grid   positions   is  given  by
  [2XDigraphVertexLabels[102X  ([14X5.1-10[114X). More specifically, the particular diagonal is
  the  one  such  that, the vertices corresponding to the grid positions [10X[2,1][110X
  and [10X[1,2][110X are adjacent (if they exist), but those corresponding to [10X[1,1][110X and
  [10X[2,2][110X are not.[133X
  
  [33X[0;0YSee    [7Xhttps://en.wikipedia.org/wiki/Lattice_graph#Other_kinds[107X    for   more
  information.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XTriangularGridGraph(3, 3);[127X[104X
    [4X[28X<immutable connected symmetric digraph with 9 vertices, 32 edges>[128X[104X
    [4X[25Xgap>[125X [27XTriangularGridGraph(IsMutable, 3, 3);[127X[104X
    [4X[28X<mutable digraph with 9 vertices, 32 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.5-43 StarGraph[101X
  
  [33X[1;0Y[29X[2XStarGraph[102X( [[3Xfilt[103X, ][3Xk[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xk[103X is a positive integer, then this operation returns the [13Xstar graph[113X with
  [3Xk[103X  vertices,  which  is the undirected tree in which vertex [10X1[110X is adjacent to
  all  other vertices. If [3Xk[103X is at least [10X2[110X, then this is the complete bipartite
  digraph with bicomponents [10X[1][110X and [10X[2 .. [3Xk[103X[10X][110X.[133X
  
  [33X[0;0YSee   [2XIsUndirectedTree[102X   ([14X6.3-9[114X),  [2XIsCompleteBipartiteDigraph[102X  ([14X6.1-4[114X),  and
  [2XDigraphBicomponents[102X ([14X5.3-13[114X).[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XStarGraph(IsMutable, 10);[127X[104X
    [4X[28X<mutable digraph with 10 vertices, 18 edges>[128X[104X
    [4X[25Xgap>[125X [27XStarGraph(5);[127X[104X
    [4X[28X<immutable complete bipartite digraph with bicomponent sizes 1 and 4>[128X[104X
    [4X[25Xgap>[125X [27XIsSymmetricDigraph(StarGraph(3));[127X[104X
    [4X[28Xtrue[128X[104X
    [4X[25Xgap>[125X [27XIsUndirectedTree(StarGraph(3));[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.5-44 TadpoleGraph[101X
  
  [33X[1;0Y[29X[2XTadpoleGraph[102X( [[3Xfilt[103X, ][3Xm[103X, [3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YThe  [13Xtadpole  graph[113X  is  the  symmetric closure of the disjoint union of the
  cycle digraph on [10X[1..[3Xm[103X[10X][110X (the 'head' of the tadpole) and the chain digraph on
  [10X[[3Xm[103X[10X+1..[3Xm[103X[10X+[3Xn[103X[10X][110X  (the 'tail' of the tadpole), along with the additional edges [10X[1,
  [3Xm[103X[10X+1][110X  and [10X[1, [3Xm[103X[10X+1][110X which connect the 'head' and the 'tail'. For more details
  on        the        tadpole        graph        please       refer       to
  [7Xhttps://en.wikipedia.org/wiki/Tadpole_graph[107X.[133X
  
  [33X[0;0YSee   [2XDigraphSymmetricClosure[102X   ([14X3.3-12[114X),   [2XDigraphDisjointUnion[102X   ([14X3.3-28[114X),
  [2XCycleDigraph[102X ([14X3.5-14[114X), and [2XChainDigraph[102X ([14X3.5-9[114X).[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XTadpoleGraph(10, 15);[127X[104X
    [4X[28X<immutable symmetric digraph with 25 vertices, 50 edges>[128X[104X
    [4X[25Xgap>[125X [27XTadpoleGraph(IsMutableDigraph, 5, 6);[127X[104X
    [4X[28X<mutable digraph with 11 vertices, 22 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsSymmetricDigraph(TadpoleGraph(3, 5));[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.5-45 WalshHadamardGraph[101X
  
  [33X[1;0Y[29X[2XWalshHadamardGraph[102X( [[3Xfilt[103X, ][3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xn[103X  is  a  positive  integer  at least 1, then this operation returns the
  [13XHadamard  graph[113X  constructed from the [3Xn[103Xth Hadamard matrix (of dimension [10X2^[3Xn[103X[10X[110X)
  as  constructed  by  Joseph Walsh. A Hadamard matrix is a square matrix with
  entries  either [22X1[122X or [22X-1[122X, such that all the rows are mutually orthogonal. The
  [3Xn[103Xth  Walsh  Hadamard  graph  is  a  graph  on  [10X4[3Xn[103X[10X[110X  matrices  split into four
  categories [22Xr_i+, r_i-, c_i+, c_i-[122X. If [22Xh_ij[122X are the elements of the [3Xn[103Xth Walsh
  matrix,  then  if  [22Xh_ij = 1[122X then [22X(r_i+, c_j+)[122X and [22X(r_i-, c_j-)[122X are edges, if
  [22Xh_ij  =  -1[122X  then  [22X(r_i+,  c_j-)[122X  and [22X(r_i-, c_j+)[122X are edges. Walsh Hadamard
  graphs are distance transitive and distance regular.[133X
  
  [33X[0;0YSee [7Xhttps://mathworld.wolfram.com/HadamardGraph.html[107X for further details.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := WalshHadamardGraph(5);[127X[104X
    [4X[28X<immutable symmetric digraph with 64 vertices, 1024 edges>[128X[104X
    [4X[25Xgap>[125X [27XIsDistanceRegularDigraph(D);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.5-46 WebGraph[101X
  
  [33X[1;0Y[29X[2XWebGraph[102X( [[3Xfilt[103X, ][3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf [3Xn[103X is an integer at least 3 then this operation returns the [3Xn[103Xth [13Xweb graph[113X.
  The  web  graph  is  the  [10X([3Xn[103X[10X,3)[110X-th stacked prism graph with the edges of the
  outer cycle removed. The graph has [10X3[3Xn[103X[10X[110X vertices and [10X4[3Xn[103X[10X[110X undirected edges.[133X
  
  [33X[0;0YSee [7Xhttps://mathworld.wolfram.com/WebGraph.html[107X for further details.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := WebGraph(5);[127X[104X
    [4X[28X<immutable symmetric digraph with 15 vertices, 40 edges>[128X[104X
  [4X[32X[104X
  
  [1X3.5-47 WheelGraph[101X
  
  [33X[1;0Y[29X[2XWheelGraph[102X( [[3Xfilt[103X, ][3Xn[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xn[103X  is a positive integer at least 4, then this operation returns the [3Xn[103Xth
  [13Xwheel graph[113X. The Wheel graph is formed from an [10X[3Xn[103X[10X-1[110X cycle graph with a single
  additional  vertex  adjacent  to  all vertices of the cycle. The graph has [3Xn[103X
  vertices  and  [10X2([3Xn[103X[10X-1)[110X edges. Wheel graphs are the skeletons of [10X[3Xn[103X[10X-1[110X pyramids,
  and are self-dual. If [3Xn[103X is odd, then the chromatic number of the wheel graph
  is  3 and the Wheel graph is perfect, and it is 4 otherwise. The wheel graph
  is also Hamiltonian and planar.[133X
  
  [33X[0;0YSee [7Xhttps://mathworld.wolfram.com/WheelGraph.html[107X for further details.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := WheelGraph(8);[127X[104X
    [4X[28X<immutable Hamiltonian connected symmetric digraph with 8 vertices, 28\[128X[104X
    [4X[28X edges>[128X[104X
    [4X[25Xgap>[125X [27XChromaticNumber(D);[127X[104X
    [4X[28X4[128X[104X
    [4X[25Xgap>[125X [27XIsHamiltonianDigraph(D);[127X[104X
    [4X[28Xtrue[128X[104X
  [4X[32X[104X
  
  [1X3.5-48 WindmillGraph[101X
  
  [33X[1;0Y[29X[2XWindmillGraph[102X( [[3Xfilt[103X, ][3Xn[103X, [3Xm[103X ) [32X operation[133X
  [6XReturns:[106X  [33X[0;10YA digraph.[133X
  
  [33X[0;0YIf  [3Xn[103X  and [3Xm[103X are integers greater than 1 then this operation returns the [10X([3Xn[103X[10X,
  [3Xm[103X[10X)[110X-th  [13Xwindmill  graph[113X.  The  windmill  graph is formed from [3Xm[103X copies of the
  complete  graph on [3Xn[103X vertices with one shared vertex. The graph has [10X[3Xm[103X[10X([3Xn[103X[10X - 1)
  +  1[110X  vertices  and [10X[3Xm[103X[10X * [3Xn[103X[10X * ([3Xn[103X[10X - 1) / 2[110X undirected edges. The windmill graph
  has chromatic number [3Xn[103X and diameter 2.[133X
  
  [33X[0;0YSee [7Xhttps://mathworld.wolfram.com/WindmillGraph.html[107X for further details.[133X
  
  [33X[0;0YIf the optional first argument [3Xfilt[103X is present, then this should specify the
  category  or  representation  the  digraph being created will belong to. For
  example, if [3Xfilt[103X is [2XIsMutableDigraph[102X ([14X3.1-2[114X), then the digraph being created
  will  be  mutable,  if  [3Xfilt[103X is [2XIsImmutableDigraph[102X ([14X3.1-3[114X), then the digraph
  will  be immutable. If the optional first argument [3Xfilt[103X is not present, then
  [2XIsImmutableDigraph[102X ([14X3.1-3[114X) is used by default.[133X
  
  [4X[32X  Example  [32X[104X
    [4X[25Xgap>[125X [27XD := WindmillGraph(4, 3);[127X[104X
    [4X[28X<immutable symmetric digraph with 10 vertices, 36 edges>[128X[104X
    [4X[25Xgap>[125X [27XChromaticNumber(D);[127X[104X
    [4X[28X4[128X[104X
  [4X[32X[104X
  
