A Diagnosis Algorithm on the 2D-torus Network