Maximal Cliques that Satisfy Hard Constraints with Application to Deformable Object Model Learning