In this paper, we extend the class of energy functions for which the optimal alpha-expansion and alphabeta-swap moves can be computed in polynomial time. Specifically, we introduce a novel family of higher order clique potentials, and show that the expansion and swap moves for any energy function composed of these potentials can be found by minimizing a submodular function. We also show that for a subset of these potentials, the optimal move can be found by solving an st-mincut problem. We refer to this subset as the Pn Potts model. Our results enable the use of powerful alpha-expansion and alphabeta-swap move making algorithms for minimization of energy functions involving higher order cliques. Such functions have the capability of modeling the rich statistics of natural scenes and can be used for many applications in Computer Vision. We demonstrate their use in one such application, i.e., the texture-based image or video-segmentation problem.