SPR function

Subtree pruning and rearrangement (SPR)