Documentation

HexGraphIso.Nauty.Search.Engine

Completion of a sweep, an unwind to a level with an optional short prune, or exhaustion of the recursion bound.

Instances For
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      The five node classifications in nauty's processnode. A better leaf carries the number of adjacency rows shared with the incumbent.

      Instances For
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For

          The search globals, stored in one record so array updates need only consume one constructor. Level and target-cell data are call arguments.

          • lab : Array Nat
          • ptn : Array Nat
          • active : VSet n
          • orbits : Array Nat
          • fixedpts : VSet n
          • autos : Array (VSet n × VSet n)

            nauty's automorphism workspace: stored (fix, mcr) pairs of discovered automorphisms, read by shortprune and longprune. Once wsCap pairs are present the last slot is overwritten instead of a new one being added. wsCap is 500, the number of pairs that fit in the 2 * 500 * m setwords densenauty supplies.

          • wsCap : Nat
          • firstcode : Array Nat
          • canoncode : Array Nat
          • firsttc : Array Int
          • firstlab : Array Nat
          • canonlab : Array Nat
          • canong : Array (VSet n)
          • samerows : Nat
          • compCanon : Int
          • eqlevFirst : Nat
          • eqlevCanon : Int
          • gcaFirst : Nat
          • gcaCanon : Nat
          • canonlevel : Nat
          • noncheaplevel : Nat
          • allsamelevel : Nat
          • cosetindex : Nat
          • stabvertex : Nat
          • numnodes : Nat
          • tctotal : Nat
          • canupdates : Nat
          • numorbits : Nat
          • numgenerators : Nat
          • numbadleaves : Nat
          • maxlevel : Nat
          • genTrace : Array (Array Nat)

            No nauty counterpart: every accepted automorphism kept in full, in discovery order, for the certificate producer, alongside the bounded (fix, mcr) pairs of autos. run discards it.

          • workperm : Array Nat

            Scratch permutation, allocated at initialization and filled by leaf comparisons.

          Instances For
            def Hex.GraphIso.Nauty.Engine.pushAuto {n : Nat} (st : Search n) (pair : VSet n × VSet n) :

            Record an automorphism pair in the bounded workspace. This is Hex.GraphIso.Nauty.pushAuto on the flat engine state.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              @[inline]
              def Hex.GraphIso.Nauty.Engine.visit {n : Nat} (ctx : Ctx n) (level numcells : Nat) (st : Search n) :

              Count and refine a node before comparing its refinement code.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                @[inline]
                def Hex.GraphIso.Nauty.Engine.recordFirst {n : Nat} (level refcode : Nat) (st : Search n) :

                Record the refinement code on the first path.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  def Hex.GraphIso.Nauty.Engine.compareCodes {n : Nat} (level code : Nat) (st : Search n) :

                  The comparison bookkeeping of nauty's othernode between the refinement and the target-cell choice: the first-path level-code comparison and the best-so-far level-code comparison.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    @[inline]
                    def Hex.GraphIso.Nauty.Engine.chooseTarget {n : Nat} (first : Bool) (ctx : Ctx n) (tcLevel level numcells : Nat) (st : Search n) :

                    Choose a target cell exactly when children can be required. Only a canonically smaller off-path node uses the first path's target hint.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For

                      nauty's firstterminal: install the first leaf as both the first-path data and the initial best-so-far leaf. This retains the updates of Hex.GraphIso.Nauty.firstterminal.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        @[inline]
                        def Hex.GraphIso.Nauty.Engine.scatter {n : Nat} (refLab : Array Nat) (st : Search n) :

                        Scatter the current labelling through a reference labelling. Detach the scratch field while filling it so each element update consumes just the array, rather than reconstructing the search record.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          def Hex.GraphIso.Nauty.Engine.classify {n : Nat} (ctx : Ctx n) (level numcells : Nat) (st : Search n) :

                          Classify an off-path node, constructing its permutation in the scratch array and comparing canonical rows only after tied levels.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            @[inline]

                            Record a permutation and its workspace pair, then join its orbits. The caller decides whether it counts as a new generator.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For
                              @[inline]
                              def Hex.GraphIso.Nauty.Engine.install {n : Nat} (level sr : Nat) (st : Search n) :

                              Install a better leaf, retaining its already compared row prefix.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For

                                Return past a bad or newly installed leaf. The all-same level limits the return, and the noncheap level can extend it.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  def Hex.GraphIso.Nauty.Engine.leafExit {n : Nat} (leaf : Leaf) (level : Nat) (st : Search n) :

                                  Act on the five classifications. Code 2 without an orbit change still records its permutation and requests a short prune when needed.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    @[inline]
                                    def Hex.GraphIso.Nauty.Engine.cheapCheck {n : Nat} (first : Bool) (level : Nat) (st : Search n) :

                                    Update the deepest noncheap level before descending.

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      @[inline]
                                      def Hex.GraphIso.Nauty.Engine.child {n : Nat} (first : Bool) (level tc tv : Nat) (st : Search n) :

                                      Individualize a child vertex, recording every first-path coset index.

                                      Equations
                                      • One or more equations did not get rendered due to their size.
                                      Instances For
                                        @[inline]
                                        def Hex.GraphIso.Nauty.Engine.afterChildFirst {n : Nat} (level tv1 : Nat) (st : Search n) :

                                        After the leftmost child, record its greatest common ancestor and the vertex fixed by the generators subsequently reported there.

                                        Equations
                                        • One or more equations did not get rendered due to their size.
                                        Instances For
                                          @[inline]
                                          def Hex.GraphIso.Nauty.Engine.afterSweep {n : Nat} (first : Bool) (level tcellsize index : Nat) (st : Search n) :

                                          Decrement the all-same level only after a complete first-path sweep.

                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For
                                            @[inline]
                                            def Hex.GraphIso.Nauty.Engine.recoverPtn {n : Nat} (inf level : Nat) (st : Search n) :

                                            Reopen the partition below the receiving level, as in the rescan of Hex.GraphIso.Nauty.recover.

                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            Instances For
                                              @[inline]

                                              Clamp the four level counters in the order of Hex.GraphIso.Nauty.recover. Equality in the last clamp resets the comparison with the canonical code.

                                              Equations
                                              • One or more equations did not get rendered due to their size.
                                              Instances For
                                                @[inline]
                                                def Hex.GraphIso.Nauty.Engine.shortprune {n : Nat} (tcell : VSet n) (st : Search n) :

                                                Intersect with the most recently written workspace pair, as in Hex.GraphIso.Nauty.shortprune.

                                                Equations
                                                Instances For
                                                  @[irreducible]
                                                  def Hex.GraphIso.Nauty.Engine.node {n : Nat} (first : Bool) (ctx : Ctx n) (inf tcLevel fuel level numcells : Nat) (st : Search n) :

                                                  Refine a node, classify it, and sweep its surviving children. Only the leftmost child of a first-path node remains on the first path.

                                                  Equations
                                                  Instances For
                                                    @[irreducible]
                                                    def Hex.GraphIso.Nauty.Engine.sweep {n : Nat} (first : Bool) (ctx : Ctx n) (inf tcLevel fuel cfuel level numcells tc tv1 : Nat) (tv? : Option Nat) (tcell : VSet n) (index : Nat) (st : Search n) :

                                                    Visit remaining target vertices in order, rereading the cell after each prune. The orbit index includes skipped vertices on the first path. Nodes return an unwind or fuel, so the done arm after a child is unreachable.

                                                    Equations
                                                    Instances For
                                                      def Hex.GraphIso.Nauty.Engine.initial (n : Nat) (lab0 : Array Nat) (cellEnds : List Nat) :

                                                      Allocate the search globals, including the reusable permutation.

                                                      Equations
                                                      • One or more equations did not get rendered due to their size.
                                                      Instances For
                                                        def Hex.GraphIso.Nauty.Engine.runState (n : Nat) (g : Array (VSet n)) (lab0 : Array Nat) (cellEnds : List Nat) :

                                                        Run the search and retain the final state and exit for diagnostics. On a valid nonempty input, cell count is at least the level: refinement never decreases it and each child increases it. Thus node depth is at most n, so node fuel n + 2 suffices. A sweep visits at most n vertices in strictly increasing order, so sweep fuel n + 1 suffices.

                                                        Equations
                                                        • One or more equations did not get rendered due to their size.
                                                        Instances For
                                                          def Hex.GraphIso.Nauty.Engine.finish {n : Nat} (ctx : Ctx n) (st : Search n) :

                                                          Read the canonical result and trace, updating the remaining rows.

                                                          Equations
                                                          • One or more equations did not get rendered due to their size.
                                                          Instances For
                                                            def Hex.GraphIso.Nauty.Engine.runTraced (n : Nat) (g : Array (VSet n)) (lab0 : Array Nat) (cellEnds : List Nat) :

                                                            Run the structured search with the certificate producer's result type.

                                                            Equations
                                                            Instances For
                                                              def Hex.GraphIso.Nauty.Engine.run (n : Nat) (g : Array (VSet n)) (lab0 : Array Nat) (cellEnds : List Nat) :

                                                              Run the structured search, discarding the trace.

                                                              Equations
                                                              Instances For

                                                                Run the structured search on a coloured graph, retaining the trace.

                                                                Equations
                                                                • One or more equations did not get rendered due to their size.
                                                                Instances For

                                                                  Run the structured search on a coloured graph.

                                                                  Equations
                                                                  Instances For