  The worm algorithm is a versatile technique in the Markov chain Monte Carlo
method for both classical and quantum systems. The algorithm substantially
alleviates critical slowing down and reduces the dynamic critical exponents of
various classical systems. It is crucial to improve the algorithm and push the
boundary of the Monte Carlo method for physical systems. We here propose a
directed worm algorithm that significantly improves computational efficiency.
We use the geometric allocation approach to optimize the worm scattering
process: worm backscattering is averted, and forward scattering is favored. Our
approach successfully enhances the diffusivity of the worm head (kink), which
is evident in the probability distribution of the relative position of the two
kinks. Performance improvement is demonstrated for the Ising model at the
critical temperature by measurement of exponential autocorrelation times and
asymptotic variances. The present worm update is approximately 25 times as
efficient as the conventional worm update for the simple cubic lattice model.
Surprisingly, our algorithm is even more efficient than the Wolff cluster
algorithm, which is one of the best update algorithms. We estimate the dynamic
critical exponent of the simple cubic lattice Ising model to be $z \approx
0.27$ in the worm update. The worm and the Wolff algorithms produce different
exponents of the integrated autocorrelation time of the magnetic susceptibility
estimator but the same exponent of the asymptotic variance. We also discuss how
to quantify the computational efficiency of the Markov chain Monte Carlo
method. Our approach can be applied to a wide range of physical systems, such
as the $| \phi |^4$ model, the Potts model, the O($n$) loop model, and lattice
QCD.
