Extremal Distances for Subtree Transfer Operations in Binary Trees

Three standard subtree transfer operations for binary trees, used in particular for phylogenetic trees, are: tree bisection and reconnection ($TBR$), subtree prune and regraft ($SPR$) and rooted subtree prune and regraft ($rSPR$). For a pair of leaf-labelled binary trees with $n$ leaves, the maximum number of such moves required to transform one into the other is $n-\Theta(\sqrt{n})$, extending a result of Ding, Grunewald and Humphries. We show that if the pair is chosen uniformly at random, then the expected number of moves required to transfer one into the other is $n-\Theta(n^{2/3})$. These results may be phrased in terms of agreement forests: we also give extensions for more than two binary trees.


Introduction
A standard way to transform one binary tree into another is by performing 'subtree-prune-and-regraft' (SP R) moves (definitions are given below).These operations are of particular interest for phylogenetic trees.For a pair of binary trees with n + 1 labelled leaves (including the root), it was shown by Allen and Steele [2] in 2001 that the maximum number of SP R moves required to change one into the other, D SP R (n), is between n 2 − o(n) and n − 2. Martin and Thatte [10] show the existence of a common subtree of size Ω( √ log n), which brings the upper-bound for D SP R (n) down to n − Ω( √ log n).Ding, Grunewald and Humphries [4] show that D SP R (n) is actually n − Θ( √ n).We give an extended version of this result for the rooted and unrooted cases.We also show that if one of the trees is fixed arbitrarily and the other is chosen to maximise the number of SPR moves required to turn one into the other, then still n − Θ( √ n) moves are required.We prove the last result by showing that for a fixed pair of binary trees, we can label the leaves in such a way that n − Θ( √ n) moves are required to turn one into the other.This result is set in a more general context of agreement forests for sets of k ≥ 2 trees.We also show that if two trees chosen independently, uniformly at random, then the expected number of moves required to transform one into the other is n − Θ(n 2/3 ) [Theorem 1 .11].
Subtree transfer operations are subtly different when acting on rooted trees as opposed to unrooted trees.Some papers have considered SP R and rSP R moves as acting on different classes of binary tree.We give a unified treatment here; when dealing with rooted-subtree-prune-and-regraft (rSP R) moves, we insist that one of the leaf-labels be 0, and this leaf acts effectively as the root of the tree.We insist that the root has degree 1 and it behaves in exactly the same manner as the other leaves for SP R and T BR moves.6 The TBR operation.
In the subsections below we define binary trees, the three subtree transfer operations T BR, SP R and rSP R, and the corresponding metrics they induce over the class of binary trees.
1.1.Binary Trees Definition 1.1.Let X be a non-empty, finite set.If |X| > 1, then a binary leaf-labelled tree with leaf-label set X is a finite tree which has 2 types of vertex: • tree vertices of degree 3, and • leaf vertices of degree 1, labelled with the set X (there is a bijection between the leaves and X).If 0 ∈ X, the leaf labelled 0 is called the root of the tree.In the trivial case, when X = {α} is a singleton, then the trivial graph containing only one vertex, labelled α, is considered to be a binary leaf-labelled tree, and its vertex is called a leaf.
Let B(X) be the set of all binary leaf-labelled trees, with label set X.For a leaf-labelled tree A, let L(A) denote the label set of A; so if A ∈ B(X) then L(A) = X.For trees T and T ′ in B(X), we say T is isomorphic to T ′ (denoted T ≡ T ′ ) if there is a graph isomorphism preserving leaf labels; if there is a bijection ψ : V (T ) → V (T ′ ) such that uv is an edge in T if and only if ψ(x)ψ(y) is an edge in T ′ and for each leaf v of T , v and ψ(v) are labelled with the same element of X.For non-empty S ⊆ L(A), let A|S be the minimal subtree of A that contains all the leaves with labels in S. Let A/S be the tree formed by suppressing any vertices of degree 2 from A|S.So A|S is a subgraph of A and A/S ∈ B(S).
In this paper, X will usually be {0,

Tree Bisection and Reconnection
Definition 1.2.A tree-bisection-and-reconnection (TBR) on a tree T ∈ B(X), for |X| ≥ 3, is a two step process: 3. The SPR move 1. (bisection step) Delete an edge e from T (this edge is called the bisection edge) and then suppress all degree 2 vertices (the edges created by these suppressions are called new edges) to obtain a pair T 1 , T 2 of binary trees with L(T 1 ) ⊔ L(T 2 ) = X.(The number of new edges is 2, unless the bisection edge was incident with a leaf.In the later case, there is only one new edge and either T 1 or T 2 is an isolated vertex.) 2. (reconnection step) Connect T 1 and T 2 by creating an edge between the midpoint of an edge in T 1 and the midpoint of an edge in T 2 .This edge is called the reconnecting edge.(In the case that T 1 or T 2 is an isolated vertex, instead the reconnecting edge is incident to this vertex.) See Figure 2: on the left the bisection edge is blue and the green edges will form the new edges, and on the right the blue edge is the reconnection edge and the green edges are the new edges.
If A ∈ B(X), and B is the result of performing a TBR on A, then B ∈ B(X) because B must be connected, acyclic, and all non-leaf vertices have degree 3. Proof.If f is a TBR which transforms A into B, then we can find a TBR, f −1 which transforms B into A using the following construction.Firstly use the reconnecting edge of f as the bisection edge of f −1 .The two components formed will be identical to the two components formed when the bisection step of f was performed.If f had two new edges, then we can let the reconnecting edge of f −1 be an edge between the midpoints of these edges.If f had one new edge then one part, say T 2 must be an isolated vertex v, and so we can let the reconnecting edge of f −1 be an edge between v and the midpoint of the edge in T 1 which was the new edge of f .

Subtree Prune and Regraft
The SPR move (Definition 1.5) is an operation on binary trees whereby a subtree is removed from one part of the tree and regrafted to another part of the tree.SPR moves feature in many papers, see for example: [2] and [3].These SPR moves are widely used by tree-searching software packages, like PAUP [12] and Garli [13], used in phylogenetic research.Definition 1.5.A subtree-prune-and-regraft (SPR) move taking xy from ab to cd is an operation which can be performed on a tree T ∈ B(X), as long as xy, ax, xb, cd are distinct edges (vertices a, b, c, d need not be distinct; possibly a = c, b = c, a = d or b = d) and the path from c to y contains x.A SPR move is a two step process: • (prune step) delete edges ax, xb and replace them with ab, then • (regraft step) delete edge cd and replace it with cx and xd.Let SPR = SPR(X) denote the set of pairs (A, B) such that A ∈ B(X) and B is the result of a SPR move on A. If 0 ∈ X and the path from 0 to y passes through x, then this is called a rooted-subtreeprune-and-regraft (rSPR) move.Let rSPR denote the set of pairs (A, B) such that B is the result of an rSPR move on A.
See Figure 3.By definition, an rSPR move is a special case of a SPR move.It is not difficult to check that a SPR move is a special case of a TBR move.Informally, a SPR move is any TBR move Trees that differ by a single SPR, but at least n−3 2 rSPR moves.
in which one of T 1 or T 2 is an isolated vertex or one of the endpoints of the reconnecting edge is the midpoint of one of the new edges.Therefore any valid SPR move performed on a binary tree in B(X) will result in a tree in B(X), and moreover: If we think of the edges as being oriented away from the root, then an rSPR move is any SPR move that preserves these orientations.
Proof.Suppose that we start with a tree A and perform the SPR move (or similarly the rSPR move) taking xy from ab to cd, and thus obtain B. Then starting at B, we can perform the 'inverse' SPR move (or rSPR move) taking xy from cd to ab, and thus we obtain A.
Not all SPR moves can be achieved with a single rSPR move.Indeed, we may need an arbitrary number of rSPR moves to simulate one SPR move.For example the trees in Figure 4 differ by a single SPR by pruning off the single leaf labelled 0, and then regrafting it appropriately.In Example 2 we will show that at least n−3 2 rSPR moves are required to transform one into the other.The following proposition is Lemma 2.7 (2b) in [2].
Proposition 1.7.Any TBR move can be achieved using at most 2 SPRs; if (A, B) ∈ T BR, then there exists some C such that (A, C), (C, B) ∈ SPR.

Tree Metrics
The SP R-distance (Definition 1.8) has been the subject of several publications, for example [2], [6], [7].The problem of determining the rSPR-distance between a pair of trees was shown to be N P -hard by Bordewich and Semple [3] in 2005.We shall see later, that all of the values in the following definition are finite.Definition 1.8.For A, B ∈ B(X) and any subtree transfer operation χ ∈ {T BR, SP R, rSP R}, define the χ-distance between A and B (denoted d χ (A, B)), to be the minimum number of χ moves required to change A into B. When discussing rSPR moves, we assume 0 ∈ X.By Propositions 1.4 and 1.6, this distance is symmetric.For n ≥ 1 and and moreover, let R χ (n) denote the χ-radius of the class B(X); The following is an immediate consequence of rSPR ⊆ SPR ⊆ T BR.
Small values of the radius and diameter Proposition 1.9.For any χ ∈ {T BR, SP R, rSP R}, and any integer n > 1, we have Moreover,

Main Theorems
The values of the radius and diameter for n ≤ 6 are given in Figure 5.The asymptotic values of the radius and diameter are given in the following theorem.
By Observation 1.9, it suffices to give an upper bound for the rSPR-diameter and a lower bound for the TBR-radius, both of the form n − Θ( √ n).These bounds are given explicitly in Lemmas 2.5 and 4.5 respectively.Theorem 1.11.If A and B are chosen uniformly at random from B([n] ∪ {0}), then for any χ ∈ {T BR, SP R, rSP R}.
Again by Observation 1.9, it suffices to give an upper bound for the expected rSPR-distance and a lower bound for the expected TBR-distance, both of the form n − Θ(n 2/3 ).These bounds are given explicitly in Lemmas 3.1 and 5.1 respectively.

Upper Bound for the rSPR Diameter
The upper-bound in Theorem 1.10 is proved in this section using rooted agreement forests.The definition of a rooted agreement forest given here is equivalent to that used by Bordewich and Semple [3].Definition 2.1.Let 0 ∈ X, and let A ⊂ B(X) be a set of k ≥ 2 trees.A rooted agreement forest of A is a partition L 1 , . . ., L m of X, such that for all A, B ∈ A: • the subtrees A|L 1 , A|L 2 , . . ., A|L m are disjoint, and ) for j = 1, . . ., m.Let M r (A) be the minimal possible value of m; the minimal number of parts in a rooted agreement forest of A. When k = 2, we write M r (A, B) for M r ({A, B}).
The following result is proved by Bordewich and Semple [3], building on the work of Hein et al [8].We give a proof here for completeness.Lemma 2.2 (Rooted Agreement Forest Lemma).If A and B are any two trees in B(X), then Figure 6.Three minimal rooted agreement forests.
If we perform all the prunes of these rSPR moves (and none of the regrafts), then the result will be a partition of the leaves into a valid (rooted) agreement forest for A and B. Therefore Now we will show that d rSP R (A, B) + 1 ≤ M r (A, B), by induction on m := M r (A, B).For the base case m = 1, the only agreement forest with one component would be A = B itself, thence d rSP R (A, B) = 0.For the inductive step m ≥ 2, it suffices to show that there exists some . ., L m ) be an agreement forest for (A, B) of m ≥ 2 parts and wlog 0 ∈ L 1 .We can construct A ′ from F explicitly: • Wlog B|L 2 is one of the subtrees of B that is connected to B|L 1 by a path p B , which does not intersect B|L i for any i > 2.
• Let e = yx ∈ E(A) be the first edge on the path p A from A|L 2 to A|L 1 , where y is in A|L 2 and x is not.If x is a leaf (i.e. if L 1 = {0} and x = 0 is the root) then we do not perform an rSPR move.Otherwise x is a tree vertex.Let a and b be the two neighbours of x other than y.• Now we can prune A at e (that is, take xy from its current position on ab) and then regraft it to form A ′ such that In the case that L 1 = {0} is a singleton, this involves regrafting at the only edge incident with the root of A. Otherwise (if |L 1 | ≥ 2) this involves regrafting at an internal edge of A|L 1 corresponding to where the path p B joins B|L 1 .
We know that {L 1 ∪ L 2 , L 3 , L 4 , . . ., L m } is an agreement forest for (A ′ , B), because of for all i > 2: The rSPR-distance between a pair of trees is often used as a measure of the discrepancy between a pair of binary trees.So M r (A) can be seen as generalisation of this notion from pairs of trees to arbitrary large sets of trees.
Example.Let A and B be the two caterpillar trees in Figure 4, which differ only by a single SPR changing the location of the root.The other leaves in A are ordered in the usual (1, 2, 3, . . .n) order from the root, while in B they are in the reverse order.We will show here that M r (A, B) . The construction in Lemma 2.2.
To show M r (A, B) ≥ n−1 2 , notice that A/{0, a, b, c} is never isomorphic to B/{0, a, b, c} because the leaf neasrest to 0 in A/{0, a, b, c} is the smallest of {a, b, c} while the leaf nearest to 0 in B/{0, a, b, c} is the largest.Therefore if {L 1 , L 2 , . . ., L m } is a rooted agreement forest for {A, B}, with 0 ∈ L 1 , then |L 1 | ≤ 3 and |L i | ≤ 2 for all i > 1.So n ≤ 3 + 2(m − 1) and therefore m ≥ n−1 2 .The next two lemmas provide an explicit construction to find an agreement forest for arbitrary A ⊆ B(X).
Lemma 2.3.Let |X| = n + 1, let T ∈ B(X) be a binary tree with a root and let a ∈ (1, 2n] be a real number.It is possible to remove a single edge from T , so that the number of leaves in the component not containing the root is in the interval a 2 , a . Proof.Wlog let 0 ∈ X be the root.For each vertex x ∈ T let π(x) be the set of leaves y such that x is on the path between 0 and y.For every non-leaf vertex p, where c 1 , c 2 ∈ Γ(p) are the neighbours of p which are not on the path from p to the root.Moreover, if v is a leaf then |π(v)| = 1 (unless v = 0, in which case π(v) = X).Therefore, for each tree-node v i , there exists a neighbour v i+1 such that A subdivision of a tree into 3 disjoint subtrees, each with 3 leaves.Now construct a path (v 0 , v 1 , . . ., v m ), such that v 0 is the root, v 1 is the neighbour of the root and equation (2.1) holds for each i = 1, 2, . . ., m − 1.This sequence terminates when v m is a leaf.So the sequence decreases from and never decreases by a factor less than 1 2 in a single step.Hence there must be some 1 If edge v j v j−1 is deleted, then π(v j ) is precisely the set of leaves in the component containing v j .
and let a be a real number greater than 1.It is possible to divide T into disjoint subtrees such that each leaf lies in a subtree, each subtree contains less than a leaves and at most one subtree contains less than a 2 leaves.Proof.(by induction) The case a > n + 1 is trivial.If n + 1 ≥ a, we can use Lemma 2.3 iteratively to prune off subtrees with less than a (but at least a 2 ) leaves until the remaining tree has less than a leaves left (this remainder might have less than a 2 leaves).

