Early  termination of local algorithms