Skip to content

Pruning [mp]

Micro pattern

Description

Stop exploring a branch when an invariant proves it cannot yield a new valid result.

Problems

Reject invalid prefixes

Recurse only while the partial result remains completable.

Discard an ordered subtree

Skip a complete subtree using an ordering invariant.

Remove exhausted search branches

Delete search branches that can no longer emit a result.

Ignore nonbeneficial contributions

Clamp a contribution that would worsen every extension.

Bound candidate lengths

Consider only substring lengths present in the dictionary.

Reject impossible moves

Skip transitions barred by current state or known constraints.