Perform a reordering.
Perform a reordering.
This method takes two nodes (n1
and n2
), as well as two
functions:
f
: function from node to identifying annotationg
: function from two nodes to a combined resultThe f
function is used in cases where sorting or weighting is
necessary (in those cases A will be a weight or similar). The g
function is used to recurse on the result -- i.e. the possibly
reordered nodes n1
and n2
will be passed to g
after the
reordering occurs.
Seed a reorder instance with a stable identifier.
Seed a reorder instance with a stable identifier.
This ensures that reorders which are non-deterministic in general (e.g. shuffled) will produce the same reordering for the same seed across many traversals.
On deterministic reorders this method is a noop.