Proof. (by construction) Divide each
k+1 (possibly empty) disjoint connected parts, such that each part contains less than 2(n+1) t leaves.This is possible by letting a = 2(n+1) t in Lemma 2.4.Now, let us define a token to be any map τ : [k] → [t].For any token τ , define and We say that τ is good if I(τ ) ≥ 2, and we say a pair τ, τ ′ is compatible if τ (i) = τ ′ (i) for all i.Now if T is a set of pairwise compatible, good tokens, then we can construct an agreement forest of n − |T | + 1 parts in the following manner: • for each τ ∈ T , construct a part of size 2 using labels in I(τ ), • all other labels are put in their own part of size 1. 0 . Super pairs lie in differed subtrees A i .
The paths between labels in each part of this partition will be disjoint because the tokens are compatible.Hence this is a valid agreement forest.Now let T be any maximal set of compatible good tokens (i.e.every good token that is not in T is incompatible with a token in T ).Then for each label x ∈ X either x ∈ I(σ) for some non-good token σ, or x ∈ U (τ ) for some τ ∈ T .So let us count: • there are n + 1 labels in total, • at most t k non-good tokens, each with at most 1 label in I(σ), and • less than ka labels in U (τ ) for each token τ ∈ T .
Since the above inequality is strict and t, k are both integers, we can tighten the bound to: Setting k = 2 in Lemma 2.5 and then applying the rooted agreement forest lemma (2.2) gives which yields a suitable upper bound in Theorem 1.10.

