  We introduce an efficient algorithm for the computation of the $W_3$
invariant of general unitary maps, which converges rapidly even on coarse
discretization grids. The algorithm does not require extensive manipulation of
the unitary maps, identification of the precise positions of degeneracy points,
or fixing the gauge of eigenvectors. After construction of the general
algorithm, we explain its application to the $2+1$ dimensional maps that arise
in the Floquet-Bloch theory of periodically driven two-dimensional quantum
systems. We demonstrate this application by computing the $W_3$ invariant for
an irradiated graphene model with a continuously modulated Hamilton operator,
where it predicts the number of anomalous edge states in each gap.
