  
  [1X9 Bistellar flips[0X
  
  
  [1X9.1 Theory[0X
  
  Since  two  combinatorial  manifolds are already considered distinct to each
  other  as  soon  as  they  are not combinatorially isomorphic, a topological
  PL-manifold  is  represented  by  a  whole class of combinatorial manifolds.
  Thus,  a  frequent  question  when  working  with combinatorial manifolds is
  whether  two  such  objects  are  PL-homeomorphic or not. One possibility to
  approach this problem, i. e. to find combinatorially distinct members of the
  class  of  a  PL-manifold,  is  a  heuristic  algorithm using the concept of
  bistellar moves.
  [12XDefinition[0m (Bistellar moves [Pac87])
  Let  M be a combinatorial d-manifold (d-pseudomanifold), gamma = < v_0 , ...
  ,  v_k  >  a  k-face  and  delta  = < w_0 , ... , w_d-k > a (d-k+1)-tuple of
  vertices of M that does not span a (d-k)-face in M, 0 <= k <= d, such that {
  v_0 , ..., v_k } cap { w_0 , ... , w_d-k } = emptyset and { v_0 , ... , v_k,
  w_0 , ... w_k-d } spans exactly d-k+1 facets. Then the operation
  kappa_(gamma,delta)  (  M  )  =  M \ (gamma star partial delta) cup (partial
  gamma star delta)
  is called a [13Xbistellar (d-k)-move[0m.
  In  other  words:  If there exists a bouquet D subset M of d-k+1 facets on a
  subset  of  vertices  W subset V of order d+2 with a common k-face gamma and
  the  complement  delta  of  the  vertices  of  gamma  in  W  does not span a
  (d-k)-face  in M we can remove D and replace it by a bouquet of k+1 facets E
  subset  M  with  vertex  set  W  with  a  common  face  spanned by delta. By
  construction  partial  D  =  partial  E  and  the altered complex is again a
  combinatorial  d-manifold  (d-pseudomanifold).  See  Fig. 11 for a bistellar
  1-move  of  a  2-dimensional complex, see Fig. 12 for all bistellar moves in
  dimension 3.
  
  A  bistellar  0-move  is  a  [13Xstellar subdivision[0m, i. e. the subdivision of a
  facet delta into d+1 new facets by introducing a new vertex at the center of
  delta  (cf.  Fig.  12  on  the  left).  In  particular,  the vertex set of a
  combinatorial  manifold  (pseudomanifold)  is  not invariant under bistellar
  moves.  For  any bistellar (d-k)-move kappa_(gamma,delta) we have an inverse
  bistellar  k-move  kappa^-1_(gamma,delta)  =  kappa_(delta,gamma)  such that
  kappa_(delta,gamma) ( kappa_(gamma,delta) (M)) = M. If for two combinatorial
  manifolds  M and N there exist a sequence of bistellar moves that transforms
  one  into  the  other,  M  and  N  are called [13Xbistellarly equivalent[0m. So far
  bistellar  moves are local operations on combinatorial manifolds that change
  its   combinatorial   type.   However,   the  strength  of  the  concept  in
  combinatorial topology is a consequence of the following
  [12XTheorem[0m (Bistellar moves [Pac87])
  Two combinatorial manifolds (pseudomanifolds) M and N are PL homeomorphic if
  and only if they are bistellarly equivalent.
  Unfortunately  Pachners  theorem  does  not  guarantee that the search for a
  connecting  sequence  of  bistellar moves between M and N terminates. Hence,
  using   bistellar   moves,   we   can  not  prove  that  M  and  N  are  not
  PL-homeomorphic.  However,  there  is  a  very effective simulated annealing
  approach  that  is  able  to  give  a positive answer in a lot of cases. The
  heuristic  was  first  implemented  by  Bjoerner  and  Lutz  in  [BL00]. The
  functions presented in this chapter are based on this code which can be used
  for several tasks:
  
  In many cases the heuristic reduces a given triangulation but does not reach
  a minimal triangulation after a reasonable amount of flips. Thus, we usually
  can  not  expect  the  algorithm  to  terminate.  However, in some cases the
  program normally stops after a small number of flips:
  
  Technical  note:  Since  bistellar  flips  do  not respect the combinatorial
  properties  of  a  complex,  no  attention  to the original vertex labels is
  payed,  i.  e.  the  flipped  complex  will be relabeled whenever its vertex
  labels  become different from the standard labeling (for example after every
  reverse 0-move).
  
  
  [1X9.2 Functions for bistellar flips[0X
  
  [1X9.2-1 SCBistellarOptions[0m
  
  [2X> SCBistellarOptions_________________________________________[0Xglobal variable
  
  Record  of  global variables to adjust output an behavior of bistellar moves
  in    [2XSCIntFunc.SCChooseMove[0m    ([14X9.2-4[0m)   and   [2XSCReduceComplexEx[0m   ([14X9.2-14[0m)
  respectively.
  
  (1)   [10XBaseRelaxation[0m:  determines  the  length  of  the  relaxation  period.
        Default: 3
  
  (2)   [10XBaseHeating[0m: determines the length of the heating period. Default: 4
  
  (3)   [10XRelaxation[0m: value of the current relaxation period. Default: 0
  
  (4)   [10XHeating[0m: value of the current heating period. Default: 0
  
  (5)   [10XMaxRounds[0m:  maximal  over  all  number of bistellar flips that will be
        performed. Default: 500000
  
  (6)   [10XMaxInterval[0m:  maximal number of bistellar flips that will be performed
        without a change of the f-vector of the moved complex. Default: 100000
  
  (7)   [10XMode[0m:  flip  mode,  0=reducing,  1=comparing, 2=reduce as sub-complex,
        3=randomize. Default: 0
  
  (8)   [10XWriteLevel[0m:  0=no output, 1=storing of every vertex minimal complex to
        user library, 2=e-mail notification. Default: 1
  
  (9)   [10XMailNotifyIntervall[0m:  (minimum)  number  of seconds between two e-mail
        notifications. Default: 24 * 60 * 60 (one day)
  
  (10)  [10XMaxIntervalIsManifold[0m:  maximal number of bistellar flips that will be
        performed  without  a  change  of  the f-vector of a vertex link while
        trying to prove that the complex is a combinatorial manifold. Default:
        5000
  
  (11)  [10XMaxIntervalRandomize  :=  50[0m:  number  of  flips performed to create a
        randomized sphere. Default: 50
  
  [4X---------------------------  Example  ----------------------------[0X
    [4X gap> SCBistellarOptions.BaseRelaxation;[0X
    [4X 3[0X
    [4X gap> SCBistellarOptions.BaseHeating;[0X
    [4X 4[0X
    [4X gap> SCBistellarOptions.Relaxation;[0X
    [4X 0[0X
    [4X gap> SCBistellarOptions.Heating;[0X
    [4X 0[0X
    [4X gap> SCBistellarOptions.MaxRounds;[0X
    [4X 500000[0X
    [4X gap> SCBistellarOptions.MaxInterval;[0X
    [4X 100000[0X
    [4X gap> SCBistellarOptions.Mode;[0X
    [4X 0[0X
    [4X gap> SCBistellarOptions.WriteLevel;[0X
    [4X 0[0X
    [4X gap> SCBistellarOptions.MailNotifyInterval;[0X
    [4X 86400[0X
    [4X gap> SCBistellarOptions.MaxIntervalIsManifold;[0X
    [4X 5000[0X
    [4X gap> SCBistellarOptions.MaxIntervalRandomize;[0X
    [4X 50[0X
    [4X [0X
  [4X------------------------------------------------------------------[0X
  
  [1X9.2-2 SCEquivalent[0m
  
  [2X> SCEquivalent( [0X[3Xcomplex1, complex2[0X[2X ) _________________________________[0Xmethod
  [6XReturns:[0X  [9Xtrue[0m  or  [9Xfalse[0m  upon  success,  [9Xfail[0m  or  a  list of type [10X[ fail,
            SCSimplicialComplex, Integer, facet list][0m otherwise.
  
  Checks  if  the  simplicial  complex [3Xcomplex1[0m (which has to fulfill the weak
  pseudomanifold   property  with  empty  boundary)  can  be  reduced  to  the
  simplicial  complex  [3Xcomplex2[0m  via  bistellar  moves,  i. e. if [3Xcomplex1[0m and
  [3Xcomplex2[0m   are   PL-homeomorphic.  Note  that  in  general  the  problem  is
  undecidable. In this case [9Xfail[0m is returned.
  
  It  is  recommended to use a minimal triangulation [3Xcomplex2[0m for the check if
  possible.
  
  Internally                      calls                      [2XSCReduceComplexEx[0m
  ([14X9.2-14[0m)[10X(complex1,complex2,1,SCIntFunc.SCChooseMove);[0m
  
  [4X---------------------------  Example  ----------------------------[0X
    [4X gap> SCBistellarOptions.WriteLevel:=0;; # do not save complexes to disk[0X
    [4X gap> obj:=SC([[1,2],[2,3],[3,4],[4,5],[5,6],[6,1]]);; # hexagon[0X
    [4X gap> refObj:=SCBdSimplex(2);; # triangle as a (minimal) reference object[0X
    [4X gap> SCEquivalent(obj,refObj);[0X
    [4X #I  SCReduceComplexEx: complexes are bistellarly equivalent.[0X
    [4X true[0X
    [4X [0X
  [4X------------------------------------------------------------------[0X
  
  [1X9.2-3 SCExamineComplexBistellar[0m
  
  [2X> SCExamineComplexBistellar( [0X[3Xcomplex[0X[2X ) _______________________________[0Xmethod
  [6XReturns:[0X  simplicial  complex  passed as argument with additional properties
            upon success, [9Xfail[0m otherwise.
  
  Computes  the  face lattice, the f-vector, the AS-determinant, the dimension
  and the maximal vertex label of [3Xcomplex[0m.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4X gap> obj:=SC([[1,2],[2,3],[3,4],[4,5],[5,6],[6,1]]);[0X
    [4X [SimplicialComplex[0X
    [4X [0X
    [4X  Properties known: Dim, FacetsEx, Name, Vertices.[0X
    [4X [0X
    [4X  Name="unnamed complex 7"[0X
    [4X  Dim=1[0X
    [4X [0X
    [4X /SimplicialComplex][0X
    [4X gap> SCExamineComplexBistellar(obj);[0X
    [4X [SimplicialComplex[0X
    [4X [0X
    [4X  Properties known: AltshulerSteinberg, BoundaryEx, Dim, FVector, [0X
    [4X                    FacetsEx, HasBoundary, IsPseudoManifold, IsPure, [0X
    [4X                    Name, NumFaces[], SkelExs[], Vertices.[0X
    [4X [0X
    [4X  Name="unnamed complex 7"[0X
    [4X  Dim=1[0X
    [4X  AltshulerSteinberg=0[0X
    [4X  FVector=[ 6, 6 ][0X
    [4X  HasBoundary=false[0X
    [4X  IsPseudoManifold=true[0X
    [4X  IsPure=true[0X
    [4X [0X
    [4X /SimplicialComplex][0X
    [4X [0X
  [4X------------------------------------------------------------------[0X
  
  [1X9.2-4 SCIntFunc.SCChooseMove[0m
  
  [2X> SCIntFunc.SCChooseMove( [0X[3Xdim, moves[0X[2X ) _____________________________[0Xfunction
  [6XReturns:[0X  a  bistellar  move,  i.  e.  a  pair  of  lists upon success, [9Xfail[0m
            otherwise.
  
  Since  the  problem  of  finding  a  bistellar  flip sequence that reduces a
  simplicial  complex  is undecidable, we have to use an heuristic approach to
  choose the next move.
  
  The  implemented  strategy  [10XSCIntFunc.SCChooseMove[0m  first  tries to directly
  remove  vertices, edges, i-faces in increasing dimension etc. If this is not
  possible it inserts high dimensional faces in decreasing co-dimension. To do
  this  in an efficient way a number of parameters have to be adjusted, namely
  [10XSCBistellarOptions.BaseHeating[0m  and  [10XSCBistellarOptions.BaseRelaxation[0m.  See
  [2XSCBistellarOptions[0m ([14X9.2-1[0m) for further options.
  
  If this strategy does not work for you, just implement a customized strategy
  and pass it to [2XSCReduceComplexEx[0m ([14X9.2-14[0m).
  
  See [2XSCRMoves[0m ([14X9.2-10[0m) for further information.
  
  [1X9.2-5 SCIsKStackedSphere[0m
  
  [2X> SCIsKStackedSphere( [0X[3Xcomplex, k[0X[2X ) ___________________________________[0Xmethod
  [6XReturns:[0X  a list upon success, [9Xfail[0m otherwise.
  
  Checks,  whether  the  given  simplicial  complex  [3Xcomplex[0m that must be a PL
  d-sphere  is  a  [3Xk[0m-stacked  sphere with 1<= k<= lfloorfracd+22rfloor using a
  randomized algorithm based on bistellar moves (see [Eff11b], [Eff11a]). Note
  that  it  is  not  checked  whether  [3Xcomplex[0m  is  a PL sphere -- if not, the
  algorithm  will not succeed. Returns a list upon success: the first entry is
  a  boolean,  where  [9Xtrue[0m means that the complex is [10Xk[0m-stacked and [9Xfalse[0m means
  that  the complex cannot be [3Xk[0m-stacked. A value of -1 means that the question
  could  not  be  decided.  The  second argument contains a simplicial complex
  that,  in  case  of  success,  contains  the trigangulated (d+1)-ball B with
  partial  B=S  and  operatornameskel_d-k(B)=operatornameskel_d-k(S),  where S
  denotes the simplicial complex passed in [3Xcomplex[0m.
  
  Internally calls [2XSCReduceComplexEx[0m ([14X9.2-14[0m).
  
  [4X---------------------------  Example  ----------------------------[0X
    [4X gap> SCLib.SearchByName("S^4~S^1");[0X
    [4X [ [ 463, "S^4~S^1 (VT)" ], [ 1473, "S^4~S^1 (VT)" ], [ 1474, "S^4~S^1 (VT)" ],[0X
    [4X   [ 2477, "S^4~S^1 (VT)" ], [ 4395, "S^4~S^1 (VT)" ], [0X
    [4X   [ 4396, "S^4~S^1 (VT)" ], [ 4397, "S^4~S^1 (VT)" ], [0X
    [4X   [ 4398, "S^4~S^1 (VT)" ], [ 4399, "S^4~S^1 (VT)" ], [0X
    [4X   [ 4402, "S^4~S^1 (VT)" ], [ 4403, "S^4~S^1 (VT)" ], [0X
    [4X   [ 4404, "S^4~S^1 (VT)" ] ][0X
    [4X gap> c:=SCLib.Load(last[1][1]);;[0X
    [4X gap> l:=SCLink(c,1);[0X
    [4X [SimplicialComplex[0X
    [4X [0X
    [4X  Properties known: Dim, FacetsEx, Name, Vertices.[0X
    [4X [0X
    [4X  Name="lk([ 1 ]) in S^4~S^1 (VT)"[0X
    [4X  Dim=4[0X
    [4X [0X
    [4X /SimplicialComplex][0X
    [4X gap> SCIsKStackedSphere(l,1);[0X
    [4X #I  SCIsKStackedSphere: checking if complex is a 1-stacked sphere...[0X
    [4X #I  SCIsKStackedSphere: try 1/50[0X
    [4X #I  SCIsKStackedSphere: complex is a 1-stacked sphere.[0X
    [4X [ true, [SimplicialComplex[0X
    [4X     [0X
    [4X      Properties known: Dim, FacetsEx, Name, Vertices.[0X
    [4X     [0X
    [4X      Name="Filled 1-stacked sphere (lk([ 1 ]) in S^4~S^1 (VT))"[0X
    [4X      Dim=5[0X
    [4X     [0X
    [4X     /SimplicialComplex] ][0X
    [4X [0X
  [4X------------------------------------------------------------------[0X
  
  [1X9.2-6 SCIsManifold[0m
  
  [2X> SCIsManifold( [0X[3Xcomplex[0X[2X ) ____________________________________________[0Xmethod
  [6XReturns:[0X  [9Xtrue[0m or [9Xfalse[0m upon success, [9Xfail[0m otherwise.
  
  Tries  to prove that a closed simplicial d-pseudomanifold is a combinatorial
  manifold by reducing its vertex links to the boundary of the d-simplex.
  
  [9Xfalse[0m  is returned if it can be proven that there exists a vertex link which
  is  not  PL-homeomorphic  to the standard PL-sphere, [9Xtrue[0m is returned if all
  vertex links are bistellarly equivalent to the boundary of the simplex, [9Xfail[0m
  is  returned  if the algorithm does not terminate after the number of rounds
  indicated by [10XSCBistellarOptions.MaxIntervallIsManifold[0m.
  
  Internally                      calls                      [2XSCReduceComplexEx[0m
  ([14X9.2-14[0m)[10X(link,SCEmpty(),0,SCIntFunc.SCChooseMove);[0m   for   every   link   of
  [3Xcomplex[0m. Note that [9Xfalse[0m is returned in case of a bounded manifold.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4X gap> c:=SCBdCrossPolytope(3);;[0X
    [4X gap> SCIsManifold(c);[0X
    [4X true[0X
    [4X [0X
  [4X------------------------------------------------------------------[0X
  
  [1X9.2-7 SCIsMovableComplex[0m
  
  [2X> SCIsMovableComplex( [0X[3Xcomplex[0X[2X ) ______________________________________[0Xmethod
  [6XReturns:[0X  [9Xtrue[0m or [9Xfalse[0m upon success, [9Xfail[0m otherwise.
  
  Checks  if  a simplicial complex [3Xcomplex[0m can be modified by bistellar moves,
  i.  e.  if  it  is  a  pure  simplicial  complex  which  fulfills  the  weak
  pseudomanifold property with empty boundary.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4X gap> c:=SCBdCrossPolytope(3);;[0X
    [4X gap> SCIsMovableComplex(c);[0X
    [4X true[0X
    [4X [0X
  [4X------------------------------------------------------------------[0X
  
  Complex with non-empty boundary:
  
  [4X---------------------------  Example  ----------------------------[0X
    [4X gap> c:=SC([[1,2],[2,3],[3,4],[3,1]]);;[0X
    [4X gap> SCIsMovableComplex(c);[0X
    [4X false[0X
    [4X [0X
  [4X------------------------------------------------------------------[0X
  
  [1X9.2-8 SCMove[0m
  
  [2X> SCMove( [0X[3Xcomplex, move[0X[2X ) ____________________________________________[0Xmethod
  [6XReturns:[0X  simplicial  complex of type [10XSCSimplicialComplex[0m upon success, [9Xfail[0m
            otherwise.
  
  Applies  the  bistellar  move  [3Xmove[0m to a simplicial complex [3Xcomplex[0m. [3Xmove[0m is
  given  as  a (r+1)-tuple together with a (d+1-r)-tuple if d is the dimension
  of  [3Xcomplex[0m  and  if  [3Xmove[0m  is  a r-move. See [2XSCRMoves[0m ([14X9.2-10[0m) for detailed
  information about bistellar r-moves.
  
  Note:  [3Xmove[0m  and  [3Xcomplex[0m  should  be given in standard labeling to ensure a
  correct result.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4X gap> obj:=SC([[1,2],[2,3],[3,4],[4,1]]);[0X
    [4X [SimplicialComplex[0X
    [4X [0X
    [4X  Properties known: Dim, FacetsEx, Name, Vertices.[0X
    [4X [0X
    [4X  Name="unnamed complex 5"[0X
    [4X  Dim=1[0X
    [4X [0X
    [4X /SimplicialComplex][0X
    [4X gap> moves:=SCMoves(obj);[0X
    [4X [ [ [ [ 1, 2 ], [  ] ], [ [ 1, 4 ], [  ] ], [ [ 2, 3 ], [  ] ], [0X
    [4X       [ [ 3, 4 ], [  ] ] ], [0X
    [4X   [ [ [ 1 ], [ 2, 4 ] ], [ [ 2 ], [ 1, 3 ] ], [ [ 3 ], [ 2, 4 ] ], [0X
    [4X       [ [ 4 ], [ 1, 3 ] ] ] ][0X
    [4X gap> obj:=SCMove(obj,last[2][1]);[0X
    [4X [SimplicialComplex[0X
    [4X [0X
    [4X  Properties known: Dim, FacetsEx, Name, NumFaces[], SkelExs[], [0X
    [4X                    Vertices.[0X
    [4X [0X
    [4X  Name="unnamed complex 6"[0X
    [4X  Dim=1[0X
    [4X [0X
    [4X /SimplicialComplex][0X
    [4X [0X
  [4X------------------------------------------------------------------[0X
  
  [1X9.2-9 SCMoves[0m
  
  [2X> SCMoves( [0X[3Xcomplex[0X[2X ) _________________________________________________[0Xmethod
  [6XReturns:[0X  a list of list of pairs of lists upon success, [9Xfail[0m otherwise.
  
  See [2XSCRMoves[0m ([14X9.2-10[0m) for further information.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4X gap> c:=SCBdCrossPolytope(3);;[0X
    [4X gap> moves:=SCMoves(c);[0X
    [4X [ [ [ [ 1, 3, 5 ], [  ] ], [ [ 1, 3, 6 ], [  ] ], [ [ 1, 4, 5 ], [  ] ], [0X
    [4X       [ [ 1, 4, 6 ], [  ] ], [ [ 2, 3, 5 ], [  ] ], [ [ 2, 3, 6 ], [  ] ], [0X
    [4X       [ [ 2, 4, 5 ], [  ] ], [ [ 2, 4, 6 ], [  ] ] ], [0X
    [4X   [ [ [ 1, 3 ], [ 5, 6 ] ], [ [ 1, 4 ], [ 5, 6 ] ], [ [ 1, 5 ], [ 3, 4 ] ], [0X
    [4X       [ [ 1, 6 ], [ 3, 4 ] ], [ [ 2, 3 ], [ 5, 6 ] ], [ [ 2, 4 ], [ 5, 6 ] ], [0X
    [4X       [ [ 2, 5 ], [ 3, 4 ] ], [ [ 2, 6 ], [ 3, 4 ] ], [ [ 3, 5 ], [ 1, 2 ] ], [0X
    [4X       [ [ 3, 6 ], [ 1, 2 ] ], [ [ 4, 5 ], [ 1, 2 ] ], [ [ 4, 6 ], [ 1, 2 ] ] ][0X
    [4X     , [  ] ][0X
    [4X [0X
  [4X------------------------------------------------------------------[0X
  
  [1X9.2-10 SCRMoves[0m
  
  [2X> SCRMoves( [0X[3Xcomplex, r[0X[2X ) _____________________________________________[0Xmethod
  [6XReturns:[0X  a list of pairs of the form [10X[ list, list ][0m, [9Xfail[0m otherwise.
  
  A  bistellar  r-move  of a d-dimensional combinatorial manifold [3Xcomplex[0m is a
  r-face  m_1  together  with  a  d-r-tuple  m_2 where m_1 is a common face of
  exactly (d+1-r) facets and m_2 is not a face of [3Xcomplex[0m.
  
  The  r-move removes all facets containing m_1 and replaces them by the (r+1)
  faces obtained by uniting m_2 with any subset of m_1 of order r.
  
  The resulting complex is PL-homeomorphic to [3Xcomplex[0m.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4X gap> c:=SCBdCrossPolytope(3);;[0X
    [4X gap> moves:=SCRMoves(c,1);[0X
    [4X [ [ [ 1, 3 ], [ 5, 6 ] ], [ [ 1, 4 ], [ 5, 6 ] ], [ [ 1, 5 ], [ 3, 4 ] ], [0X
    [4X   [ [ 1, 6 ], [ 3, 4 ] ], [ [ 2, 3 ], [ 5, 6 ] ], [ [ 2, 4 ], [ 5, 6 ] ], [0X
    [4X   [ [ 2, 5 ], [ 3, 4 ] ], [ [ 2, 6 ], [ 3, 4 ] ], [ [ 3, 5 ], [ 1, 2 ] ], [0X
    [4X   [ [ 3, 6 ], [ 1, 2 ] ], [ [ 4, 5 ], [ 1, 2 ] ], [ [ 4, 6 ], [ 1, 2 ] ] ][0X
    [4X [0X
  [4X------------------------------------------------------------------[0X
  
  [1X9.2-11 SCRandomize[0m
  
  [2X> SCRandomize( [0X[3Xcomplex[[, rounds][, allowedmoves]][0X[2X ) _______________[0Xfunction
  [6XReturns:[0X  a simplicial complex upon success, [9Xfail[0m otherwise.
  
  Randomizes  the  given simplicial complex [3Xcomplex[0m via bistellar moves chosen
  at  random.  By  passing  the optional array [3Xallowedmoves[0m, which has to be a
  dense array of integer values of length [10XSCDim(complex)[0m, certain moves can be
  allowed  or  forbidden  in  the  proccess. An entry [10Xallowedmoves[i]=1[0m allows
  (i-1)-moves  and  an  entry  [10Xallowedmoves[i]=0[0m  forbids  (i-1)-moves  in the
  randomization process.
  
  With  optional positive integer argument [3Xrounds[0m, the amount of randomization
  can  be controlled. The higher the value of [3Xrounds[0m, the more bistellar moves
  will  be  randomly  performed  on  [3Xcomplex[0m.  Note  that  the argument [3Xrounds[0m
  overrides  the  global setting [10XSCBistellarOptions.MaxIntervalRandomize[0m (this
  value   is   used,   if   [3Xrounds[0m   is   not   specified).  Internally  calls
  [2XSCReduceComplexEx[0m ([14X9.2-14[0m).
  
  [4X---------------------------  Example  ----------------------------[0X
    [4X gap> c:=SCRandomize(SCBdSimplex(4));[0X
    [4X [SimplicialComplex[0X
    [4X [0X
    [4X  Properties known: Dim, FacetsEx, Name, Vertices.[0X
    [4X [0X
    [4X  Name="Randomized S^3_5"[0X
    [4X  Dim=3[0X
    [4X [0X
    [4X /SimplicialComplex][0X
    [4X gap> c.F;[0X
    [4X [ 18, 75, 114, 57 ][0X
    [4X [0X
  [4X------------------------------------------------------------------[0X
  
  [1X9.2-12 SCReduceAsSubcomplex[0m
  
  [2X> SCReduceAsSubcomplex( [0X[3Xcomplex1, complex2[0X[2X ) _________________________[0Xmethod
  [6XReturns:[0X  [10XSCBistellarOptions.WriteLevel=0[0m:  a  triple of the form [10X[ boolean,
            simplicial  complex,  rounds  performed  ][0m upon termination of the
            algorithm.
  
            [10XSCBistellarOptions.WriteLevel=1[0m: A library of simplicial complexes
            with  a  number  of  complexes from the reducing process and (upon
            termination)  a  triple of the form [10X[ boolean, simplicial complex,
            rounds performed ][0m.
  
            [10XSCBistellarOptions.WriteLevel=2[0m:  A mail in case a smaller version
            of  [3Xcomplex1[0m  was  found, a library of simplicial complexes with a
            number   of   complexes   from  the  reducing  process  and  (upon
            termination)  a  triple of the form [10X[ boolean, simplicial complex,
            rounds performed ][0m.
  
            Returns [9Xfail[0m upon an error.
  
  Reduces  a  simplicial  complex [3Xcomplex1[0m (satisfying the weak pseudomanifold
  property  with  empty  boundary)  as a sub-complex of the simplicial complex
  [3Xcomplex2[0m.
  
  Main  application:  Reduce  a  sub-complex  of  the  cross  polytope without
  introducing diagonals.
  
  Internally                      calls                      [2XSCReduceComplexEx[0m
  ([14X9.2-14[0m)[10X(complex1,complex2,2,SCIntFunc.SCChooseMove);[0m
  
  [4X---------------------------  Example  ----------------------------[0X
    [4X gap> c:=SCFromFacets([[1,3],[3,5],[4,5],[4,1]]);;[0X
    [4X gap> SCBistellarOptions.WriteLevel:=0;; # do not save complexes                      [0X
    [4X gap> SCReduceAsSubcomplex(c,SCBdCrossPolytope(3));[0X
    [4X [ true, [SimplicialComplex[0X
    [4X     [0X
    [4X      Properties known: Dim, FacetsEx, Name, Vertices.[0X
    [4X     [0X
    [4X      Name="unnamed complex 36"[0X
    [4X      Dim=1[0X
    [4X     [0X
    [4X     /SimplicialComplex], 1 ][0X
  [4X------------------------------------------------------------------[0X
  
  [1X9.2-13 SCReduceComplex[0m
  
  [2X> SCReduceComplex( [0X[3Xcomplex[0X[2X ) _________________________________________[0Xmethod
  [6XReturns:[0X  [10XSCBistellarOptions.WriteLevel=0[0m:  a  triple of the form [10X[ boolean,
            simplicial  complex,  rounds  performed  ][0m upon termination of the
            algorithm.
  
            [10XSCBistellarOptions.WriteLevel=1[0m: A library of simplicial complexes
            with  a  number  of  complexes from the reducing process and (upon
            termination)  a  triple of the form [10X[ boolean, simplicial complex,
            rounds performed ][0m.
  
            [10XSCBistellarOptions.WriteLevel=2[0m:  A mail in case a smaller version
            of  [3Xcomplex1[0m  was  found, a library of simplicial complexes with a
            number   of   complexes   from  the  reducing  process  and  (upon
            termination)  a  triple of the form [10X[ boolean, simplicial complex,
            rounds performed ][0m.
  
            Returns [9Xfail[0m upon an error..
  
  Reduces a pure simplicial complex [3Xcomplex[0m satisfying the weak pseudomanifold
  property   via   bistellar   moves.   Internally   calls   [2XSCReduceComplexEx[0m
  ([14X9.2-14[0m)[10X(complex,SCEmpty(),0,SCIntFunc.SCChooseMove);[0m
  
  [4X---------------------------  Example  ----------------------------[0X
    [4X gap> obj:=SC([[1,2],[2,3],[3,4],[4,5],[5,6],[6,1]]);; # hexagon[0X
    [4X gap> SCBistellarOptions.WriteLevel:=0;; # do not save complexes                      [0X
    [4X gap> SCReduceComplex(obj);[0X
    [4X [ true, [SimplicialComplex[0X
    [4X     [0X
    [4X      Properties known: Dim, FacetsEx, Name, Vertices.[0X
    [4X     [0X
    [4X      Name="unnamed complex 27"[0X
    [4X      Dim=1[0X
    [4X     [0X
    [4X     /SimplicialComplex], 3 ][0X
    [4X ## [0X
  [4X------------------------------------------------------------------[0X
  
  [1X9.2-14 SCReduceComplexEx[0m
  
  [2X> SCReduceComplexEx( [0X[3Xcomplex, refComplex, mode, choosemove[0X[2X ) _______[0Xfunction
  [6XReturns:[0X  [10XSCBistellarOptions.WriteLevel=0[0m:  a  triple of the form [10X[ boolean,
            simplicial complex, rounds ][0m upon termination of the algorithm.
  
            [10XSCBistellarOptions.WriteLevel=1[0m: A library of simplicial complexes
            with  a  number  of  complexes from the reducing process and (upon
            termination)  a  triple of the form [10X[ boolean, simplicial complex,
            rounds ][0m.
  
            [10XSCBistellarOptions.WriteLevel=2[0m:  A mail in case a smaller version
            of  [3Xcomplex1[0m  was  found, a library of simplicial complexes with a
            number   of   complexes   from  the  reducing  process  and  (upon
            termination)  a  triple of the form [10X[ boolean, simplicial complex,
            rounds ][0m.
  
            Returns [9Xfail[0m upon an error.
  
  Reduces a pure simplicial complex [3Xcomplex[0m satisfying the weak pseudomanifold
  property via bistellar moves [3Xmode = 0[0m, compares it to the simplicial complex
  [3XrefComplex[0m  ([3Xmode  = 1[0m) or reduces it as a sub-complex of [3XrefComplex[0m ([3Xmode =
  2[0m).
  
  [3Xchoosemove[0m   is   a   function   containing   a   flip  strategy,  see  also
  [2XSCIntFunc.SCChooseMove[0m ([14X9.2-4[0m).
  
  The  currently  smallest  complex  is stored to the variable [10XminComplex[0m, the
  currently smallest f-vector to [10XminF[0m. Note that in general the algorithm will
  not  stop  until the maximum number of rounds is reached. You can adjust the
  maximum  number  of  rounds via the property [2XSCBistellarOptions[0m ([14X9.2-1[0m). The
  number  of  rounds  performed  is  returned in the third entry of the triple
  returned by this function.
  
  This function is called by
  
  (1)   [2XSCReduceComplex[0m ([14X9.2-13[0m),
  
  (2)   [2XSCEquivalent[0m ([14X9.2-2[0m),
  
  (3)   [2XSCReduceAsSubcomplex[0m ([14X9.2-12[0m),
  
  (4)   [2XSCIsManifold[0m ([14X9.2-6[0m).
  
  (5)   [2XSCRandomize[0m ([14X9.2-11[0m).
  
  Please  see [2XSCMailIsPending[0m ([14X14.2-3[0m) for further information about the email
  notification system in case [10XSCBistellarOptions.WriteLevel[0m is set to 2.
  
  [4X---------------------------  Example  ----------------------------[0X
    [4X gap> c:=SCBdCrossPolytope(4);;[0X
    [4X gap> SCBistellarOptions.WriteLevel:=0;; # do not save complexes                      [0X
    [4X gap> SCReduceComplexEx(c,SCEmpty(),0,SCIntFunc.SCChooseMove);[0X
    [4X [ true, [SimplicialComplex[0X
    [4X     [0X
    [4X      Properties known: Dim, FacetsEx, Name, Vertices.[0X
    [4X     [0X
    [4X      Name="unnamed complex 13"[0X
    [4X      Dim=3[0X
    [4X     [0X
    [4X     /SimplicialComplex], 7 ][0X
    [4X gap> SCReduceComplexEx(c,SCEmpty(),0,SCIntFunc.SCChooseMove);[0X
    [4X [ true, [SimplicialComplex[0X
    [4X     [0X
    [4X      Properties known: Dim, FacetsEx, Name, Vertices.[0X
    [4X     [0X
    [4X      Name="unnamed complex 18"[0X
    [4X      Dim=3[0X
    [4X     [0X
    [4X     /SimplicialComplex], 7 ][0X
    [4X gap> SCMailSetAddress("johndoe@somehost");   [0X
    [4X true[0X
    [4X gap> SCMailIsEnabled();                     [0X
    [4X true[0X
    [4X gap> SCReduceComplexEx(c,SCEmpty(),0,SCIntFunc.SCChooseMove);[0X
    [4X [ true, [SimplicialComplex[0X
    [4X     [0X
    [4X      Properties known: Dim, FacetsEx, Name, Vertices.[0X
    [4X     [0X
    [4X      Name="unnamed complex 23"[0X
    [4X      Dim=3[0X
    [4X     [0X
    [4X     /SimplicialComplex], 7 ][0X
    [4X [0X
  [4X------------------------------------------------------------------[0X
  
  Content of sent mail:
  
  [4X---------------------------  Example  ----------------------------[0X
    [4X Greetings master,[0X
    [4X [0X
    [4X this is simpcomp %%%VERSION%%% running on igt215.mathematik.uni-stuttgart.de[0X
    [4X (Linux igt215 2.6.26-2-amd64 #1 SMP Thu Nov 5 02:23:12 UTC 2009 x86_64[0X
    [4X GNU/Linux), GAP 4.4.12.[0X
    [4X [0X
    [4X I have been working hard for 0 seconds and have a message for you, see below.[0X
    [4X [0X
    [4X #### START MESSAGE ####[0X
    [4X [0X
    [4X SCReduceComplex:[0X
    [4X [0X
    [4X Computed locally minimal complex after 7 rounds:[0X
    [4X [0X
    [4X [SimplicialComplex[0X
    [4X [0X
    [4X  Properties known: Boundary, Chi, Date, Dim, F, Faces, Facets, G, H,[0X
    [4X  HasBoundary, Homology, IsConnected, IsManifold, IsPM, Name, SCVertices,[0X
    [4X  Vertices.[0X
    [4X [0X
    [4X  Name="ReducedComplex_5_vertices_7"[0X
    [4X  Dim=3[0X
    [4X  Chi=0[0X
    [4X  F=[ 5, 10, 10, 5 ][0X
    [4X  G=[ 0, 0 ][0X
    [4X  H=[ 1, 1, 1, 1 ][0X
    [4X  HasBoundary=false[0X
    [4X  Homology=[ [ 0, [ ] ], [ 0, [ ] ], [ 0, [ ] ], [ 1, [ ] ] ][0X
    [4X  IsConnected=true[0X
    [4X  IsPM=true[0X
    [4X [0X
    [4X /SimplicialComplex][0X
    [4X [0X
    [4X ##### END MESSAGE #####[0X
    [4X [0X
    [4X That's all, I hope this is good news! Have a nice day.[0X
    [4X [0X
  [4X------------------------------------------------------------------[0X
  
