An Efficient Message-Passing Algorithm for the M-Best MAP Problem