Abstract
An algorithm is presented for error correction in the surface code quantum memory. This is shown to correct depolarizing noise up to a threshold error rate of 18.5%, exceeding previous results and coming close to the upper bound of 18.9%. The time complexity of the algorithm is found to be polynomial with error suppression, allowing efficient error correction for codes of realistic sizes.