The energy is composed of two terms; first is the Ising-type interaction energy

where a and b are arbitrary constants to scale and shift the energy distribution, the delta is the Kronecker delta function, and Ci and Cj are the "colors" (district numbers) of tract i and j, respectively. The interaction energy is summed over all neighbors of each census tract. In this way, tracts with neighbors in the same district have a favorable (negative energy) interaction, while otherwise the interaction is unfavorable (positive energy) if the tract's neighbors are in a different district.

The second energy term is the population energy

where α and β are again arbitrary constants to scale and shift the population energy distribution and Ptotal and Pi are the total population and the population of district i, respectively. This is kind of like the standard deviation of the set of district populations and imposes an energy penalty (positive energy) if the district populations are too uneven.