  Here we study an efficient algorithm for decoding the topological codes. It
is based on a simple principle, which should allow straightforward
generalization to complex decoding problems. It is benchmarked with the planar
code for both i.i.d. and spatially correlated errors and is found to compare
well with existing methods.
