Implements algorithms for minimizing functions of binary variables with unary and pairwise terms based on roof duality