New design of the pairwise term, both the adjacent matrix and the potential
New design of the pairwise term, both the adjacent matrix and the potential