  A finite permutation group $G$ on $\Omega$ is called a rank 3 group if it has
precisely three orbits in its induced action on $\Omega \times \Omega$. The
largest permutation group on $\Omega$ having the same orbits as $G$ on $\Omega
\times \Omega$ is called the 2-closure of $G$. We construct a polynomial-time
algorithm which given generators of a rank 3 group computes generators of its
2-closure.
