modified clique potential computation