Whitehead's algorithm

Whitehead's algorithm is a mathematical algorithm in group theory for solving the automorphic equivalence problem in the finite rank free group Fn. The algorithm is based on a classic 1936 paper of J. H. C. Whitehead. It is still unknown (except for the case n = 2) if Whitehead's algorithm has polynomial time complexity.

Statement of the problem
Let $$ F_n=F(x_1,\dots, x_n)$$ be a free group of rank $$n\ge 2$$ with a free basis $$ X=\{x_1,\dots, x_n\}$$. The automorphism problem, or the automorphic equivalence problem for $$F_n$$ asks, given two freely reduced words $$ w, w'\in F_n$$ whether there exists an automorphism $$\varphi\in \operatorname{Aut}(F_n)$$ such that $$ \varphi(w)=w'$$.

Thus the automorphism problem asks, for $$ w, w'\in F_n$$ whether $$\operatorname{Aut}(F_n)w=\operatorname{Aut}(F_n)w'$$. For $$ w, w'\in F_n$$ one has $$\operatorname{Aut}(F_n)w=\operatorname{Aut}(F_n)w'$$ if and only if $$\operatorname{Out}(F_n)[w]=\operatorname{Out}(F_n)[w']$$, where $$[w], [w']$$ are conjugacy classes in $$F_n$$ of $$ w, w'$$ accordingly. Therefore, the automorphism problem for $$F_n$$ is often formulated in terms of $$\operatorname{Out}(F_n)$$-equivalence of conjugacy classes of elements of $$F_n$$.

For an element $$ w\in F_n$$, $$|w|_X$$ denotes the freely reduced length of $$w$$ with respect to $$X$$, and $$\|w\|_X$$ denotes the cyclically reduced length of $$w$$ with respect to $$X$$. For the automorphism problem, the length of an input $$w$$ is measured as $$|w|_X$$ or as $$\|w\|_X$$, depending on whether one views $$w$$ as an element of $$F_n$$ or as defining the corresponding conjugacy class $$[w]$$ in $$F_n$$.

History
The automorphism problem for $$F_n$$ was algorithmically solved by J. H. C. Whitehead in a classic 1936 paper, and his solution came to be known as Whitehead's algorithm. Whitehead used a topological approach in his paper. Namely, consider the 3-manifold $$M_n=\#_{i=1}^n \mathbb S^2\times \mathbb S^1$$, the connected sum of $$n$$ copies of $$\mathbb S^2\times \mathbb S^1$$. Then $$\pi_1(M_n)\cong F_n$$, and, moreover, up to a quotient by a finite normal subgroup isomorphic to $$\mathbb Z_2^n$$, the mapping class group of $$M_n$$ is equal to $$\operatorname{Out}(F_n)$$; see. Different free bases of $$F_n$$ can be represented by isotopy classes of "sphere systems" in $$M_n$$, and the cyclically reduced form of an element $$w\in F_n$$, as well as the Whitehead graph of $$[w]$$, can be "read-off" from how a loop in general position representing $$[w]$$ intersects the spheres in the system. Whitehead moves can be represented by certain kinds of topological "swapping" moves modifying the sphere system.

Subsequently, Rapaport, and later, based on her work, Higgins and Lyndon, gave a purely combinatorial and algebraic re-interpretation of Whitehead's work and of Whitehead's algorithm. The exposition of Whitehead's algorithm in the book of Lyndon and Schupp is based on this combinatorial approach. Culler and Vogtmann, in their 1986 paper that introduced the Outer space, gave a hybrid approach to Whitehead's algorithm, presented in combinatorial terms but closely following Whitehead's original ideas.

Whitehead's algorithm
Our exposition regarding Whitehead's algorithm mostly follows Ch.I.4 in the book of Lyndon and Schupp, as well as.

Overview
The automorphism group $$\operatorname{Aut}(F_n)$$ has a particularly useful finite generating set $$ \mathcal W$$ of Whitehead automorphisms or Whitehead moves. Given $$w,w'\in F_n $$ the first part of Whitehead's algorithm consists of iteratively applying Whitehead moves to $$w,w'$$ to take each of them to an ``automorphically minimal" form, where the cyclically reduced length strictly decreases at each step. Once we find automorphically these minimal forms $$u,u'$$ of $$w,w'$$, we check if $$\|u\|_X=\|u'\|_X$$. If $$\|u\|_X\ne \|u'\|_X$$ then $$w,w'$$ are not automorphically equivalent in $$F_n$$.

