## Let's use L2 distance matrix of iris dataset
data(iris)
dx = as.matrix(stats::dist(iris[,1:4]))
# perturb d(i,j)
dy = dx
dy[1,2] <- dy[2,1] <- 10
# run the algorithm
checkmetric(dx)
checkmetric(dy)
Run the code above in your browser using DataLab