delta is a symmetric matrix. 
you don't need to compute delta[i, j] and delta[j, i] as they are equal...