Branch-and-bound maximum of the incumbent and this subtree's keys,
expressed at this node's depth. The incumbent prunes children whose
refinement code falls below its code here. Untrusted: results are
validated by checkKey.
Equations
Instances For
theorem
Hex.GraphIso.Nauty.searchNode_eq
{n : Nat}
(ctx : Ctx n)
(tcLevel fuel level : Nat)
(lab ptn : Array Nat)
(active : VSet n)
(numcells : Nat)
(inc : Option (Key n))
:
searchNode ctx tcLevel fuel level lab ptn active numcells inc = incMax inc (specNode ctx tcLevel fuel level lab ptn active numcells)
The pruned branch-and-bound recursion computes exactly the maximum of the incumbent and the unpruned subtree key: the code prune is lossless. No side conditions.
theorem
Hex.GraphIso.Nauty.searchFold_eq
{n : Nat}
(ctx : Ctx n)
(tcLevel fuel level : Nat)
(rsLab rsPtn : Array Nat)
(tc numcells : Nat)
(os : List Nat)
(t : Key n)
:
List.foldl
(fun (acc : Option (Key n)) (o : Nat) =>
some
(searchNode ctx tcLevel fuel (level + 1) (breakout n rsLab rsPtn (level + 1) tc rsLab[tc + o]!).fst
(breakout n rsLab rsPtn (level + 1) tc rsLab[tc + o]!).snd.fst
(breakout n rsLab rsPtn (level + 1) tc rsLab[tc + o]!).snd.snd (numcells + 1) acc))
(some t) os = some (keysMax t (List.map (childKey ctx tcLevel fuel level rsLab rsPtn tc numcells) os))
The child sweep from a present accumulator: folding the pruned child searches computes the running key maximum over the unpruned child keys.
theorem
Hex.GraphIso.Nauty.searchFold_cons
{n : Nat}
(ctx : Ctx n)
(tcLevel fuel level : Nat)
(rsLab rsPtn : Array Nat)
(tc numcells o : Nat)
(os : List Nat)
(tail0 : Option (Key n))
:
List.foldl
(fun (acc : Option (Key n)) (o : Nat) =>
some
(searchNode ctx tcLevel fuel (level + 1) (breakout n rsLab rsPtn (level + 1) tc rsLab[tc + o]!).fst
(breakout n rsLab rsPtn (level + 1) tc rsLab[tc + o]!).snd.fst
(breakout n rsLab rsPtn (level + 1) tc rsLab[tc + o]!).snd.snd (numcells + 1) acc))
tail0 (o :: os) = some
(incMax tail0
(keysMax (childKey ctx tcLevel fuel level rsLab rsPtn tc numcells o)
(List.map (childKey ctx tcLevel fuel level rsLab rsPtn tc numcells) os)))
One unfolding of the child sweep from an arbitrary accumulator: the first child absorbs the incumbent, the rest fold from its result.
The pruned search computes the nauty-semantic canonical key.