Homogenization of energies defined on pairs set-function