Working neighbour algorithm