Upper Bound for the Expectation
The upper bound in Theorem 1.11 is established in this section.In fact Lemma 3.1 is stronger because the underlying unlabelled trees are not chosen randomly.
Lemma 3.1.Let k ≥ 2 be a fixed integer.Let X = [n] ∪ {0} and let T be an arbitrary set of k trees in B(X).If A is obtained by performing a permutation of the leaf-labels of each T ∈ T (the permutations are chosen independently and uniformly at random), then as n → ∞.
Proof.Set b = k+1 kn k−1 2 and s = n+1 2b .Now for each T ∈ T , let T 1 , T 2 , . . ., T s be disjoint subtrees of T such that the number of leaves in each T i is exactly b.This is possible by Lemma 2.4 (set a = 2b) and taking subtrees as necessary.Let A ∈ A be the tree obtained by the random labelling of T , and let A 1 , A 2 , . . ., A s be the subtrees of A corresponding to T 1 , T 2 , . . ., T s respectively.Call {x 1 , . . ., x j } ⊆ X a good set if for each A ∈ A, the leaves labelled x 1 , . . ., x j all lie in the same A i .We say that a good pair of distinct labels {x 1 , x 2 } is spoiled if for some A ∈ A, there is another good pair {x 3 , x 4 } in the same subtree A i of A as x 1 and x 2 .We call a pair super if it is good but not spoiled.We have Since {x 1 , x 2 , x 3 } being good if and only if {x 1 , x 2 } and {x 1 , x 3 } are both good, we can see that Now fix a good pair {x 1 , x 2 } with {x 1 , x 2 } ⊆ L(A i ) for some A ∈ A. If x 3 and x 4 are chosen from L(A i ) \ {x 1 , x 2 }, we compute an upper bound on the probability that {x 3 , x 4 } is a good pair.For each Now let Y denote the set of all pairs {y 1 , y 2 } distinct from {x 1 , x 2 }, which lie in the same A i as {x 1 , x 2 } for some A ∈ A. Using the union bound, the probability that {x 1 , x 2 } is super is bounded below by where the sum ranges over all {y 1 , y 2 } ∈ Y .There are at most k b−2 2 such pairs with {x 1 , x 2 } ∩ {y 1 , y 2 } = ∅, and at most 2k(b − 2) such pairs with |{x 1 , x 2 } ∩ {y 1 , y 2 }| = 1.Substituting Equations (3.1) and (3.2) into (3.3)yields the lower bound were chosen so that the factors in the above expression are positive and so this bound is Ω n −2k/(k+1) .Therefore, if S is the number of super pairs, then Now let us partition the labels such that each super pair forms a part of size two (super pairs are disjoint by definition), and all other labels are in individual parts.This partition is a valid agreement forest, because if x and y are any super pairs, then for any A ∈ A we know that A|x is contained within A i and A|y is contained within A j for some i = j.Hence M r (A) ≤ n + 1 − S and so The construction in Lemma 4.2.
Step 2:.Now arbitrarily choose a pair of parts L x and L y , such that A|L x lies in A 1 and A|L y lies in A 2 .Let p B be the path in B from a vertex in B|L x to a vertex in B|L y .
Step 3:.Let v 1 be the last vertex on p B which lies in a part B|L 1 (not necessarily distinct from B|L x ) such that A|L 1 lies in A 1 .Let v 2 be first vertex after v 1 in p B which lies in a part B|L 2 (not necessarily distinct from B|L y ).By definition, A|L 2 must lie in A 2 (see Figure 12).So the path between v 1 and v 2 has no vertices in any B|L i except for its endpoints.Now v 1 corresponds to the midpoint of an edge in B/L 1 ∼ = A/L 1 , which in turn corresponds to a path p 1 in A 1 (or else x = 1 and L 1 is a singleton).Similarly v 2 corresponds to a p 2 in A 2 (or L 2 = {v 2 }).
Step 4:.Construct A ′ to be the reconnection of A 1 and A 2 by an edge between the midpoint of an edge in p 1 and the midpoint of an edge in p 2 (if L 1 or L 2 is a singleton, then simply use its vertex as the endpoint of the reconnecting edge).By construction, (A, A ′ ) ∈ T BR because we constructed A ′ by performing a TBR move on A. Moreover We now present a result concerning permutations (Lemma 4.3) and a property of A that guarantees large M (A) (Lemma 4.4).These two Lemmas are the two crucial steps required for the proof of the main result of this section (Lemma 4.5).√ n + 1, let X = {0, 1, . . ., n}.There exist k permutations {φ j : X → X} k j=1 such that for any distinct x, y ∈ X there exists some i such that Proof.(by construction) Represent each x ∈ X by the k-tuple (x 1 , x 2 , . . ., x k ) of non-negative integers such that then this is exactly representing x in base b.For larger x, we allow the coefficient of b k−1 to exceed b − 1.Now let φ 1 be the identity permutation, and for each 1 < j ≤ k we define φ j so that φ j (x) > φ j (y) iff x j < y j or x j = y j and x > y.
See Figure 13 for an illustration.If d j = x j − y j then for i ≥ 2 and φ i (x) > φ i (y) (i.e.d i ≤ 0) we have This is an equality when n + 1 = b k (i.e. when n + 1 is a perfect k th power), and increasing n can only increase the number of labels z such that φ i (z) is between φ i (x) and φ i (y).Now we fix distinct x, y ∈ X and wlog x 1 ≥ y 1 .There are four cases:   2. x 1 = y 1 3. x 1 > y 1 and x i ≥ y i for all i. 4. x 1 > y 1 and x j < y j for some j ≥ 2.
We treat each of these cases separately.
Case 1:.All z such that z i = min(x i , y i ) + 1 must have φ i (z) between φ i (x) and φ i (y).There are at least b k−1 such z.
Case 2:.Wlog d i = −1 and d j = 0 for j < i for some i ≥ 2. Subbing this into equation (4.1) yields Case 4:.We have d 1 = 1 and there is some i ≥ 2, d i = −1 and d j ≥ 0 for all j < i. Substituting this into equation (4.1) yields Lemma 4.4.Let n, k, t be positive integers, let X = {0, 1, . . ., n} and let A ⊆ B(X) be a set of k trees.For each • be a partition of the vertices of A into at most t connected parts.If for all but z pairs of distinct labels x, y ∈ X there is at least one A ∈ A such that the leaves labelled with x and y are in different parts of A, then be a forest with leaves labelled by X for some A ∈ A (by definition 4.1 it doesn't matter which A ∈ A we choose).Each tree A ∈ A can be divided into the forest • by deleting at most t − 1 edges.Let these edges be called hot edges.There is a total of at most k(t − 1) hot edges (at most t − 1 in each A ∈ A).An edge in A might not correspond to any edge in F , moreover there many be several edges that correspond to the same edge in F .In any case, each hot edge corresponds to at most one edge in F .Therefore if we delete all the edges in F corresponding to hot edges, then we delete at most k(t − 1) edges.
The result of the deletion of these edges would be a forest of at least |X| − z components because z is an upper bound on the number of pairs of leaves in the same component.Therefore F must have had m ≥ n + 1 − z − k(t − 1) components.
For constant k, one can easily observe that t ∼ 2 k √ n as n → ∞.For an explicit bound (using n ≥ (3k) k ), we can show t ≤ 3 k √ n + 1, in the following manner: If A ′ = {A ′ 1 , . . ., A ′ k } is obtained from A by a permutation, π, of the labels (i.e.The leaf labeled x in A i is labelled π(x) in A ′ i for all x ∈ X and all i ∈ [k]) then M (A ′ ) = M (A).Therefore in the above Lemma, we could have constructed A so that one of the trees has a particular labelling, say A 1 .Now if we set k = 2 and apply the unrooted agreement forest lemma (4.2) then for all integers n ≥ 36. 2 This is a suitable lower bound for Theorem 1.10.Proof.First set a = (n + 1)
Then, using Lemma 2.4, divide each A i into t (possibly empty) connected parts, so that each part has less than a leaves: For distinct x, y ∈ X, notice that Now let Z be the set of pairs of distinct labels {x, y} such that for each i, x and y are in the same part A ij .Explicitly Z := {x, y} : x = y and ∀i ∃j s.t.x, y ∈ L(A ij ) .which is a suitable lower bound for Theorem 1.11.

Definition 1 . 3 .
Let T BR = T BR(X) denote the set of pairs (A, B) ∈ B(X) 2 such that B can be obtained from A by performing a single TBR move.Proposition 1.4.(A, B) ∈ T BR if and only if (B, A) ∈ T BR.
which (by the inductive hypothesis) means that d rSP R (A ′ , B) ≤ m − 2 and therefore d rSP R (A, B) ≤ m − 1 as required.