Define the potential
V(a)=∑i=1n−1∣ai+1−ai∣+∣an−a1∣.V(a)=\sum_{i=1}^{n-1}|a_{i+1}-a_i|+|a_n-a_1|.V(a)=∑i=1n−1∣ai+1−ai∣+∣an−a1∣.
This is only a way to measure the row; it does not add a legal neighbor to either endpoint. A singleton has potential zero.