Algorithm 1
From: Median quartet tree search algorithms using optimal subtree prune and regraft

Solution to the Q-SPR problem. \(d_u\) is the degree of u.
From: Median quartet tree search algorithms using optimal subtree prune and regraft
Solution to the Q-SPR problem. \(d_u\) is the degree of u.