If $$\|u\|_X=\|u'\|_X$$, we check if there exists a finite chain of Whitehead moves taking $$u$$ to $$u'$$ so that the cyclically reduced length remains constant throughout this chain. The elements $$w,w'$$ are not automorphically equivalent in $$F_n$$ if and only if such a chain exists.

Whitehead's algorithm also solves the search automorphism problem for $$F_n$$. Namely, given $$w,w'\in F_n $$, if Whitehead's algorithm concludes that $$\operatorname{Aut}(F_n)w=\operatorname{Aut}(F_n)w'$$, the algorithm also outputs an automorphism $$\varphi\in\operatorname{Aut}(F_n)$$ such that $$\varphi(w)=w'$$. Such an element $$\varphi\in\operatorname{Aut}(F_n)$$ is produced as the composition of a chain of Whitehead moves arising from the above procedure and taking $$w$$ to $$w'$$.

Whitehead automorphisms
A Whitehead automorphism, or Whitehead move, of $$F_n$$ is an automorphism $$\tau\in \operatorname{Aut}(F_n)$$ of $$F_n$$ of one of the following two types:

(i) There is a permutation $$\sigma\in S_n$$ of $$\{1,2,\dots, n\}$$ such that for $$i=1,\dots, n$$
 * $$ \tau(x_i)=x_{\sigma(i)}^{\pm 1}$$
 * Such $$\tau$$ is called a Whitehead automorphism of the first kind.

(ii) There is an element $$a\in X^{\pm 1}$$, called the multiplier, such that for every $$x\in X^{\pm 1}$$


 * $$\tau(x)\in \{x, xa, a^{-1}x, a^{-1}xa\}.$$


 * Such $$\tau$$ is called a Whitehead automorphism of the second kind. Since $$\tau$$ is an automorphism of $$F_n$$, it follows that $$\tau(a)=a$$ in this case.

Often, for a Whitehead automorphism $$\tau\in\operatorname{Aut}(F_n)$$, the corresponding outer automorphism in $\operatorname{Out}(F_n)$ is also called a Whitehead automorphism or a Whitehead move.

Examples
Let $$F_4=F(x_1,x_2,x_3,x_4)$$.

Let $$\tau: F_4\to F_4$$ be a homomorphism such that
 * $$ \tau(x_1)=x_2x_1, \quad \tau(x_2)=x_2, \quad\tau(x_3)=x_2x_3x_2^{-1},\quad \tau(x_4)=x_4$$

Then $$\tau$$ is actually an automorphism of $$F_4$$, and, moreover, $$\tau$$ is a Whitehead automorphism of the second kind, with the multiplier $$a=x_2^{-1}$$.

Let $$\tau': F_4\to F_4$$ be a homomorphism such that
 * $$ \tau'(x_1)=x_1, \quad \tau'(x_2)=x_1^{-1}x_2x_1, \quad\tau'(x_3)=x_1^{-1}x_3x_1,\quad \tau'(x_4)=x_1^{-1}x_4x_1$$

Then $$\tau'$$ is actually an inner automorphism of $$F_4$$ given by conjugation by $$x_1$$, and, moreover, $$\tau'$$is a Whitehead automorphism of the second kind, with the multiplier $$a=x_1$$.

Automorphically minimal and Whitehead minimal elements
For $$w\in F_n$$, the conjugacy class $$[w]$$ is called automorphically minimal if for every $$\varphi\in\operatorname{Aut}(F_n)$$ we have $$\|w\|_X\le \|\varphi(w)\|_X$$. Also, a conjugacy class $$[w]$$ is called Whitehead minimal if for every Whitehead move $$\tau\in \operatorname{Aut}(F_n)$$ we have $$\|w\|_X\le \|\tau(w)\|_X$$.

Thus, by definition, if $$[w]$$ is automorphically minimal then it is also Whitehead minimal. It turns out that the converse is also true.

Whitehead's "Peak Reduction Lemma"
The following statement is referred to as Whitehead's "Peak Reduction Lemma", see Proposition 4.20 in and Proposition 1.2 in:

