  We derive a rigorous upper bound on the classical computation time of
finite-ranged tensor network contractions in $d \geq 2$ dimensions.
Consequently, we show that quantum circuits of single-qubit and finite-ranged
two-qubit gates can be classically simulated in subexponential time in the
number of gates. Moreover, we present and implement an algorithm guaranteed to
meet our bound and which finds contraction orders with vastly lower
computational times in practice. In many practically relevant cases this beats
standard simulation schemes and, for certain quantum circuits, also a
state-of-the-art method. Specifically, our algorithm leads to speedups of
several orders of magnitude over naive contraction schemes for two-dimensional
quantum circuits on as little as an $8 \times 8$ lattice. We obtain similarly
efficient contraction schemes for Google's Sycamore-type quantum circuits,
instantaneous quantum polynomial-time circuits, and non-homogeneous
(2+1)-dimensional random quantum circuits.
