A reduced algorithm from Faugeras-Berthod's theorem in labeling problems