Let $$w\in F_n$$. Then the following hold:

(1) If $$[w]$$ is not automorphically minimal, then there exists a Whitehead automorphism $$\tau\in \operatorname{Aut}(F_n)$$ such that $$\|\tau(w)\|_X< \|w\|_X$$.

(2) Suppose that $$[w]$$ is automorphically minimal, and that another conjugacy class $$[w']$$ is also automorphically minimal. Then $$\operatorname{Aut}(F_n)w=\operatorname{Aut}(F_n)w'$$ if and only if $$\|w\|_X=\|w'\|_X$$ and there exists a finite sequence of Whitehead moves $$\tau_1,\dots, \tau_k\in\operatorname{Aut}(F_n)$$ such that
 * $$\tau_k\cdots \tau_1(w)=w'$$

and
 * $$ \|\tau_i\cdots\tau_1(w)\|_X=\|w\|_X \text{ for } i=1,\dots, k.$$

Part (1) of the Peak Reduction Lemma implies that a conjugacy class $$[w]$$ is Whitehead minimal if and only if it is automorphically minimal.

The automorphism graph
The automorphism graph $$\mathcal A$$ of $$F_n$$ is a graph with the vertex set being the set of conjugacy classes $$[u]$$ of elements $$u\in F_n$$. Two distinct vertices $$[u], [v]$$ are adjacent in $$\mathcal A$$ if $$\|u\|_X=\|v\|_X$$ and there exists a Whitehead automorphism $$\tau$$ such that $$[\tau(u)]=[v]$$. For a vertex $$[u]$$ of $$\mathcal A$$, the connected component of $$[u]$$ in $$\mathcal A$$ is denoted $$\mathcal A[u]$$.

Whitehead graph
For $$1\ne w\in F_n$$ with cyclically reduced form $$u$$, the Whitehead graph $$\Gamma_{[w]}$$ is a labelled graph with the vertex set $$X^{\pm 1}$$, where for $$x,y\in X^{\pm 1}, x\ne y$$ there is an edge joining $$x$$ and $$y$$ with the label or "weight" $$n(\{x,y\};[w])$$ which is equal to the number of distinct occurrences of subwords $$x^{-1}y, y^{-1}x$$ read cyclically in $$u$$. (In some versions of the Whitehead graph one only includes the edges with $$n(\{x,y\};[w])>0$$.)

If $$\tau\in\operatorname{Aut}(F_n)$$ is a Whitehead automorphism, then the length change $$\|\tau(w)\|_X-\|w\|_X$$ can be expressed as a linear combination, with integer coefficients determined by $$\tau$$, of the weights $$n(\{x,y\};[w])$$ in the Whitehead graph $$\Gamma_{[w]}$$. See Proposition 4.16 in Ch. I of. This fact plays a key role in the proof of Whitehead's peak reduction result.

Whitehead's minimization algorithm
Whitehead's minimization algorithm, given a freely reduced word $$w\in F_n$$, finds an automorphically minimal $$[v]$$ such that $$\operatorname{Aut}(F_n)w=\operatorname{Aut}(F_n)v.$$

This algorithm proceeds as follows. Given $$w\in F_n$$, put $$w_1=w$$. If $$w_i$$ is already constructed, check if there exists a Whitehead automorphism $$\tau\in\operatorname{Aut}(F_n)$$ such that $$\|\tau(w_i)\|_X<\|w_i\|_X$$. (This condition can be checked since the set of Whitehead automorphisms of $$F_n$$ is finite.) If such $$\tau$$ exists, put $$w_{i+1}=\tau(w_i)$$ and go to the next step. If no such $$\tau$$ exists, declare that $$[w_i]$$ is automorphically minimal, with $$\operatorname{Aut}(F_n)w=\operatorname{Aut}(F_n)w_i$$, and terminate the algorithm.

Part (1) of the Peak Reduction Lemma implies that the Whitehead's minimization algorithm terminates with some $$w_m$$, where $$m\le\|w\|_X$$, and that then $$[w_m]$$ is indeed automorphically minimal and satisfies $$\operatorname{Aut}(F_n)w=\operatorname{Aut}(F_n)w_m$$.

Whitehead's algorithm for the automorphic equivalence problem
Whitehead's algorithm for the automorphic equivalence problem, given $$w,w'\in F_n$$ decides whether or not $$\operatorname{Aut}(F_n)w=\operatorname{Aut}(F_n)w'$$.

The algorithm proceeds as follows. Given $$w,w'\in F_n$$, first apply the Whitehead minimization algorithm to each of $$w,w'$$ to find automorphically minimal $$[v],[v']$$ such that $$\operatorname{Aut}(F_n)w=\operatorname{Aut}(F_n)v$$ and $$\operatorname{Aut}(F_n)w'=\operatorname{Aut}(F_n)v'$$. If $$\|v\|_X\ne \|v'\|_X$$, declare that $$\operatorname{Aut}(F_n)w\ne\operatorname{Aut}(F_n)w'$$ and terminate the algorithm. Suppose now that $$\|v\|_X=\|v'\|_X=t\ge 0$$. Then check if there exists a finite sequence of Whitehead moves $$\tau_1,\dots, \tau_k\in\operatorname{Aut}(F_n)$$ such that


 * $$\tau_k\dots \tau_1(v)=v'$$

and
 * $$ \|\tau_i\dots\tau_1(v)\|_X=\|v\|_X=t \text{ for } i=1,\dots, k.$$

This condition can be checked since the number of cyclically reduced words of length $$t$$ in $$F_n$$ is finite. More specifically, using the breadth-first approach, one constructs the connected components $$\mathcal A[v], \mathcal A[v']$$ of the automorphism graph and checks if $$\mathcal A[v]\cap \mathcal A[v']=\varnothing$$.

If such a sequence exists, declare that $$\operatorname{Aut}(F_n)w=\operatorname{Aut}(F_n)w'$$, and terminate the algorithm. If no such sequence exists, declare that $$\operatorname{Aut}(F_n)w\neq\operatorname{Aut}(F_n)w'$$ and terminate the algorithm.

The Peak Reduction Lemma implies that Whitehead's algorithm correctly solves the automorphic equivalence problem in $$ F_n$$. Moreover, if $$\operatorname{Aut}(F_n)w=\operatorname{Aut}(F_n)w'$$, the algorithm actually produces (as a composition of Whitehead moves) an automorphism $$\varphi\in\operatorname{Aut}(F_n)$$ such that $$\varphi(w)=w'$$.

Computational complexity of Whitehead's algorithm

 * If the rank $$n\ge 2$$ of $$F_n$$ is fixed, then, given $$w\in F_n$$, the Whitehead minimization algorithm always terminates in quadratic time $$O(|w|_X^2)$$ and produces an automorphically minimal cyclically reduced word $$u\in F_n$$ such that $$\operatorname{Aut}(F_n)w=\operatorname{Aut}(F_n)u$$. Moreover, even if $$n$$ is not considered fixed, (an adaptation of) the Whitehead minimization algorithm on an input $$w\in F_n$$ terminates in time $$O(|w|_X^2 n^3)$$.
 * If the rank $$n\ge 3$$ of $$F_n$$ is fixed, then for an automorphically minimal $$u\in F_n$$ constructing the graph $$\mathcal A[u]$$ takes $$O\left(\|u\|_X\cdot \#V\mathcal A[u]\right)$$ time and thus requires a priori exponential time in $$|u|_X)$$. For that reason Whitehead's algorithm for deciding, given $$w,w'\in F_n$$, whether or not $$\operatorname{Aut}(F_n)w=\operatorname{Aut}(F_n)w'$$, runs in at most exponential time in $$\max\{|w|_X,|w'|_X\}$$.
 * For $$n=2$$, Khan proved that for an automorphically minimal $$u\in F_2$$, the graph $$\mathcal A[u]$$ has at most $$O\left(\|u\|_X\right)$$ vertices and hence constructing the graph $$\mathcal A[u]$$ can be done in quadratic time in $$|u|_X$$. Consequently, Whitehead's algorithm for the automorphic equivalence problem in $$F_2$$, given $$w,w'\in F_2$$ runs in quadratic time in $$\max\{|w|_X,|w'|_X\}$$.

Applications, generalizations and related results

 * Whitehead's algorithm can be adapted to solve, for any fixed $$m\ge 1$$, the automorphic equivalence problem for m-tuples of elects of $$F_n$$ and for m-tuples of conjugacy classes in $$F_n$$; see Ch.I.4 of and
 * McCool used Whitehead's algorithm and the peak reduction to prove that for any $$w\in F_n$$ the stabilizer $$ \operatorname{Stab}_{\operatorname{Out}(F_n)}([w])$$ is finitely presentable, and obtained a similar results for $$\operatorname{Out}(F_n)$$-stabilizers of m-tuples of conjugacy classes in $$F_n$$. McCool also used the peak reduction method to construct of a finite presentation of the group $$\operatorname{Aut}(F_n)$$ with the set of Whitehead automorphisms as the generating set. He then used this presentation to recover a finite presentation for $$\operatorname{Aut}(F_n)$$, originally due to Nielsen, with Nielsen automorphisms as generators.
 * Gersten obtained a variation of Whitehead's algorithm, for deciding, given two finite subsets $$ S,S'\subseteq F_n$$, whether the subgroups $$H=\langle S\rangle, H'=\langle S'\rangle\le F_n$$ are automorphically equivalent, that is, whether there exists $$\varphi\in\operatorname{Aut}(F_n)$$ such that $$\varphi(H)=H'$$.
 * Whitehead's algorithm and peak reduction play a key role in the proof by Culler and Vogtmann that the Culler–Vogtmann Outer space is contractible.
 * Collins and Zieschang obtained analogs of Whitehead's peak reduction and of Whitehead's algorithm for automorphic equivalence in free products of groups.
 * Gilbert used a version of a peak reduction lemma to construct a presentation for the automorphism group $$\operatorname{Aut}(G)$$ of a free product $$G=\ast_{i=1}^m G_i$$.
 * Levitt and Vogtmann produced a Whitehead-type algorithm for saving the automorphic equivalence problem (for elects, m-tuples of elements and m-tuples of conjugacy classes) in a group $$G=\pi_1(S)$$ where $$S$$ is a closed hyperbolic surface.
 * If an element $$w\in F_n=F(X)$$ chosen uniformly at random from the sphere of radius $$m\ge 1$$ in $$F(X)$$, then, with probability tending to 1 exponentially fast as $$m\to\infty$$, the conjugacy class $$[w]$$ is already automorphically minimal and, moreover, $$\#V\mathcal A[w]=O\left(\|w\|_X\right)=O(m)$$. Consequently, if $$w,w'\in F_n$$ are two such ``generic" elements, Whitehead's algorithm decides whether $$w,w'$$ are automorphically equivalent in linear time in $$\max\{|w|_X,|w'|_X\}$$.
 * Similar to the above results hold for the genericity of automorphic minimality for ``randomly chosen" finitely generated subgroups of $$F_n$$.
 * Lee proved that if $$u\in F_n=F(X)$$ is a cyclically reduced word such that $$[u]$$ is automorphically minimal, and if whenever $$x_i,x_j, i<j$$ both occur in $$u$$ or $$u^{-1}$$ then the total number of occurrences of $$x_i^{\pm 1}$$ in $$u$$ is smaller than the number of occurrences of $$x_i^{\pm 1}$$, then $$\#V\mathcal A[u]$$ is bounded above by a polynomial of degree $$2n-3$$ in $$|u|_X$$. Consequently, if $$w,w'\in F_n, n\ge 3$$ are such that $$w$$ is automorphically equivalent to some $$u$$ with the above property, then Whitehead's algorithm decides whether $$w,w'$$ are automorphically equivalent in time $$O\left(\max\{|w|_X^{2n-3},|w'|_X^2\}\right)$$.
 * The Garside algorithm for solving the conjugacy problem in braid groups has a similar general structure to Whitehead's algorithm, with "cycling moves" playing the role of Whitehead moves.
 * Clifford and Goldstein used Whitehead-algorithm based techniques to produce an algorithm that, given a finite subset $$Z\subseteq F_n$$ decides whether or not the subgroup $$H=\langle Z\rangle\le F_n$$ contains a primitive element of $$F_n,$$ that is an element of a free generating set of $$F_n.$$
 * Day obtained analogs of Whitehead's algorithm and of Whitehead's peak reduction for automorphic equivalence of elements of right-angled Artin groups.