Definition of the Euclidean distance is taken from (Mitchell, 1997, p. 232).